From 1cefb670695a47d341b8a1585e119413e1014c1b Mon Sep 17 00:00:00 2001 From: haser Date: Wed, 6 Dec 2023 16:20:41 +0800 Subject: [PATCH 1/2] [YUNIKORN-2217] Add Missing REST Endpoint description for batch event in documentation --- docs/api/scheduler.md | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/docs/api/scheduler.md b/docs/api/scheduler.md index eb5c7b55617..218ed74623b 100644 --- a/docs/api/scheduler.md +++ b/docs/api/scheduler.md @@ -1895,3 +1895,68 @@ 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 + +### 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 From 2e6b7080c7dcba509c239a31af6feef1b294eeaf Mon Sep 17 00:00:00 2001 From: Haser0305 Date: Fri, 26 Jan 2024 20:22:03 +0800 Subject: [PATCH 2/2] add the URL query parameters. --- docs/api/scheduler.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/api/scheduler.md b/docs/api/scheduler.md index 218ed74623b..5c68ccda35e 100644 --- a/docs/api/scheduler.md +++ b/docs/api/scheduler.md @@ -1907,6 +1907,12 @@ Endpoint is used to retrieve a batch of event records. **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`