remove-policy-from-index.asciidoc 1.8 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. beta[]
  9. Removes the assigned lifecycle policy from an index.
  10. ==== Request
  11. `POST <index>/_ilm/remove`
  12. ==== Description
  13. Removes the assigned lifecycle policy and stops managing the specified index.
  14. If an index pattern is specified, removes the assigned policies from all matching
  15. indices.
  16. ==== Path Parameters
  17. `index` (required)::
  18. (string) Identifier for the index.
  19. ==== Request Parameters
  20. include::{docdir}/rest-api/timeoutparms.asciidoc[]
  21. ==== Authorization
  22. You must have the `manage_ilm` privileges on the indices being managed to use this API.
  23. For more information, see {stack-ov}/security-privileges.html[Security Privileges].
  24. ==== Examples
  25. The following example removes the assigned policy from `my_index`.
  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. PUT my_index
  51. {
  52. "settings": {
  53. "index.lifecycle.name": "my_policy"
  54. }
  55. }
  56. --------------------------------------------------
  57. // CONSOLE
  58. // TEST
  59. //////////////////////////
  60. [source,js]
  61. --------------------------------------------------
  62. POST my_index/_ilm/remove
  63. --------------------------------------------------
  64. // CONSOLE
  65. // TEST[continued]
  66. If the request succeeds, you receive the following result:
  67. [source,js]
  68. --------------------------------------------------
  69. {
  70. "has_failures" : false,
  71. "failed_indexes" : []
  72. }
  73. --------------------------------------------------
  74. // CONSOLE
  75. // TESTRESPONSE