IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Add Events to Calendar API
editAdd Events to Calendar API
editPosts scheduled events in a calendar.
Request
editPOST _xpack/ml/calendars/<calendar_id>/events
Description
editThis API accepts a list of scheduled events, each of which must have a start time, end time, and description.
Path Parameters
edit-
calendar_id
(required) - (string) Identifier for the calendar.
Request Body
edit-
events
- (array) A list of one of more scheduled events. See Scheduled Event Resources.
Authorization
editYou must have manage_ml
, or manage
cluster privileges to use this API.
For more information, see
Security privileges.
Examples
editYou can add scheduled events to the planned-outages
calendar as follows:
POST _xpack/ml/calendars/planned-outages/events { "events" : [ {"description": "event 1", "start_time": 1513641600000, "end_time": 1513728000000}, {"description": "event 2", "start_time": 1513814400000, "end_time": 1513900800000}, {"description": "event 3", "start_time": 1514160000000, "end_time": 1514246400000} ] }
The API returns the following results:
{ "events": [ { "description": "event 1", "start_time": 1513641600000, "end_time": 1513728000000, "calendar_id": "planned-outages" }, { "description": "event 2", "start_time": 1513814400000, "end_time": 1513900800000, "calendar_id": "planned-outages" }, { "description": "event 3", "start_time": 1514160000000, "end_time": 1514246400000, "calendar_id": "planned-outages" } ] }
For more information about these properties, see Scheduled Event Resources.