delete-expired-data.asciidoc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-delete-expired-data]]
  4. = Delete expired data API
  5. ++++
  6. <titleabbrev>Delete expired data</titleabbrev>
  7. ++++
  8. Deletes expired and unused machine learning data.
  9. [[ml-delete-expired-data-request]]
  10. == {api-request-title}
  11. `DELETE _ml/_delete_expired_data` +
  12. `DELETE _ml/_delete_expired_data/<job_id>`
  13. [[ml-delete-expired-data-prereqs]]
  14. == {api-prereq-title}
  15. Requires the `manage_ml` cluster privilege. This privilege is included in the
  16. `machine_learning_admin` built-in role.
  17. [[ml-delete-expired-data-desc]]
  18. == {api-description-title}
  19. Deletes all job results, model snapshots and forecast data that have exceeded
  20. their `retention days` period. Machine learning state documents that are not
  21. associated with any job are also deleted.
  22. You can limit the request to a single or set of {anomaly-jobs} by using a job
  23. identifier, a group name, a comma-separated list of jobs, or a wildcard
  24. expression. You can delete expired data for all {anomaly-jobs} by using `_all`,
  25. by specifying `*` as the `<job_id>`, or by omitting the `<job_id>`.
  26. [[ml-delete-expired-data-path-parms]]
  27. == {api-path-parms-title}
  28. `<job_id>`::
  29. (Optional, string)
  30. Identifier for an {anomaly-job}. It can be a job identifier, a group name, or a
  31. wildcard expression.
  32. [[ml-delete-expired-data-request-body]]
  33. == {api-request-body-title}
  34. `requests_per_second`::
  35. (Optional, float) The desired requests per second for the deletion processes.
  36. The default behavior is no throttling.
  37. `timeout`::
  38. (Optional, string) How long can the underlying delete processes run until they are canceled.
  39. The default value is `8h` (8 hours).
  40. [[ml-delete-expired-data-example]]
  41. == {api-examples-title}
  42. The endpoint takes no arguments:
  43. [source,console]
  44. --------------------------------------------------
  45. DELETE _ml/_delete_expired_data
  46. --------------------------------------------------
  47. // TEST
  48. When the expired data is deleted, you receive the following response:
  49. [source,console-result]
  50. ----
  51. {
  52. "deleted": true
  53. }
  54. ----