put-calendar-job.asciidoc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-put-calendar-job]]
  4. === Add jobs to calendar API
  5. ++++
  6. <titleabbrev>Add jobs to calendar</titleabbrev>
  7. ++++
  8. Adds a 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-path-parms]]
  13. ==== {api-path-parms-title}
  14. `calendar_id` (required)::
  15. (string) Identifier for the calendar.
  16. `job_id` (required)::
  17. (string) An identifier for the job. It can be a job identifier, a group name, or a
  18. comma-separated list of jobs or groups.
  19. [[ml-put-calendar-job-prereqs]]
  20. ==== {api-prereq-title}
  21. You must have `manage_ml`, or `manage` cluster privileges to use this API.
  22. For more information, see
  23. {stack-ov}/security-privileges.html[Security Privileges].
  24. [[ml-put-calendar-job-example]]
  25. ==== {api-examples-title}
  26. The following example associates the `planned-outages` calendar with the
  27. `total-requests` job:
  28. [source,js]
  29. --------------------------------------------------
  30. PUT _ml/calendars/planned-outages/jobs/total-requests
  31. --------------------------------------------------
  32. // CONSOLE
  33. // TEST[skip:setup:calendar_outages_openjob]
  34. The API returns the following results:
  35. [source,js]
  36. ----
  37. {
  38. "calendar_id": "planned-outages",
  39. "job_ids": [
  40. "total-requests"
  41. ]
  42. }
  43. ----
  44. // TESTRESPONSE