put-calendar-job.asciidoc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. [role="xpack"]
  2. [[ml-put-calendar-job]]
  3. = Add {anomaly-jobs} to calendar API
  4. ++++
  5. <titleabbrev>Add jobs to calendar</titleabbrev>
  6. ++++
  7. Adds an {anomaly-job} to a calendar.
  8. [[ml-put-calendar-job-request]]
  9. == {api-request-title}
  10. `PUT _ml/calendars/<calendar_id>/jobs/<job_id>`
  11. [[ml-put-calendar-job-prereqs]]
  12. == {api-prereq-title}
  13. Requires the `manage_ml` cluster privilege. This privilege is included in the
  14. `machine_learning_admin` built-in role.
  15. [[ml-put-calendar-job-path-parms]]
  16. == {api-path-parms-title}
  17. `<calendar_id>`::
  18. (Required, string)
  19. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id]
  20. `<job_id>`::
  21. (Required, string)
  22. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection-list]
  23. [[ml-put-calendar-job-example]]
  24. == {api-examples-title}
  25. [source,console]
  26. --------------------------------------------------
  27. PUT _ml/calendars/planned-outages/jobs/total-requests
  28. --------------------------------------------------
  29. // TEST[skip:setup:calendar_outages_openjob]
  30. The API returns the following results:
  31. [source,console-result]
  32. ----
  33. {
  34. "calendar_id": "planned-outages",
  35. "job_ids": [
  36. "total-requests"
  37. ]
  38. }
  39. ----