get-calendar.asciidoc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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-desc]]
  14. ==== {api-description-title}
  15. You can get information for a single calendar or for all calendars by using
  16. `_all`.
  17. [[ml-get-calendar-path-parms]]
  18. ==== {api-path-parms-title}
  19. `calendar_id`::
  20. (string) Identifier for the calendar.
  21. [[ml-get-calendar-request-body]]
  22. ==== {api-request-body-title}
  23. `page`::
  24. `from`:::
  25. (integer) Skips the specified number of calendars.
  26. `size`:::
  27. (integer) Specifies the maximum number of calendars to obtain.
  28. [[ml-get-calendar-results]]
  29. ==== {api-response-body-title}
  30. The API returns the following information:
  31. `calendars`::
  32. (array) An array of calendar resources.
  33. For more information, see <<ml-calendar-resource>>.
  34. [[ml-get-calendar-prereqs]]
  35. ==== {api-prereq-title}
  36. You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
  37. privileges to use this API. For more information, see
  38. {stack-ov}/security-privileges.html[Security Privileges].
  39. [[ml-get-calendar-example]]
  40. ==== {api-examples-title}
  41. The following example gets configuration information for the `planned-outages`
  42. calendar:
  43. [source,js]
  44. --------------------------------------------------
  45. GET _ml/calendars/planned-outages
  46. --------------------------------------------------
  47. // CONSOLE
  48. // TEST[skip:setup:calendar_outages_addjob]
  49. The API returns the following results:
  50. [source,js]
  51. ----
  52. {
  53. "count": 1,
  54. "calendars": [
  55. {
  56. "calendar_id": "planned-outages",
  57. "job_ids": [
  58. "total-requests"
  59. ]
  60. }
  61. ]
  62. }
  63. ----
  64. // TESTRESPONSE