remove-policy-from-index.asciidoc 2.3 KB

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