open-job.asciidoc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-open-job]]
  4. === Open jobs API
  5. ++++
  6. <titleabbrev>Open jobs</titleabbrev>
  7. ++++
  8. Opens one or more jobs.
  9. A job must be opened in order for it to be ready to receive and analyze data.
  10. A job can be opened and closed multiple times throughout its lifecycle.
  11. [[ml-open-job-request]]
  12. ==== {api-request-title}
  13. `POST _ml/anomaly_detectors/{job_id}/_open`
  14. [[ml-open-job-prereqs]]
  15. ==== {api-prereq-title}
  16. * If the {es} {security-features} are enabled, you must have `manage_ml` or
  17. `manage` cluster privileges to use this API. See
  18. {stack-ov}/security-privileges.html[Security privileges].
  19. [[ml-open-job-desc]]
  20. ==== {api-description-title}
  21. When you open a new job, it starts with an empty model.
  22. When you open an existing job, the most recent model state is automatically
  23. loaded. The job is ready to resume its analysis from where it left off, once new
  24. data is received.
  25. [[ml-open-job-path-parms]]
  26. ==== {api-path-parms-title}
  27. `<job_id>` (Required)::
  28. (string) Identifier for the job
  29. [[ml-open-job-request-body]]
  30. ==== {api-request-body-title}
  31. `timeout` (Optional)::
  32. (time) Controls the time to wait until a job has opened.
  33. The default value is 30 minutes.
  34. [[ml-open-job-example]]
  35. ==== {api-examples-title}
  36. The following example opens the `total-requests` job and sets an optional
  37. property:
  38. [source,js]
  39. --------------------------------------------------
  40. POST _ml/anomaly_detectors/total-requests/_open
  41. {
  42. "timeout": "35m"
  43. }
  44. --------------------------------------------------
  45. // CONSOLE
  46. // TEST[skip:setup:server_metrics_job]
  47. When the job opens, you receive the following results:
  48. [source,js]
  49. ----
  50. {
  51. "opened": true
  52. }
  53. ----
  54. // TESTRESPONSE