delete-job.asciidoc 1.7 KB

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