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
|
|
|
++++
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
Deletes a lifecycle policy.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
|
|
|
==== Request
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
`DELETE _ilm/policy/<policy_id>`
|
2018-10-16 15:18:54 -04:00
|
|
|
|
|
|
|
==== Description
|
|
|
|
|
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
|
|
|
|
|
|
|
==== Path Parameters
|
|
|
|
|
|
|
|
`policy` (required)::
|
|
|
|
(string) Identifier for the policy.
|
|
|
|
|
|
|
|
==== Request Parameters
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
include::{docdir}/rest-api/timeoutparms.asciidoc[]
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
==== Authorization
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-12-18 12:53:25 -05:00
|
|
|
You must have the `manage_ilm` cluster privilege to use this API.
|
|
|
|
For more information, see {stack-ov}/security-privileges.html[Security Privileges].
|
2018-10-16 15:18:54 -04:00
|
|
|
|
|
|
|
==== Examples
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
The following example deletes `my_policy`:
|
2018-10-16 15:18:54 -04:00
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
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": {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2018-10-30 19:19:05 -04:00
|
|
|
DELETE _ilm/policy/my_policy
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// 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
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"acknowledged": true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TESTRESPONSE
|