OpenSearch/docs/reference/ilm/apis/delete-lifecycle.asciidoc
debadair b485e69a5f
ILM API ref edits (#35112)
* [DOCS] ILM API Ref edits

* [DOCS] Fixed endpoint for DELETE policy.

* [DOCS] Removed comparison to setting index.lifecycle.name to null.

* [DOCS] Fixed xrefs to explain API.
2018-11-08 15:26:27 -08:00

86 lines
1.6 KiB
Plaintext

[role="xpack"]
[testenv="basic"]
[[ilm-delete-lifecycle]]
=== Delete Lifecycle Policy API
++++
<titleabbrev>Delete Policy</titleabbrev>
++++
Deletes a lifecycle policy.
==== Request
`DELETE _ilm/policy/<policy_id>`
==== Description
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.
==== Path Parameters
`policy` (required)::
(string) Identifier for the policy.
==== Request Parameters
include::{docdir}/rest-api/timeoutparms.asciidoc[]
==== Authorization
include::ilm-cluster-mgt-privilege.asciidoc[]
==== Examples
The following example deletes `my_policy`:
//////////////////////////
[source,js]
--------------------------------------------------
PUT _ilm/policy/my_policy
{
"policy": {
"phases": {
"warm": {
"min_age": "10d",
"actions": {
"forcemerge": {
"max_num_segments": 1
}
}
},
"delete": {
"min_age": "30d",
"actions": {
"delete": {}
}
}
}
}
}
--------------------------------------------------
// CONSOLE
// TEST
//////////////////////////
[source,js]
--------------------------------------------------
DELETE _ilm/policy/my_policy
--------------------------------------------------
// CONSOLE
// TEST[continued]
When the policy is successfully deleted, you receive the following result:
[source,js]
--------------------------------------------------
{
"acknowledged": true
}
--------------------------------------------------
// CONSOLE
// TESTRESPONSE