open-job.asciidoc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --
  2. :api: open-job
  3. :request: OpenJobRequest
  4. :response: OpenJobResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Open {anomaly-job} API
  9. Opens {anomaly-jobs} in the cluster. It accepts a +{request}+ object and
  10. responds with a +{response}+ object.
  11. [id="{upid}-{api}-request"]
  12. ==== Open {anomaly-job} request
  13. An +{request}+ object gets created with an existing non-null `jobId`.
  14. ["source","java",subs="attributes,callouts,macros"]
  15. --------------------------------------------------
  16. include-tagged::{doc-tests-file}[{api}-request]
  17. --------------------------------------------------
  18. <1> Constructing a new request referencing an existing `jobId`
  19. <2> Optionally setting the `timeout` value for how long the
  20. execution should wait for the job to be opened.
  21. [id="{upid}-{api}-response"]
  22. ==== Open {anomaly-job} response
  23. ["source","java",subs="attributes,callouts,macros"]
  24. --------------------------------------------------
  25. include-tagged::{doc-tests-file}[{api}-response]
  26. --------------------------------------------------
  27. <1> `isOpened()` from the +{response}+ is always `true` if the job was
  28. opened successfully. (An exception would be thrown instead if the job
  29. was not opened successfully.)
  30. <2> `getNode()` returns the node that the job was assigned to. If the
  31. job is allowed to open lazily and has not yet been assigned to a node
  32. then an empty string is returned. If `getNode()` returns `null` then
  33. the server is an old version that does not return node information.
  34. include::../execution.asciidoc[]