2018-10-16 15:18:54 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
2018-11-27 16:28:58 -05:00
|
|
|
[[ilm-remove-policy]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Remove policy from index API
|
2018-10-16 15:18:54 -04:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Remove policy</titleabbrev>
|
2018-10-16 15:18:54 -04:00
|
|
|
++++
|
|
|
|
|
2020-07-02 09:58:54 -04:00
|
|
|
Removes assigned lifecycle policies from an index or a data stream's backing
|
|
|
|
indices.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
[[ilm-remove-policy-request]]
|
|
|
|
==== {api-request-title}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2020-07-02 09:58:54 -04:00
|
|
|
`POST <target>/_ilm/remove`
|
2018-10-16 15:18:54 -04:00
|
|
|
|
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}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2020-07-02 09:58:54 -04:00
|
|
|
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.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
[[ilm-remove-policy-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2020-07-02 09:58:54 -04:00
|
|
|
`<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 `*`.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
[[ilm-remove-policy-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
[[ilm-remove-policy-example]]
|
|
|
|
==== {api-examples-title}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
The following example removes the assigned policy from `my_index`.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
2018-10-30 19:19:05 -04:00
|
|
|
PUT _ilm/policy/my_policy
|
2018-10-16 15:18:54 -04:00
|
|
|
{
|
|
|
|
"policy": {
|
|
|
|
"phases": {
|
|
|
|
"warm": {
|
2018-10-30 15:54:02 -04:00
|
|
|
"min_age": "10d",
|
2018-10-16 15:18:54 -04:00
|
|
|
"actions": {
|
|
|
|
"forcemerge": {
|
|
|
|
"max_num_segments": 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
2018-10-30 15:54:02 -04:00
|
|
|
"min_age": "30d",
|
2018-10-16 15:18:54 -04:00
|
|
|
"actions": {
|
|
|
|
"delete": {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-18 03:34:11 -05:00
|
|
|
PUT my_index
|
2018-10-24 11:14:59 -04:00
|
|
|
{
|
|
|
|
"settings": {
|
|
|
|
"index.lifecycle.name": "my_policy"
|
|
|
|
}
|
|
|
|
}
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
2018-11-06 10:46:25 -05:00
|
|
|
POST my_index/_ilm/remove
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
If the request succeeds, you receive the following result:
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-09-06 09:22:08 -04:00
|
|
|
[source,console-result]
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"has_failures" : false,
|
|
|
|
"failed_indexes" : []
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|