delete-lifecycle.asciidoc 2.1 KB

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