Skip to content

Commit

Permalink
[YUNIKORN-2337] Update documentation about event streaming (#401)
Browse files Browse the repository at this point in the history
Closes: #401

Signed-off-by: Wilfred Spiegelenburg <[email protected]>
  • Loading branch information
pbacsko authored and wilfred-s committed Feb 21, 2024
1 parent 407bc3b commit 2801670
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion docs/api/scheduler.md
Original file line number Diff line number Diff line change
Expand Up @@ -2093,4 +2093,38 @@ Endpoint is used to retrieve a batch of event records.

### Error response

**Code** : `500 Internal Server Error`
**Code** : `500 Internal Server Error`

### Event stream

Creates a persistent HTTP connection for event streaming. New events are sent to the clients immediately, so unlike the batch interface, there is no need for polling.
The number of active connections is limited. The default setting is 100 connections total and 15 connections per host. The respective configmap properties are `event.maxStreams` and `event.maxStreamsPerHost`.

**URL**: `/ws/v1/events/stream`

**METHOD** : `GET`

**Auth required** : NO

**URL query parameters**:
- `count` (optional) : Specifies the number of past events (those which have been generated before the connection establishment) to include in the response. Default value is 0.

### Success response

**Code**: `200 OK`

**Content examples**

```json
{"type":2,"objectID":"app-1","timestampNano":1708465452903045265,"eventChangeType":1,"eventChangeDetail":204,"resource":{}}
{"type":2,"objectID":"app-1","timestampNano":1708465452903192898,"eventChangeType":2,"eventChangeDetail":201,"referenceID":"alloc-1","resource":{"resources":{"memory":{"value":10000000},"vcore":{"value":1000}}}}
{"type":3,"objectID":"node-1:1234","timestampNano":1708465452903312146,"eventChangeType":2,"eventChangeDetail":303,"referenceID":"alloc-1","resource":{"resources":{"memory":{"value":10000000},"vcore":{"value":1000}}}}
{"type":2,"objectID":"app-1","timestampNano":1708465452903474210,"eventChangeType":1,"eventChangeDetail":205,"resource":{}}
{"type":5,"objectID":"testuser","timestampNano":1708465452903506166,"eventChangeType":2,"eventChangeDetail":603,"referenceID":"root.singleleaf","resource":{"resources":{"memory":{"value":10000000},"vcore":{"value":1000}}}}
```

### Error responses

**Code** : `400 Bad Request` (URL query is invalid)
**Code** : `503 Service Unavailable` (Too many active streaming connections)
**Code** : `500 Internal Server Error`

0 comments on commit 2801670

Please sign in to comment.