Create calendars API

Create calendars API

New API reference

For the most up-to-date API details, refer to Machine learning anomaly detection APIs.

Instantiates a calendar.

Request

PUT _ml/calendars/<calendar_id>

Prerequisites

Requires the manage_ml cluster privilege. This privilege is included in the machine_learning_admin built-in role.

Description

For more information, see Calendars and scheduled events.

Path parameters

<calendar_id>

(Required, string) A string that uniquely identifies a calendar.

Request body

description

(Optional, string) A description of the calendar.

Examples

  1. resp = client.ml.put_calendar(
  2. calendar_id="planned-outages",
  3. )
  4. print(resp)
  1. response = client.ml.put_calendar(
  2. calendar_id: 'planned-outages'
  3. )
  4. puts response
  1. const response = await client.ml.putCalendar({
  2. calendar_id: "planned-outages",
  3. });
  4. console.log(response);
  1. PUT _ml/calendars/planned-outages

When the calendar is created, you receive the following results:

  1. {
  2. "calendar_id": "planned-outages",
  3. "job_ids": []
  4. }