delete-lifecycle.asciidoc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. [[data-streams-delete-lifecycle]]
  2. === Delete the lifecycle of a data stream
  3. ++++
  4. <titleabbrev>Delete Data Stream Lifecycle</titleabbrev>
  5. ++++
  6. Deletes the lifecycle from a set of data streams.
  7. [[delete-lifecycle-api-prereqs]]
  8. ==== {api-prereq-title}
  9. * If the {es} {security-features} are enabled, you must have the `manage_data_stream_lifecycle` index privilege or higher to
  10. use this API. For more information, see <<security-privileges>>.
  11. [[data-streams-delete-lifecycle-request]]
  12. ==== {api-request-title}
  13. `DELETE _data_stream/<data-stream>/_lifecycle`
  14. [[data-streams-delete-lifecycle-desc]]
  15. ==== {api-description-title}
  16. Deletes the lifecycle from the specified data streams. If multiple data streams are provided but at least one of them
  17. does not exist, then the deletion of the lifecycle will fail for all of them and the API will respond with `404`.
  18. [[data-streams-delete-lifecycle-path-params]]
  19. ==== {api-path-parms-title}
  20. `<data-stream>`::
  21. (Required, string) Comma-separated list of data streams used to limit the request. Supports wildcards (`*`).
  22. To target all data streams use `*` or `_all`.
  23. [role="child_attributes"]
  24. [[delete-data-lifecycle-api-query-parms]]
  25. ==== {api-query-parms-title}
  26. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=ds-expand-wildcards]
  27. +
  28. Defaults to `open`.
  29. [[data-streams-delete-lifecycle-example]]
  30. ==== {api-examples-title}
  31. ////
  32. [source,console]
  33. --------------------------------------------------
  34. PUT /_index_template/my-template
  35. {
  36. "index_patterns" : ["my-data-stream*"],
  37. "priority" : 1,
  38. "data_stream": {},
  39. "template": {
  40. "lifecycle" : {
  41. "data_retention" : "7d"
  42. }
  43. }
  44. }
  45. PUT /_data_stream/my-data-stream
  46. --------------------------------------------------
  47. // TESTSETUP
  48. [source,console]
  49. --------------------------------------------------
  50. DELETE _data_stream/my-data-stream
  51. DELETE _index_template/my-template
  52. --------------------------------------------------
  53. // TEARDOWN
  54. ////
  55. The following example deletes the lifecycle of `my-data-stream`:
  56. [source,console]
  57. --------------------------------------------------
  58. DELETE _data_stream/my-data-stream/_lifecycle
  59. --------------------------------------------------
  60. When the policy is successfully deleted from all selected data streams, you receive the following result:
  61. [source,console-result]
  62. --------------------------------------------------
  63. {
  64. "acknowledged": true
  65. }
  66. --------------------------------------------------