OpenSearch/docs/reference/ilm/apis/remove-policy-from-index.as...

104 lines
2.4 KiB
Plaintext
Raw Normal View History

[role="xpack"]
[testenv="basic"]
[[ilm-remove-policy]]
2018-12-20 13:23:28 -05:00
=== Remove policy from index API
++++
2018-12-20 13:23:28 -05:00
<titleabbrev>Remove policy</titleabbrev>
++++
Removes assigned lifecycle policies from an index or a data stream's backing
indices.
2019-11-20 11:19:33 -05:00
[[ilm-remove-policy-request]]
==== {api-request-title}
`POST <target>/_ilm/remove`
2019-11-20 11:19:33 -05:00
[[ilm-remove-policy-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have the `manage_ilm`
privileges on the indices being managed to use this API. For more information,
see <<security-privileges>>.
[[ilm-remove-policy-desc]]
==== {api-description-title}
For indices, the remove lifecycle policy API removes the assigned lifecycle
policy and stops managing the specified index.
For data streams, the API removes any assigned lifecycle policies from
the stream's backing indices and stops managing the indices.
2019-11-20 11:19:33 -05:00
[[ilm-remove-policy-path-params]]
==== {api-path-parms-title}
`<target>`::
(Required, string)
Comma-separated list of data streams, indices, and index aliases to target.
Wildcard expressions (`*`) are supported.
+
To target all data streams and indices in a cluster, use `_all` or `*`.
2019-11-20 11:19:33 -05:00
[[ilm-remove-policy-query-params]]
==== {api-query-parms-title}
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
2019-11-20 11:19:33 -05:00
[[ilm-remove-policy-example]]
==== {api-examples-title}
The following example removes the assigned policy from `my-index-000001`.
//////////////////////////
[source,console]
--------------------------------------------------
PUT _ilm/policy/my_policy
{
"policy": {
"phases": {
"warm": {
"min_age": "10d",
"actions": {
"forcemerge": {
"max_num_segments": 1
}
}
},
"delete": {
"min_age": "30d",
"actions": {
"delete": {}
}
}
}
}
}
PUT my-index-000001
{
"settings": {
"index.lifecycle.name": "my_policy"
}
}
--------------------------------------------------
//////////////////////////
[source,console]
--------------------------------------------------
POST my-index-000001/_ilm/remove
--------------------------------------------------
// TEST[continued]
If the request succeeds, you receive the following result:
[source,console-result]
--------------------------------------------------
{
"has_failures" : false,
"failed_indexes" : []
}
--------------------------------------------------