delete-lifecycle.asciidoc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[ilm-delete-lifecycle]]
  4. === Delete Lifecycle Policy API
  5. ++++
  6. <titleabbrev>Delete Policy</titleabbrev>
  7. ++++
  8. Deletes a lifecycle policy.
  9. ==== Request
  10. `DELETE _ilm/policy/<policy_id>`
  11. ==== Description
  12. Deletes the specified lifecycle policy definition. You cannot delete policies
  13. that are currently in use. If the policy is being used to manage any indices,
  14. the request fails and returns an error.
  15. ==== Path Parameters
  16. `policy` (required)::
  17. (string) Identifier for the policy.
  18. ==== Request Parameters
  19. include::{docdir}/rest-api/timeoutparms.asciidoc[]
  20. ==== Authorization
  21. include::ilm-cluster-mgt-privilege.asciidoc[]
  22. ==== Examples
  23. The following example deletes `my_policy`:
  24. //////////////////////////
  25. [source,js]
  26. --------------------------------------------------
  27. PUT _ilm/policy/my_policy
  28. {
  29. "policy": {
  30. "phases": {
  31. "warm": {
  32. "min_age": "10d",
  33. "actions": {
  34. "forcemerge": {
  35. "max_num_segments": 1
  36. }
  37. }
  38. },
  39. "delete": {
  40. "min_age": "30d",
  41. "actions": {
  42. "delete": {}
  43. }
  44. }
  45. }
  46. }
  47. }
  48. --------------------------------------------------
  49. // CONSOLE
  50. // TEST
  51. //////////////////////////
  52. [source,js]
  53. --------------------------------------------------
  54. DELETE _ilm/policy/my_policy
  55. --------------------------------------------------
  56. // CONSOLE
  57. // TEST[continued]
  58. When the policy is successfully deleted, you receive the following result:
  59. [source,js]
  60. --------------------------------------------------
  61. {
  62. "acknowledged": true
  63. }
  64. --------------------------------------------------
  65. // CONSOLE
  66. // TESTRESPONSE