delete-lifecycle.asciidoc 1.7 KB

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