delete-global-retention.asciidoc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. [[data-streams-delete-global-retention]]
  2. === Delete the global retention of data streams
  3. ++++
  4. <titleabbrev>Delete Data Stream Global Retention</titleabbrev>
  5. ++++
  6. preview::[]
  7. Deletes the global retention configuration that applies on every data stream managed by <<data-stream-lifecycle,data stream lifecycle>>.
  8. [[delete-global-retention-api-prereqs]]
  9. ==== {api-prereq-title}
  10. ** If the {es} {security-features} are enabled, you must have the `manage_data_stream_global_retention` <<privileges-list-cluster,cluster privilege>> to use this API.
  11. [[data-streams-delete-global-retention-request]]
  12. ==== {api-request-title}
  13. `DELETE _data_stream/_global_retention`
  14. [[data-streams-delete-global-retention-desc]]
  15. ==== {api-description-title}
  16. Deletes the global retention configuration that is applied on data streams managed by data stream lifecycle.
  17. [role="child_attributes"]
  18. [[delete-global-retention-api-query-parms]]
  19. ==== {api-query-parms-title}
  20. `dry_run`::
  21. (Boolean) Signals that the request should determine the effect of the removal of the existing without updating
  22. the global retention. The default value is `false`, which means the removal will happen.
  23. [[delete-global-retention-api-response-body]]
  24. ==== {api-response-body-title}
  25. `acknowledged`::
  26. (boolean)
  27. True, if the global retention has been removed. False, if it fails or if it was a dry run.
  28. `dry_run`::
  29. (boolean)
  30. True, if this was a dry run, false otherwise.
  31. `affected_data_streams`::
  32. (array of objects)
  33. Contains information about the data streams affected by the change.
  34. +
  35. .Properties of objects in `affected_data_streams`
  36. [%collapsible%open]
  37. ====
  38. `name`::
  39. (string)
  40. Name of the data stream.
  41. `previous_effective_retention`::
  42. (string)
  43. The retention that was effective before the change of this request. `infinite` if there was no retention applicable.
  44. `new_effective_retention`::
  45. (string)
  46. The retention that is or would be effective after this request. `infinite` if there is no retention applicable.
  47. ====
  48. [[data-streams-delete-global-retention-example]]
  49. ==== {api-examples-title}
  50. ////
  51. [source,console]
  52. --------------------------------------------------
  53. PUT _data_stream/_global_retention
  54. {
  55. "default_retention": "7d",
  56. "max_retention": "90d"
  57. }
  58. PUT /_index_template/template
  59. {
  60. "index_patterns": ["my-data-stream*"],
  61. "template": {
  62. "lifecycle": {}
  63. },
  64. "data_stream": { }
  65. }
  66. PUT /_data_stream/my-data-stream
  67. ----
  68. // TESTSETUP
  69. ////
  70. ////
  71. [source,console]
  72. ----
  73. DELETE /_data_stream/my-data-stream*
  74. DELETE /_index_template/template
  75. DELETE /_data_stream/_global_retention
  76. ----
  77. // TEARDOWN
  78. ////
  79. Let's update the global retention:
  80. [source,console]
  81. --------------------------------------------------
  82. DELETE _data_stream/_global_retention
  83. --------------------------------------------------
  84. The response will look like the following:
  85. [source,console-result]
  86. --------------------------------------------------
  87. {
  88. "acknowledged": true,
  89. "dry_run": false,
  90. "affected_data_streams": [
  91. {
  92. "name": "my-data-stream",
  93. "previous_effective_retention": "7d",
  94. "new_effective_retention": "infinite"
  95. }
  96. ]
  97. }
  98. --------------------------------------------------