get-calendar.asciidoc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. * If the {es} {security-features} are enabled, you must have `monitor_ml`,
  16. `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. See
  17. <<security-privileges>>.
  18. [[ml-get-calendar-desc]]
  19. ==== {api-description-title}
  20. You can get information for a single calendar or for all calendars by using
  21. `_all`.
  22. For more information, see
  23. {ml-docs}/ml-calendars.html[Calendars and scheduled events].
  24. [[ml-get-calendar-path-parms]]
  25. ==== {api-path-parms-title}
  26. `<calendar_id>`::
  27. (Required, string)
  28. include::{docdir}/ml/ml-shared.asciidoc[tag=calendar-id]
  29. [[ml-get-calendar-request-body]]
  30. ==== {api-request-body-title}
  31. `page`.`from`::
  32. (Optional, integer) Skips the specified number of calendars.
  33. `page`.`size`::
  34. (Optional, integer) Specifies the maximum number of calendars to obtain.
  35. [[ml-get-calendar-results]]
  36. ==== {api-response-body-title}
  37. The API returns an array of calendar resources, which have the following
  38. properties:
  39. `calendar_id`::
  40. (string)
  41. include::{docdir}/ml/ml-shared.asciidoc[tag=calendar-id]
  42. `job_ids`::
  43. (array) An array of {anomaly-job} identifiers. For example:
  44. `["total-requests"]`.
  45. [[ml-get-calendar-example]]
  46. ==== {api-examples-title}
  47. [source,console]
  48. --------------------------------------------------
  49. GET _ml/calendars/planned-outages
  50. --------------------------------------------------
  51. // TEST[skip:setup:calendar_outages_addjob]
  52. The API returns the following results:
  53. [source,console-result]
  54. ----
  55. {
  56. "count": 1,
  57. "calendars": [
  58. {
  59. "calendar_id": "planned-outages",
  60. "job_ids": [
  61. "total-requests"
  62. ]
  63. }
  64. ]
  65. }
  66. ----