delete-expired-data.asciidoc 2.1 KB

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