elasticsearch/docs/reference/dlm/apis/delete-lifecycle.asciidoc
Mary Gouseti 99145bbe9c
Add new endpoints to configure data lifecycle on a data stream level. (#94590)
With PR we introduce CRUD endpoints which update/delete the data lifecycle on the data stream level. When this is updated it will apply at the next DLM run to all the backing indices that are managed by DLM.
2023-04-04 18:37:38 +02:00

84 lines
2.1 KiB
Text

[[dlm-delete-lifecycle]]
=== Delete the lifecycle of a data stream
++++
<titleabbrev>Delete Data Stream Lifecycle</titleabbrev>
++++
experimental::[]
Deletes the lifecycle from a set of data streams.
[[dlm-delete-lifecycle-request]]
==== {api-request-title}
`DELETE _data_stream/<data-stream>/_lifecycle`
[[dlm-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`.
[[dlm-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-repo-dir}/rest-api/common-parms.asciidoc[tag=ds-expand-wildcards]
+
Defaults to `open`.
[[dlm-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
}
--------------------------------------------------