elasticsearch/docs/reference/dlm/apis/delete-lifecycle.asciidoc
Keith Massey 322805858f
Adding manage_dlm privilege (#95512)
This adds a new index privilege called `manage_dlm`. The `manage_dlm`
has permission to perform all DLM actions on an index, including put and
delete. It also adds the ability to call DLM get and explain to the
`view_index_metadata` existing index privilege.
2023-05-26 11:16:41 -04:00

90 lines
2.3 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.
[[delete-lifecycle-api-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have the `manage_dlm` index privilege or higher to
use this API. For more information, see <<security-privileges>>.
[[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
}
--------------------------------------------------