open-job.asciidoc 1.7 KB

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