put-calendar-job.asciidoc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-put-calendar-job]]
  4. === Add {anomaly-jobs} to calendar API
  5. ++++
  6. <titleabbrev>Add jobs to calendar</titleabbrev>
  7. ++++
  8. Adds an {anomaly-job} to a calendar.
  9. [[ml-put-calendar-job-request]]
  10. ==== {api-request-title}
  11. `PUT _ml/calendars/<calendar_id>/jobs/<job_id>`
  12. [[ml-put-calendar-job-prereqs]]
  13. ==== {api-prereq-title}
  14. * If the {es} {security-features} are enabled, you must have `manage_ml` or
  15. `manage` cluster privileges to use this API. See
  16. {stack-ov}/security-privileges.html[Security privileges].
  17. [[ml-put-calendar-job-path-parms]]
  18. ==== {api-path-parms-title}
  19. `<calendar_id>`::
  20. (Required, string) Identifier for the calendar.
  21. `<job_id>`::
  22. (Required, string) An identifier for the {anomaly-jobs}. It can be a job
  23. identifier, a group name, or a comma-separated list of jobs or groups.
  24. [[ml-put-calendar-job-example]]
  25. ==== {api-examples-title}
  26. [source,js]
  27. --------------------------------------------------
  28. PUT _ml/calendars/planned-outages/jobs/total-requests
  29. --------------------------------------------------
  30. // CONSOLE
  31. // TEST[skip:setup:calendar_outages_openjob]
  32. The API returns the following results:
  33. [source,js]
  34. ----
  35. {
  36. "calendar_id": "planned-outages",
  37. "job_ids": [
  38. "total-requests"
  39. ]
  40. }
  41. ----
  42. // TESTRESPONSE