get-calendar.asciidoc 1.5 KB

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