open-job.asciidoc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. [role="xpack"]
  2. [[ml-open-job]]
  3. = Open {anomaly-jobs} API
  4. ++++
  5. <titleabbrev>Open jobs</titleabbrev>
  6. ++++
  7. Opens one or more {anomaly-jobs}.
  8. [[ml-open-job-request]]
  9. == {api-request-title}
  10. `POST _ml/anomaly_detectors/{job_id}/_open`
  11. [[ml-open-job-prereqs]]
  12. == {api-prereq-title}
  13. Requires the `manage_ml` cluster privilege. This privilege is included in the
  14. `machine_learning_admin` built-in role.
  15. [[ml-open-job-desc]]
  16. == {api-description-title}
  17. An {anomaly-job} must be opened in order for it to be ready to receive and
  18. analyze data. It can be opened and closed multiple times throughout its
  19. lifecycle.
  20. When you open a new job, it starts with an empty model.
  21. When you open an existing job, the most recent model state is automatically
  22. loaded. The job is ready to resume its analysis from where it left off, once new
  23. data is received.
  24. [[ml-open-job-path-parms]]
  25. == {api-path-parms-title}
  26. `<job_id>`::
  27. (Required, string)
  28. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  29. [[ml-open-job-query-parms]]
  30. == {api-query-parms-title}
  31. `timeout`::
  32. (Optional, time) Controls the time to wait until a job has opened. The default
  33. value is 30 minutes.
  34. [[ml-open-job-request-body]]
  35. == {api-request-body-title}
  36. You can also specify the `timeout` query parameter in the request body.
  37. [[ml-open-job-response-body]]
  38. == {api-response-body-title}
  39. `node`::
  40. (string) The ID of the node that the job was opened on. If the job is allowed to
  41. open lazily and has not yet been assigned to a node, this value is an empty string.
  42. `opened`::
  43. (Boolean) For a successful response, this value is always `true`. On failure, an
  44. exception is returned instead.
  45. [[ml-open-job-example]]
  46. == {api-examples-title}
  47. [source,console]
  48. --------------------------------------------------
  49. POST _ml/anomaly_detectors/low_request_rate/_open
  50. {
  51. "timeout": "35m"
  52. }
  53. --------------------------------------------------
  54. // TEST[skip:Kibana sample data]
  55. When the job opens, you receive the following results:
  56. [source,console-result]
  57. ----
  58. {
  59. "opened" : true,
  60. "node" : "node-1"
  61. }
  62. ----