get-calendar.asciidoc 1.5 KB

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