open-job.asciidoc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. <<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)
  30. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  31. [[ml-open-job-request-body]]
  32. == {api-request-body-title}
  33. `timeout`::
  34. (Optional, time) Controls the time to wait until a job has opened. The default
  35. value is 30 minutes.
  36. [[ml-open-job-response-body]]
  37. == {api-response-body-title}
  38. `node`::
  39. (string) The ID of the node that the job was opened on. If the job is allowed to
  40. open lazily and has not yet been assigned to a node, this value is an empty string.
  41. `opened`::
  42. (boolean) For a successful response, this value is always `true`. On failure, an
  43. exception is returned instead.
  44. [[ml-open-job-example]]
  45. == {api-examples-title}
  46. [source,console]
  47. --------------------------------------------------
  48. POST _ml/anomaly_detectors/low_request_rate/_open
  49. {
  50. "timeout": "35m"
  51. }
  52. --------------------------------------------------
  53. // TEST[skip:Kibana sample data]
  54. When the job opens, you receive the following results:
  55. [source,console-result]
  56. ----
  57. {
  58. "opened" : true,
  59. "node" : "node-1"
  60. }
  61. ----