put-calendar-job.asciidoc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. Requires the `manage_ml` cluster privilege. This privilege is included in the
  15. `machine_learning_admin` built-in role.
  16. [[ml-put-calendar-job-path-parms]]
  17. == {api-path-parms-title}
  18. `<calendar_id>`::
  19. (Required, string)
  20. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id]
  21. `<job_id>`::
  22. (Required, string)
  23. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection-list]
  24. [[ml-put-calendar-job-example]]
  25. == {api-examples-title}
  26. [source,console]
  27. --------------------------------------------------
  28. PUT _ml/calendars/planned-outages/jobs/total-requests
  29. --------------------------------------------------
  30. // TEST[skip:setup:calendar_outages_openjob]
  31. The API returns the following results:
  32. [source,console-result]
  33. ----
  34. {
  35. "calendar_id": "planned-outages",
  36. "job_ids": [
  37. "total-requests"
  38. ]
  39. }
  40. ----