open-job.asciidoc 1.4 KB

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