delete-job.asciidoc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --
  2. :api: delete-job
  3. :request: DeleteJobRequest
  4. :response: AcknowledgedResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Delete {anomaly-job} API
  9. Deletes an {anomaly-job} that exists in the cluster.
  10. [id="{upid}-{api}-request"]
  11. ==== Delete {anomaly-job} request
  12. A +{request}+ object requires a non-null `jobId` and can optionally set `force`.
  13. ["source","java",subs="attributes,callouts,macros"]
  14. ---------------------------------------------------
  15. include-tagged::{doc-tests-file}[{api}-request]
  16. ---------------------------------------------------
  17. <1> Constructing a new request referencing an existing `jobId`
  18. ==== Optional arguments
  19. The following arguments are optional:
  20. ["source","java",subs="attributes,callouts,macros"]
  21. ---------------------------------------------------
  22. include-tagged::{doc-tests-file}[{api}-request-force]
  23. ---------------------------------------------------
  24. <1> Use to forcefully delete an opened job. This method is quicker than closing
  25. and deleting the job. Defaults to `false`.
  26. ["source","java",subs="attributes,callouts,macros"]
  27. ---------------------------------------------------
  28. include-tagged::{doc-tests-file}[{api}-request-wait-for-completion]
  29. ---------------------------------------------------
  30. <1> Use to set whether the request should wait until the operation has completed
  31. before returning. Defaults to `true`.
  32. [id="{upid}-{api}-response"]
  33. ==== Delete {anomaly-job} response
  34. The returned +{response}+ object indicates the acknowledgement of the job
  35. deletion or the deletion task depending on whether the request was set to wait
  36. for completion:
  37. ["source","java",subs="attributes,callouts,macros"]
  38. ---------------------------------------------------
  39. include-tagged::{doc-tests-file}[{api}-response]
  40. ---------------------------------------------------
  41. <1> Whether job deletion was acknowledged or not. It will be `null` when set
  42. to not wait for completion.
  43. <2> The ID of the job deletion task. It will be `null` when set to wait for
  44. completion.
  45. include::../execution.asciidoc[]