remove-policy-from-index.asciidoc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. ==== Request
  10. `POST <index>/_ilm/remove`
  11. ==== Description
  12. Removes the assigned lifecycle policy and stops managing the specified index.
  13. If an index pattern is specified, removes the assigned policies from all matching
  14. indices.
  15. ==== Path Parameters
  16. `index` (required)::
  17. (string) Identifier for the index.
  18. ==== Request Parameters
  19. include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  20. ==== Authorization
  21. You must have the `manage_ilm` privileges on the indices being managed to use this API.
  22. For more information, see {stack-ov}/security-privileges.html[Security Privileges].
  23. ==== Examples
  24. The following example removes the assigned policy from `my_index`.
  25. //////////////////////////
  26. [source,js]
  27. --------------------------------------------------
  28. PUT _ilm/policy/my_policy
  29. {
  30. "policy": {
  31. "phases": {
  32. "warm": {
  33. "min_age": "10d",
  34. "actions": {
  35. "forcemerge": {
  36. "max_num_segments": 1
  37. }
  38. }
  39. },
  40. "delete": {
  41. "min_age": "30d",
  42. "actions": {
  43. "delete": {}
  44. }
  45. }
  46. }
  47. }
  48. }
  49. PUT my_index
  50. {
  51. "settings": {
  52. "index.lifecycle.name": "my_policy"
  53. }
  54. }
  55. --------------------------------------------------
  56. // CONSOLE
  57. // TEST
  58. //////////////////////////
  59. [source,js]
  60. --------------------------------------------------
  61. POST my_index/_ilm/remove
  62. --------------------------------------------------
  63. // CONSOLE
  64. // TEST[continued]
  65. If the request succeeds, you receive the following result:
  66. [source,console-result]
  67. --------------------------------------------------
  68. {
  69. "has_failures" : false,
  70. "failed_indexes" : []
  71. }
  72. --------------------------------------------------