delete-lifecycle.asciidoc 2.5 KB

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