@@ -26,8 +26,8 @@ Requires the `monitor_ml` cluster privilege. This privilege is included in the
2626
2727You can get scheduled event information for multiple calendars in a single
2828API request by using a comma-separated list of ids or a wildcard expression.
29- You can get scheduled event information for all calendars by using `_all`,
30- by specifying `*` as the `<calendar_id>`, or by omitting the `<calendar_id>`.
29+ You can get scheduled event information for all calendars by using `_all` or `*`
30+ as the `<calendar_id>`.
3131
3232For more information, see
3333{ml-docs}/ml-calendars.html[Calendars and scheduled events].
@@ -39,6 +39,28 @@ For more information, see
3939(Required, string)
4040include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id]
4141
42+ [[ml-get-calendar-event-query-parms]]
43+ == {api-query-parms-title}
44+
45+ `end`::
46+ (Optional, string) Specifies to get events with timestamps earlier than this
47+ time.
48+
49+ `from`::
50+ (Optional, integer) Skips the specified number of events. Defaults to `0`.
51+
52+ `job_id`::
53+ (Optional, string) Specifies to get events for a specific {anomaly-job}
54+ identifier or job group. It must be used with a calendar identifier of `_all`
55+ or `*`.
56+
57+ `size`::
58+ (Optional, integer) Specifies the maximum number of events to obtain. Defaults
59+ to `100`.
60+
61+ `start`::
62+ (Optional, string) Specifies to get events with timestamps after this time.
63+
4264[[ml-get-calendar-event-request-body]]
4365== {api-request-body-title}
4466
@@ -47,17 +69,22 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id]
4769 time. Defaults to unset, which means results are not
4870 limited to specific timestamps.
4971
50- `from`::
72+ `job_id`::
73+ (Optional, string) Specifies to get events for a specific {anomaly-job}
74+ identifier or job group. It must be used with a calendar identifier of `_all`
75+ or `*`.
76+
77+ `page.from`::
5178 (Optional, integer) Skips the specified number of events. Defaults to `0`.
5279
53- `size`::
80+ `page. size`::
5481 (Optional, integer) Specifies the maximum number of events to obtain.
5582 Defaults to `100`.
5683
5784`start`::
5885 (Optional, string) Specifies to get events with timestamps after this time.
59- Defaults to unset, which means results are not limited to
60- specific timestamps.
86+ Defaults to unset, which means results are not limited to specific
87+ timestamps.
6188
6289[[ml-get-calendar-event-results]]
6390== {api-response-body-title}
@@ -126,3 +153,12 @@ The API returns the following results:
126153// TESTRESPONSE[s/LS8LJGEBMTCMA-qz49st/$body.$_path/]
127154// TESTRESPONSE[s/Li8LJGEBMTCMA-qz49st/$body.$_path/]
128155// TESTRESPONSE[s/Ly8LJGEBMTCMA-qz49st/$body.$_path/]
156+
157+ The following example retrieves scheduled events that occur within a specific
158+ period of time:
159+
160+ [source,console]
161+ --------------------------------------------------
162+ GET _ml/*/planned-outages/events?start=1635638400000&end=1635724800000
163+ --------------------------------------------------
164+ // TEST[skip:setup:calendar_outages_addevent]
0 commit comments