delete-job.asciidoc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. [role="xpack"]
  2. [[ml-delete-job]]
  3. === Delete Jobs API
  4. ++++
  5. <titleabbrev>Delete Jobs</titleabbrev>
  6. ++++
  7. Deletes an existing anomaly detection job.
  8. ==== Request
  9. `DELETE _xpack/ml/anomaly_detectors/<job_id>`
  10. ==== Description
  11. All job configuration, model state and results are deleted.
  12. IMPORTANT: Deleting a job must be done via this API only. Do not delete the
  13. job directly from the `.ml-*` indices using the Elasticsearch
  14. DELETE Document API. When {security} is enabled, make sure no `write`
  15. privileges are granted to anyone over the `.ml-*` indices.
  16. Before you can delete a job, you must delete the {dfeeds} that are associated
  17. with it. See <<ml-delete-datafeed,Delete {dfeeds-cap}>>. Unless the `force` parameter
  18. is used the job must be closed before it can be deleted.
  19. It is not currently possible to delete multiple jobs using wildcards or a comma
  20. separated list.
  21. ==== Path Parameters
  22. `job_id` (required)::
  23. (string) Identifier for the job
  24. ===== Query Parameters
  25. `force`::
  26. (boolean) Use to forcefully delete an opened job; this method is quicker than
  27. closing and deleting the job.
  28. ==== Authorization
  29. You must have `manage_ml`, or `manage` cluster privileges to use this API.
  30. For more information, see {xpack-ref}/security-privileges.html[Security Privileges].
  31. ==== Examples
  32. The following example deletes the `total-requests` job:
  33. [source,js]
  34. --------------------------------------------------
  35. DELETE _xpack/ml/anomaly_detectors/total-requests
  36. --------------------------------------------------
  37. // CONSOLE
  38. // TEST[setup:server_metrics_job]
  39. When the job is deleted, you receive the following results:
  40. [source,js]
  41. ----
  42. {
  43. "acknowledged": true
  44. }
  45. ----
  46. // TESTRESPONSE