delete-expired-data.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. * If the {es} {security-features} are enabled, you must have `manage_ml` or
  16. `manage` cluster privileges to use this API. See
  17. <<security-privileges>> and {ml-docs-setup-privileges}.
  18. [[ml-delete-expired-data-desc]]
  19. == {api-description-title}
  20. Deletes all job results, model snapshots and forecast data that have exceeded
  21. their `retention days` period. Machine learning state documents that are not
  22. associated with any job are also deleted.
  23. You can limit the request to a single or set of {anomaly-jobs} by using a job identifier,
  24. a group name, a comma-separated list of jobs, or a wildcard expression.
  25. You can delete expired data for all {anomaly-jobs} by using `_all`, by specifying
  26. `*` as the `<job_id>`, or by omitting the `<job_id>`.
  27. [[ml-delete-expired-data-path-parms]]
  28. == {api-path-parms-title}
  29. `<job_id>`::
  30. (Optional, string)
  31. Identifier for an {anomaly-job}. It can be a job identifier, a group name, or a
  32. wildcard expression.
  33. [[ml-delete-expired-data-request-body]]
  34. == {api-request-body-title}
  35. `requests_per_second`::
  36. (Optional, float) The desired requests per second for the deletion processes.
  37. The default behavior is no throttling.
  38. `timeout`::
  39. (Optional, string) How long can the underlying delete processes run until they are canceled.
  40. The default value is `8h` (8 hours).
  41. [[ml-delete-expired-data-example]]
  42. == {api-examples-title}
  43. The endpoint takes no arguments:
  44. [source,console]
  45. --------------------------------------------------
  46. DELETE _ml/_delete_expired_data
  47. --------------------------------------------------
  48. // TEST
  49. When the expired data is deleted, you receive the following response:
  50. [source,console-result]
  51. ----
  52. {
  53. "deleted": true
  54. }
  55. ----