remove-policy.asciidoc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[ilm-remove-policy]]
  4. === Remove Policy On Index API
  5. ++++
  6. <titleabbrev>Remove Policy From Index</titleabbrev>
  7. ++++
  8. Unassigns a policy from a specified index pattern
  9. ==== Request
  10. `DELETE <index>/_ilm`
  11. ==== Description
  12. This action removes a policy from managing an index. It is effectively the same as setting an index's
  13. `index.lifecycle.name` setting to null.
  14. ==== Path Parameters
  15. `index` (required)::
  16. (string) Identifier for the index.
  17. ==== Request Parameters
  18. `timeout`::
  19. (time units) Specifies the period of time to wait for the completion of the
  20. operation. When this period of time elapses, the API fails and returns
  21. an error. The default value is `30s`. For more information about time units,
  22. see <<time-units>>.
  23. `master_timeout`::
  24. (time units) Specifies the period of time to wait for the connection with master.
  25. When this period of time elapses, the API fails and returns an error.
  26. The default value is `30s`. For more information about time units, see <<time-units>>.
  27. ==== Examples
  28. The following example removes a policy `my_policy` from an index `my_index`.
  29. //////////////////////////
  30. [source,js]
  31. --------------------------------------------------
  32. PUT _ilm/my_policy
  33. {
  34. "policy": {
  35. "phases": {
  36. "warm": {
  37. "minimum_age": "10d",
  38. "actions": {
  39. "forcemerge": {
  40. "max_num_segments": 1
  41. }
  42. }
  43. },
  44. "delete": {
  45. "minimum_age": "30d",
  46. "actions": {
  47. "delete": {}
  48. }
  49. }
  50. }
  51. }
  52. }
  53. PUT my_index
  54. {
  55. "settings": {
  56. "index.lifecycle.name": "my_policy"
  57. }
  58. }
  59. --------------------------------------------------
  60. // CONSOLE
  61. // TEST
  62. //////////////////////////
  63. [source,js]
  64. --------------------------------------------------
  65. DELETE my_index/_ilm
  66. --------------------------------------------------
  67. // CONSOLE
  68. // TEST[continued]
  69. If the request does not encounter errors, you receive the following result:
  70. [source,js]
  71. --------------------------------------------------
  72. {
  73. "has_failures" : false,
  74. "failed_indexes" : []
  75. }
  76. --------------------------------------------------
  77. // CONSOLE
  78. // TESTRESPONSE