open-job.asciidoc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. ==== Request
  12. `POST _ml/anomaly_detectors/{job_id}/_open`
  13. ==== Description
  14. When you open a new job, it starts with an empty model.
  15. When you open an existing job, the most recent model state is automatically loaded.
  16. The job is ready to resume its analysis from where it left off, once new data is received.
  17. ==== Path Parameters
  18. `job_id` (required)::
  19. (string) Identifier for the job
  20. ==== Request Body
  21. `timeout`::
  22. (time) Controls the time to wait until a job has opened.
  23. The default value is 30 minutes.
  24. ==== Authorization
  25. You must have `manage_ml`, or `manage` cluster privileges to use this API.
  26. For more information, see
  27. {xpack-ref}/security-privileges.html[Security Privileges].
  28. ==== Examples
  29. The following example opens the `total-requests` job and sets an optional
  30. property:
  31. [source,js]
  32. --------------------------------------------------
  33. POST _ml/anomaly_detectors/total-requests/_open
  34. {
  35. "timeout": "35m"
  36. }
  37. --------------------------------------------------
  38. // CONSOLE
  39. // TEST[skip:setup:server_metrics_job]
  40. When the job opens, you receive the following results:
  41. [source,js]
  42. ----
  43. {
  44. "opened": true
  45. }
  46. ----
  47. // TESTRESPONSE