From fbee380daeeb8cce02751063d14392963c25b670 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 7 Oct 2021 08:34:58 -0700 Subject: [PATCH] [DOCS] Fixes ML get scheduled events API (#78809) --- .../ml/apis/get-calendar-event.asciidoc | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/docs/reference/ml/apis/get-calendar-event.asciidoc b/docs/reference/ml/apis/get-calendar-event.asciidoc index c8d614f57caf3..6f2f98ede9d0c 100644 --- a/docs/reference/ml/apis/get-calendar-event.asciidoc +++ b/docs/reference/ml/apis/get-calendar-event.asciidoc @@ -27,15 +27,42 @@ calendars by using `_all`. `calendar_id` (required):: (string) Identifier for the calendar. +==== Query Parameters + +`end`:: + (Optional, string) Specifies to get events with timestamps earlier than this + time. + +`from`:: + (Optional, integer) Skips the specified number of events. Defaults to `0`. + +`job_id`:: + (Optional, string) Specifies to get events for a specific {anomaly-job} + identifier or job group. It must be used with a calendar identifier of `_all` + or `*`. + +`size`:: + (Optional, integer) Specifies the maximum number of events to obtain. Defaults + to `100`. + +`start`:: + (Optional, string) Specifies to get events with timestamps after this time. + + ==== Request Body `end`:: (string) Specifies to get events with timestamps earlier than this time. -`from`:: +`job_id`:: + (string) Specifies to get events for a specific {anomaly-job} + identifier or job group. It must be used with a calendar identifier of `_all` + or `*`. + +`page.from`:: (integer) Skips the specified number of events. -`size`:: +`page.size`:: (integer) Specifies the maximum number of events to obtain. `start`:: @@ -105,3 +132,12 @@ The API returns the following results: // TESTRESPONSE[s/Ly8LJGEBMTCMA-qz49st/$body.$_path/] For more information about these properties, see <>. + +The following example retrieves scheduled events that occur within a specific +period of time: + +[source,console] +-------------------------------------------------- +GET _ml/*/planned-outages/events?start=1635638400000&end=1635724800000 +-------------------------------------------------- +// TEST[skip:setup:calendar_outages_addevent] \ No newline at end of file