delete-lifecycle.asciidoc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[ilm-delete-lifecycle]]
  4. === Delete Lifecycle Policy API
  5. ++++
  6. <titleabbrev>Delete Policy</titleabbrev>
  7. ++++
  8. Deletes an existing lifecycle policy
  9. ==== Request
  10. `DELETE _ilm/policy/<policy>`
  11. ==== Description
  12. Deletes an existing lifecycle policy
  13. ==== Path Parameters
  14. `policy` (required)::
  15. (string) Identifier for the policy.
  16. ==== Request Parameters
  17. `timeout`::
  18. (time units) Specifies the period of time to wait for the completion of the
  19. DELETE operation. When this period of time elapses, the API fails and returns
  20. an error. The default value is `30s`. For more information about time units,
  21. see <<time-units>>.
  22. `master_timeout`::
  23. (time units) Specifies the period of time to wait for the connection with master.
  24. When this period of time elapses, the API fails and returns an error.
  25. The default value is `30s`. For more information about time units, see <<time-units>>.
  26. ==== Examples
  27. The following example deletes an existing policy named `my_policy`:
  28. //////////////////////////
  29. [source,js]
  30. --------------------------------------------------
  31. PUT _ilm/policy/my_policy
  32. {
  33. "policy": {
  34. "phases": {
  35. "warm": {
  36. "min_age": "10d",
  37. "actions": {
  38. "forcemerge": {
  39. "max_num_segments": 1
  40. }
  41. }
  42. },
  43. "delete": {
  44. "min_age": "30d",
  45. "actions": {
  46. "delete": {}
  47. }
  48. }
  49. }
  50. }
  51. }
  52. --------------------------------------------------
  53. // CONSOLE
  54. // TEST
  55. //////////////////////////
  56. [source,js]
  57. --------------------------------------------------
  58. DELETE _ilm/policy/my_policy
  59. --------------------------------------------------
  60. // CONSOLE
  61. // TEST[continued]
  62. If the request does not encounter errors, you receive the following result:
  63. [source,js]
  64. --------------------------------------------------
  65. {
  66. "acknowledged": true
  67. }
  68. --------------------------------------------------
  69. // CONSOLE
  70. // TESTRESPONSE