get-calendar.asciidoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-get-calendar]]
  4. = Get calendars API
  5. ++++
  6. <titleabbrev>Get calendars</titleabbrev>
  7. ++++
  8. Retrieves configuration information for calendars.
  9. [[ml-get-calendar-request]]
  10. == {api-request-title}
  11. `GET _ml/calendars/<calendar_id>` +
  12. `GET _ml/calendars/_all`
  13. [[ml-get-calendar-prereqs]]
  14. == {api-prereq-title}
  15. Requires the `monitor_ml` cluster privilege. This privilege is included in the
  16. `machine_learning_user` built-in role.
  17. [[ml-get-calendar-desc]]
  18. == {api-description-title}
  19. You can get information for multiple calendars in a single API request by using a
  20. comma-separated list of ids or a wildcard expression. You can get
  21. information for all calendars by using `_all`, by specifying `*` as the
  22. `<calendar_id>`, or by omitting the `<calendar_id>`.
  23. For more information, see
  24. {ml-docs}/ml-ad-finding-anomalies.html#ml-ad-calendars[Calendars and scheduled events].
  25. [[ml-get-calendar-path-parms]]
  26. == {api-path-parms-title}
  27. `<calendar_id>`::
  28. (Required, string)
  29. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id]
  30. [[ml-get-calendar-query-parms]]
  31. == {api-query-parms-title}
  32. `from`::
  33. (Optional, integer) Skips the specified number of calendars. This parameter
  34. is supported only when you omit the `<calendar_id>`. Defaults to `0`.
  35. `size`::
  36. (Optional, integer) Specifies the maximum number of calendars to obtain.
  37. This parameter is supported only when you omit the `<calendar_id>`. Defaults
  38. to `100`.
  39. [[ml-get-calendar-request-body]]
  40. == {api-request-body-title}
  41. `page`.`from`::
  42. (Optional, integer) Skips the specified number of calendars. This object is
  43. supported only when you omit the `<calendar_id>`. Defaults to `0`.
  44. `page`.`size`::
  45. (Optional, integer) Specifies the maximum number of calendars to obtain.
  46. This object is supported only when you omit the `<calendar_id>`. Defaults
  47. to `100`.
  48. [[ml-get-calendar-results]]
  49. == {api-response-body-title}
  50. The API returns an array of calendar resources, which have the following
  51. properties:
  52. `calendar_id`::
  53. (string)
  54. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id]
  55. `job_ids`::
  56. (array) An array of {anomaly-job} identifiers. For example:
  57. `["total-requests"]`.
  58. [[ml-get-calendar-example]]
  59. == {api-examples-title}
  60. [source,console]
  61. --------------------------------------------------
  62. GET _ml/calendars/planned-outages
  63. --------------------------------------------------
  64. // TEST[skip:setup:calendar_outages_addjob]
  65. The API returns the following results:
  66. [source,console-result]
  67. ----
  68. {
  69. "count": 1,
  70. "calendars": [
  71. {
  72. "calendar_id": "planned-outages",
  73. "job_ids": [
  74. "total-requests"
  75. ]
  76. }
  77. ]
  78. }
  79. ----