mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
* Remove `es-test-dir` book-scoped variable * Remove `plugins-examples-dir` book-scoped variable * Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables - In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed. - In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path - In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem * Replace `es-repo-dir` with `es-ref-dir` * Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
90 lines
2.4 KiB
Text
90 lines
2.4 KiB
Text
[[data-streams-delete-lifecycle]]
|
|
=== Delete the lifecycle of a data stream
|
|
++++
|
|
<titleabbrev>Delete Data Stream Lifecycle</titleabbrev>
|
|
++++
|
|
|
|
preview::[]
|
|
|
|
Deletes the lifecycle from a set of data streams.
|
|
|
|
[[delete-lifecycle-api-prereqs]]
|
|
==== {api-prereq-title}
|
|
|
|
* If the {es} {security-features} are enabled, you must have the `manage_data_stream_lifecycle` index privilege or higher to
|
|
use this API. For more information, see <<security-privileges>>.
|
|
|
|
[[data-streams-delete-lifecycle-request]]
|
|
==== {api-request-title}
|
|
|
|
`DELETE _data_stream/<data-stream>/_lifecycle`
|
|
|
|
[[data-streams-delete-lifecycle-desc]]
|
|
==== {api-description-title}
|
|
|
|
Deletes the lifecycle from the specified data streams. If multiple data streams are provided but at least one of them
|
|
does not exist, then the deletion of the lifecycle will fail for all of them and the API will respond with `404`.
|
|
|
|
[[data-streams-delete-lifecycle-path-params]]
|
|
==== {api-path-parms-title}
|
|
|
|
`<data-stream>`::
|
|
(Required, string) Comma-separated list of data streams used to limit the request. Supports wildcards (`*`).
|
|
To target all data streams use `*` or `_all`.
|
|
|
|
|
|
[role="child_attributes"]
|
|
[[delete-data-lifecycle-api-query-parms]]
|
|
==== {api-query-parms-title}
|
|
|
|
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=ds-expand-wildcards]
|
|
+
|
|
Defaults to `open`.
|
|
|
|
[[data-streams-delete-lifecycle-example]]
|
|
==== {api-examples-title}
|
|
|
|
////
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
PUT /_index_template/my-template
|
|
{
|
|
"index_patterns" : ["my-data-stream*"],
|
|
"priority" : 1,
|
|
"data_stream": {},
|
|
"template": {
|
|
"lifecycle" : {
|
|
"data_retention" : "7d"
|
|
}
|
|
}
|
|
}
|
|
|
|
PUT /_data_stream/my-data-stream
|
|
--------------------------------------------------
|
|
// TESTSETUP
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
DELETE _data_stream/my-data-stream
|
|
DELETE _index_template/my-template
|
|
--------------------------------------------------
|
|
// TEARDOWN
|
|
|
|
////
|
|
|
|
The following example deletes the lifecycle of `my-data-stream`:
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
DELETE _data_stream/my-data-stream/_lifecycle
|
|
--------------------------------------------------
|
|
|
|
When the policy is successfully deleted from all selected data streams, you receive the following result:
|
|
|
|
[source,console-result]
|
|
--------------------------------------------------
|
|
{
|
|
"acknowledged": true
|
|
}
|
|
--------------------------------------------------
|