2018-01-24 11:14:23 -05:00
|
|
|
[role="xpack"]
|
2018-08-31 19:49:24 -04:00
|
|
|
[testenv="platinum"]
|
2018-01-24 11:14:23 -05:00
|
|
|
[[ml-get-calendar-event]]
|
|
|
|
=== Get Scheduled Events API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Get Scheduled Events</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
2018-06-13 16:37:35 -04:00
|
|
|
Retrieves information about the scheduled events in
|
2018-01-24 11:14:23 -05:00
|
|
|
calendars.
|
|
|
|
|
|
|
|
|
|
|
|
==== Request
|
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/calendars/<calendar_id>/events` +
|
2018-01-24 11:14:23 -05:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/calendars/_all/events`
|
2018-01-24 11:14:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
===== Description
|
|
|
|
|
|
|
|
You can get scheduled event information for a single calendar or for all
|
|
|
|
calendars by using `_all`.
|
|
|
|
|
|
|
|
==== Path Parameters
|
|
|
|
|
|
|
|
`calendar_id` (required)::
|
|
|
|
(string) Identifier for the calendar.
|
|
|
|
|
|
|
|
==== Request Body
|
|
|
|
|
|
|
|
`end`::
|
|
|
|
(string) Specifies to get events with timestamps earlier than this time.
|
|
|
|
|
|
|
|
`from`::
|
|
|
|
(integer) Skips the specified number of events.
|
|
|
|
|
|
|
|
`size`::
|
|
|
|
(integer) Specifies the maximum number of events to obtain.
|
|
|
|
|
|
|
|
`start`::
|
|
|
|
(string) Specifies to get events with timestamps after this time.
|
|
|
|
|
|
|
|
==== Results
|
|
|
|
|
|
|
|
The API returns the following information:
|
|
|
|
|
|
|
|
`events`::
|
|
|
|
(array) An array of scheduled event resources.
|
|
|
|
For more information, see <<ml-event-resource>>.
|
|
|
|
|
|
|
|
|
|
|
|
==== Authorization
|
|
|
|
|
|
|
|
You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
|
|
|
|
privileges to use this API. For more information, see
|
|
|
|
{xpack-ref}/security-privileges.html[Security Privileges].
|
|
|
|
|
|
|
|
|
|
|
|
==== Examples
|
|
|
|
|
|
|
|
The following example gets information about the scheduled events in the
|
|
|
|
`planned-outages` calendar:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2018-12-07 15:34:11 -05:00
|
|
|
GET _ml/calendars/planned-outages/events
|
2018-01-24 11:14:23 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
2018-08-31 19:49:24 -04:00
|
|
|
// TEST[skip:setup:calendar_outages_addevent]
|
2018-01-24 11:14:23 -05:00
|
|
|
|
|
|
|
The API returns the following results:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
----
|
|
|
|
{
|
|
|
|
"count": 3,
|
|
|
|
"events": [
|
|
|
|
{
|
|
|
|
"description": "event 1",
|
|
|
|
"start_time": 1513641600000,
|
|
|
|
"end_time": 1513728000000,
|
|
|
|
"calendar_id": "planned-outages",
|
|
|
|
"event_id": "LS8LJGEBMTCMA-qz49st"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "event 2",
|
|
|
|
"start_time": 1513814400000,
|
|
|
|
"end_time": 1513900800000,
|
|
|
|
"calendar_id": "planned-outages",
|
|
|
|
"event_id": "Li8LJGEBMTCMA-qz49st"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "event 3",
|
|
|
|
"start_time": 1514160000000,
|
|
|
|
"end_time": 1514246400000,
|
|
|
|
"calendar_id": "planned-outages",
|
|
|
|
"event_id": "Ly8LJGEBMTCMA-qz49st"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|
|
|
|
// TESTRESPONSE[s/LS8LJGEBMTCMA-qz49st/$body.$_path/]
|
|
|
|
// TESTRESPONSE[s/Li8LJGEBMTCMA-qz49st/$body.$_path/]
|
|
|
|
// TESTRESPONSE[s/Ly8LJGEBMTCMA-qz49st/$body.$_path/]
|
|
|
|
|
|
|
|
For more information about these properties, see <<ml-event-resource>>.
|