put-calendar-job.asciidoc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. ==== Request
  10. `PUT _xpack/ml/calendars/<calendar_id>/jobs/<job_id>`
  11. ==== Path Parameters
  12. `calendar_id` (required)::
  13. (string) Identifier for the calendar.
  14. `job_id` (required)::
  15. (string) An identifier for the job. It can be a job identifier, a group name, or a
  16. comma-separated list of jobs or groups.
  17. ==== Authorization
  18. You must have `manage_ml`, or `manage` cluster privileges to use this API.
  19. For more information, see
  20. {xpack-ref}/security-privileges.html[Security Privileges].
  21. ==== Examples
  22. The following example associates the `planned-outages` calendar with the
  23. `total-requests` job:
  24. [source,js]
  25. --------------------------------------------------
  26. PUT _xpack/ml/calendars/planned-outages/jobs/total-requests
  27. --------------------------------------------------
  28. // CONSOLE
  29. // TEST[skip:setup:calendar_outages_openjob]
  30. The API returns the following results:
  31. [source,js]
  32. ----
  33. {
  34. "calendar_id": "planned-outages",
  35. "job_ids": [
  36. "total-requests"
  37. ]
  38. }
  39. ----
  40. // TESTRESPONSE