From abeb30e5876afd00771f180a24dfea040f5b00ba Mon Sep 17 00:00:00 2001 From: haser <haser1156@gmail.com> Date: Fri, 26 Jan 2024 13:39:54 +0100 Subject: [PATCH] [YUNIKORN-2217] Add Missing REST Endpoint description for batch event in documentation (#379) Closes: #379 Signed-off-by: Peter Bacsko <pbacsko@cloudera.com> --- docs/api/scheduler.md | 71 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/docs/api/scheduler.md b/docs/api/scheduler.md index b4ed89342a2..a6a77a3081b 100644 --- a/docs/api/scheduler.md +++ b/docs/api/scheduler.md @@ -2044,3 +2044,74 @@ None ### Error response **Code**: `400 Bad Request` + + +## Batch Events + +Endpoint is used to retrieve a batch of event records. + +**URL**: `/ws/v1/events/batch` + +**METHOD** : `GET` + +**Auth required** : NO + +**URL query parameters** : +- `count` (optional) : Specifies the maxmem number of events to be included in the response. +- `start` (optional) : Specifies the starting ID for retrieving events. If the specified ID is outside the ring buffer +(too low or too high), the response will include the lowest and highest ID values with `EventRecords` being empty. + + +### Success response + +**Code**: `200 OK` + +**Content examples** + +```json +{ + "InstanceUUID": "400046c6-2180-41a2-9be1-1c251ab2c498", + "LowestID": 0, + "HighestID": 7, + "EventRecords": [ + { + "type": 3, + "objectID": "yk8s-worker", + "message": "schedulable: true", + "timestampNano": 1701347180239597300, + "eventChangeType": 1, + "eventChangeDetail": 302, + "resource": {} + }, + { + "type": 3, + "objectID": "yk8s-worker", + "message": "Node added to the scheduler", + "timestampNano": 1701347180239650600, + "eventChangeType": 2, + "resource": { + "resources": { + "ephemeral-storage": { + "value": 502921060352 + }, + "hugepages-1Gi": {}, + "hugepages-2Mi": {}, + "memory": { + "value": 33424998400 + }, + "pods": { + "value": 110 + }, + "vcore": { + "value": 8000 + } + } + } + } + ] +} +``` + +### Error response + +**Code** : `500 Internal Server Error` \ No newline at end of file