2018-10-16 15:18:54 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
|
|
|
[[ilm-delete-lifecycle]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Delete lifecycle policy API
|
2018-10-16 15:18:54 -04:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Delete policy</titleabbrev>
|
2018-10-16 15:18:54 -04:00
|
|
|
++++
|
|
|
|
|
2020-02-04 19:45:18 -05:00
|
|
|
Deletes an index lifecycle policy.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
[[ilm-delete-lifecycle-request]]
|
|
|
|
==== {api-request-title}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
`DELETE _ilm/policy/<policy_id>`
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
[[ilm-delete-lifecycle-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have the `manage_ilm`
|
|
|
|
cluster privilege to use this API. For more information, see
|
|
|
|
<<security-privileges>>.
|
|
|
|
|
|
|
|
[[ilm-delete-lifecycle-desc]]
|
|
|
|
==== {api-description-title}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
Deletes the specified lifecycle policy definition. You cannot delete policies
|
|
|
|
that are currently in use. If the policy is being used to manage any indices,
|
|
|
|
the request fails and returns an error.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
[[ilm-delete-lifecycle-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
`<policy_id>`::
|
|
|
|
(Required, string) Identifier for the policy.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
[[ilm-delete-lifecycle-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-08-02 08:42:33 -04:00
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-11-20 11:19:33 -05:00
|
|
|
[[ilm-delete-lifecycle-example]]
|
|
|
|
==== {api-examples-title}
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
The following example deletes `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-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": {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
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
|
|
|
DELETE _ilm/policy/my_policy
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
When the policy is successfully deleted, 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
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"acknowledged": true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|