mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
94 lines
2.5 KiB
Text
94 lines
2.5 KiB
Text
[[data-streams-delete-lifecycle]]
|
|
=== Delete the lifecycle of a data stream
|
|
++++
|
|
<titleabbrev>Delete Data Stream Lifecycle</titleabbrev>
|
|
++++
|
|
|
|
.New API reference
|
|
[sidebar]
|
|
--
|
|
For the most up-to-date API details, refer to {api-es}/group/endpoint-data-stream[Data stream APIs].
|
|
--
|
|
|
|
Deletes the <<data-stream-lifecycle,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
|
|
}
|
|
--------------------------------------------------
|