OpenSearch/docs/reference/ilm/apis/delete-lifecycle.asciidoc
debadair c0156cbb5d
Backporting updates to ILM org, overview, & GS (#51898)
* [DOCS] Align with ILM API docs (#48705)

* [DOCS] Reconciled with Snapshot/Restore reorg

* [DOCS] Split off ILM overview to a separate topic. (#51287)

* [DOCS} Split off overview to a separate topic.

* [DOCS] Incorporated feedback from @jrodewig.

* [DOCS] Edit ILM GS tutorial (#51513)

* [DOCS] Edit ILM GS tutorial

* [DOCS] Incorporated review feedback from @andreidan.

* [DOCS] Removed test link & fixed anchor & title.

* Update docs/reference/ilm/getting-started-ilm.asciidoc

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>

* Fixed glossary merge error.

Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2020-02-04 16:45:18 -08:00

90 lines
2.0 KiB
Plaintext

[role="xpack"]
[testenv="basic"]
[[ilm-delete-lifecycle]]
=== Delete lifecycle policy API
++++
<titleabbrev>Delete policy</titleabbrev>
++++
Deletes an index lifecycle policy.
[[ilm-delete-lifecycle-request]]
==== {api-request-title}
`DELETE _ilm/policy/<policy_id>`
[[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}
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.
[[ilm-delete-lifecycle-path-params]]
==== {api-path-parms-title}
`<policy_id>`::
(Required, string) Identifier for the policy.
[[ilm-delete-lifecycle-query-params]]
==== {api-query-parms-title}
include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
[[ilm-delete-lifecycle-example]]
==== {api-examples-title}
The following example deletes `my_policy`:
//////////////////////////
[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": {}
}
}
}
}
}
--------------------------------------------------
// TEST
//////////////////////////
[source,console]
--------------------------------------------------
DELETE _ilm/policy/my_policy
--------------------------------------------------
// TEST[continued]
When the policy is successfully deleted, you receive the following result:
[source,console-result]
--------------------------------------------------
{
"acknowledged": true
}
--------------------------------------------------