This is an automated email from the ASF dual-hosted git repository.

wilfreds pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 2801670fca [YUNIKORN-2337] Update documentation about event streaming 
(#401)
2801670fca is described below

commit 2801670fca9d257631c406f1ee673a3fbc3578fe
Author: Peter Bacsko <[email protected]>
AuthorDate: Thu Feb 22 10:37:48 2024 +1100

    [YUNIKORN-2337] Update documentation about event streaming (#401)
    
    Closes: #401
    
    Signed-off-by: Wilfred Spiegelenburg <[email protected]>
---
 docs/api/scheduler.md | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/docs/api/scheduler.md b/docs/api/scheduler.md
index 6ab615bb54..4517603ac3 100644
--- a/docs/api/scheduler.md
+++ b/docs/api/scheduler.md
@@ -2093,4 +2093,38 @@ Endpoint is used to retrieve a batch of event records.
 
 ### Error response
 
-**Code** : `500 Internal Server Error`
\ No newline at end of file
+**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`


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to