remove-policy-from-index.asciidoc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 the assigned lifecycle policy from an index.
  9. [[ilm-remove-policy-request]]
  10. ==== {api-request-title}
  11. `POST <index>/_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. Removes the assigned lifecycle policy and stops managing the specified index.
  20. If an index pattern is specified, removes the assigned policies from all matching
  21. indices.
  22. [[ilm-remove-policy-path-params]]
  23. ==== {api-path-parms-title}
  24. `<index>`::
  25. (Required, string) Identifier for the index.
  26. [[ilm-remove-policy-query-params]]
  27. ==== {api-query-parms-title}
  28. include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  29. [[ilm-remove-policy-example]]
  30. ==== {api-examples-title}
  31. The following example removes the assigned policy from `my_index`.
  32. //////////////////////////
  33. [source,console]
  34. --------------------------------------------------
  35. PUT _ilm/policy/my_policy
  36. {
  37. "policy": {
  38. "phases": {
  39. "warm": {
  40. "min_age": "10d",
  41. "actions": {
  42. "forcemerge": {
  43. "max_num_segments": 1
  44. }
  45. }
  46. },
  47. "delete": {
  48. "min_age": "30d",
  49. "actions": {
  50. "delete": {}
  51. }
  52. }
  53. }
  54. }
  55. }
  56. PUT my_index
  57. {
  58. "settings": {
  59. "index.lifecycle.name": "my_policy"
  60. }
  61. }
  62. --------------------------------------------------
  63. //////////////////////////
  64. [source,console]
  65. --------------------------------------------------
  66. POST my_index/_ilm/remove
  67. --------------------------------------------------
  68. // TEST[continued]
  69. If the request succeeds, you receive the following result:
  70. [source,console-result]
  71. --------------------------------------------------
  72. {
  73. "has_failures" : false,
  74. "failed_indexes" : []
  75. }
  76. --------------------------------------------------