remove-policy-from-index.asciidoc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[ilm-remove-policy]]
  4. === Remove policy from index API
  5. ++++
  6. <titleabbrev>Remove policy</titleabbrev>
  7. ++++
  8. Removes assigned lifecycle policies from an index or a data stream's backing
  9. indices.
  10. [[ilm-remove-policy-request]]
  11. ==== {api-request-title}
  12. `POST <target>/_ilm/remove`
  13. [[ilm-remove-policy-prereqs]]
  14. ==== {api-prereq-title}
  15. * If the {es} {security-features} are enabled, you must have the `manage_ilm`
  16. privileges on the indices being managed to use this API. For more information,
  17. see <<security-privileges>>.
  18. [[ilm-remove-policy-desc]]
  19. ==== {api-description-title}
  20. For indices, the remove lifecycle policy API removes the assigned lifecycle
  21. policy and stops managing the specified index.
  22. For data streams, the API removes any assigned lifecycle policies from
  23. the stream's backing indices and stops managing the indices.
  24. [[ilm-remove-policy-path-params]]
  25. ==== {api-path-parms-title}
  26. `<target>`::
  27. (Required, string)
  28. Comma-separated list of data streams, indices, and index aliases to target.
  29. Wildcard expressions (`*`) are supported.
  30. +
  31. To target all data streams and indices in a cluster, use `_all` or `*`.
  32. [[ilm-remove-policy-query-params]]
  33. ==== {api-query-parms-title}
  34. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  35. [[ilm-remove-policy-example]]
  36. ==== {api-examples-title}
  37. The following example removes the assigned policy from `my_index`.
  38. //////////////////////////
  39. [source,console]
  40. --------------------------------------------------
  41. PUT _ilm/policy/my_policy
  42. {
  43. "policy": {
  44. "phases": {
  45. "warm": {
  46. "min_age": "10d",
  47. "actions": {
  48. "forcemerge": {
  49. "max_num_segments": 1
  50. }
  51. }
  52. },
  53. "delete": {
  54. "min_age": "30d",
  55. "actions": {
  56. "delete": {}
  57. }
  58. }
  59. }
  60. }
  61. }
  62. PUT my_index
  63. {
  64. "settings": {
  65. "index.lifecycle.name": "my_policy"
  66. }
  67. }
  68. --------------------------------------------------
  69. //////////////////////////
  70. [source,console]
  71. --------------------------------------------------
  72. POST my_index/_ilm/remove
  73. --------------------------------------------------
  74. // TEST[continued]
  75. If the request succeeds, you receive the following result:
  76. [source,console-result]
  77. --------------------------------------------------
  78. {
  79. "has_failures" : false,
  80. "failed_indexes" : []
  81. }
  82. --------------------------------------------------