get-calendar.asciidoc 1.5 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. ==== Request
  10. `GET _ml/calendars/<calendar_id>` +
  11. `GET _ml/calendars/_all`
  12. ===== Description
  13. You can get information for a single calendar or for all calendars by using
  14. `_all`.
  15. ==== Path Parameters
  16. `calendar_id`::
  17. (string) Identifier for the calendar.
  18. ==== Request Body
  19. `page`::
  20. `from`:::
  21. (integer) Skips the specified number of calendars.
  22. `size`:::
  23. (integer) Specifies the maximum number of calendars to obtain.
  24. ==== Results
  25. The API returns the following information:
  26. `calendars`::
  27. (array) An array of calendar resources.
  28. For more information, see <<ml-calendar-resource>>.
  29. ==== Authorization
  30. You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
  31. privileges to use this API. For more information, see
  32. {xpack-ref}/security-privileges.html[Security Privileges].
  33. ==== Examples
  34. The following example gets configuration information for the `planned-outages`
  35. calendar:
  36. [source,js]
  37. --------------------------------------------------
  38. GET _ml/calendars/planned-outages
  39. --------------------------------------------------
  40. // CONSOLE
  41. // TEST[skip:setup:calendar_outages_addjob]
  42. The API returns the following results:
  43. [source,js]
  44. ----
  45. {
  46. "count": 1,
  47. "calendars": [
  48. {
  49. "calendar_id": "planned-outages",
  50. "job_ids": [
  51. "total-requests"
  52. ]
  53. }
  54. ]
  55. }
  56. ----
  57. // TESTRESPONSE