2017-12-21 05:52:58 +08:00
|
|
|
[role="xpack"]
|
|
|
|
[[ml-get-calendar]]
|
2020-07-21 03:38:09 +08:00
|
|
|
= Get calendars API
|
2017-12-21 08:37:19 +08:00
|
|
|
++++
|
2018-12-21 02:23:28 +08:00
|
|
|
<titleabbrev>Get calendars</titleabbrev>
|
2017-12-21 08:37:19 +08:00
|
|
|
++++
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2018-06-14 04:37:35 +08:00
|
|
|
Retrieves configuration information for calendars.
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-get-calendar-request]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-request-title}
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2018-12-08 04:34:11 +08:00
|
|
|
`GET _ml/calendars/<calendar_id>` +
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2018-12-08 04:34:11 +08:00
|
|
|
`GET _ml/calendars/_all`
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2019-06-28 04:58:42 +08:00
|
|
|
[[ml-get-calendar-prereqs]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-prereq-title}
|
2019-06-28 04:58:42 +08:00
|
|
|
|
2021-05-03 16:20:14 +08:00
|
|
|
Requires the `monitor_ml` cluster privilege. This privilege is included in the
|
|
|
|
`machine_learning_user` built-in role.
|
2019-06-28 04:58:42 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-get-calendar-desc]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-description-title}
|
2018-01-25 00:14:23 +08:00
|
|
|
|
2020-09-18 21:39:40 +08:00
|
|
|
For more information, see
|
2022-01-20 09:54:18 +08:00
|
|
|
{ml-docs}/ml-ad-run-jobs.html#ml-ad-calendars[Calendars and scheduled events].
|
2019-07-16 00:44:57 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-get-calendar-path-parms]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-path-parms-title}
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2019-07-12 23:26:31 +08:00
|
|
|
`<calendar_id>`::
|
2020-01-03 02:59:54 +08:00
|
|
|
(Required, string)
|
2020-06-02 02:46:10 +08:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id]
|
2021-11-23 01:25:01 +08:00
|
|
|
+
|
|
|
|
You can get information for multiple calendars in a single API request by using
|
|
|
|
a comma-separated list of ids or a wildcard expression. You can get information
|
|
|
|
for all calendars by using `_all`, by specifying `*` as the calendar identifier,
|
|
|
|
or by omitting the identifier.
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2021-10-08 03:22:11 +08:00
|
|
|
[[ml-get-calendar-query-parms]]
|
|
|
|
== {api-query-parms-title}
|
|
|
|
|
|
|
|
`from`::
|
|
|
|
(Optional, integer) Skips the specified number of calendars. This parameter
|
|
|
|
is supported only when you omit the `<calendar_id>`. Defaults to `0`.
|
|
|
|
|
|
|
|
`size`::
|
|
|
|
(Optional, integer) Specifies the maximum number of calendars to obtain.
|
|
|
|
This parameter is supported only when you omit the `<calendar_id>`. Defaults
|
|
|
|
to `100`.
|
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-get-calendar-request-body]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-request-body-title}
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2021-11-23 03:34:43 +08:00
|
|
|
`page`::
|
|
|
|
+
|
|
|
|
.Properties of `page`
|
|
|
|
[%collapsible%open]
|
|
|
|
====
|
|
|
|
|
|
|
|
`from`:::
|
|
|
|
(Optional, integer) Skips the specified number of calendars. This object is
|
|
|
|
supported only when you omit the `<calendar_id>`. Defaults to `0`.
|
|
|
|
|
|
|
|
`size`:::
|
|
|
|
(Optional, integer) Specifies the maximum number of calendars to obtain. This
|
|
|
|
object is supported only when you omit the `<calendar_id>`. Defaults to `100`.
|
|
|
|
====
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-get-calendar-results]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-response-body-title}
|
2018-01-25 00:14:23 +08:00
|
|
|
|
2019-12-25 00:34:03 +08:00
|
|
|
The API returns an array of calendar resources, which have the following
|
|
|
|
properties:
|
2017-12-21 05:52:58 +08:00
|
|
|
|
2019-12-25 00:34:03 +08:00
|
|
|
`calendar_id`::
|
2020-01-03 02:59:54 +08:00
|
|
|
(string)
|
2020-06-02 02:46:10 +08:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id]
|
2019-07-16 00:44:57 +08:00
|
|
|
|
2019-12-25 00:34:03 +08:00
|
|
|
`job_ids`::
|
|
|
|
(array) An array of {anomaly-job} identifiers. For example:
|
|
|
|
`["total-requests"]`.
|
2018-01-25 00:14:23 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-get-calendar-example]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-examples-title}
|
2018-01-25 00:14:23 +08:00
|
|
|
|
2019-09-06 22:55:16 +08:00
|
|
|
[source,console]
|
2018-01-25 00:14:23 +08:00
|
|
|
--------------------------------------------------
|
2018-12-08 04:34:11 +08:00
|
|
|
GET _ml/calendars/planned-outages
|
2018-01-25 00:14:23 +08:00
|
|
|
--------------------------------------------------
|
2018-09-01 07:49:24 +08:00
|
|
|
// TEST[skip:setup:calendar_outages_addjob]
|
2018-01-25 00:14:23 +08:00
|
|
|
|
|
|
|
The API returns the following results:
|
2019-09-06 04:47:18 +08:00
|
|
|
|
|
|
|
[source,console-result]
|
2018-01-25 00:14:23 +08:00
|
|
|
----
|
|
|
|
{
|
|
|
|
"count": 1,
|
|
|
|
"calendars": [
|
|
|
|
{
|
|
|
|
"calendar_id": "planned-outages",
|
|
|
|
"job_ids": [
|
|
|
|
"total-requests"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|