move-to-step.asciidoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[ilm-move-to-step]]
  4. === Move To Step API
  5. ++++
  6. <titleabbrev>Move To Step</titleabbrev>
  7. ++++
  8. Moves a managed index into a specific execution step its policy
  9. ==== Request
  10. `POST _ilm/move/<index>`
  11. ==== Description
  12. WARNING: This is an expert API that may lead to unintended data loss. When used,
  13. an index's policy will begin executing at the specified step. It will execute
  14. the step specified even if it has already executed it. Since this is a, potentionally,
  15. dangerous action, specifying both the current step and next step to move to is
  16. required in the body of the request.
  17. This API changes the current step for the specified index to the step supplied in the body of the request
  18. ==== Path Parameters
  19. `index` (required)::
  20. (string) Identifier for the index.
  21. ==== Request Parameters
  22. `timeout`::
  23. (time units) Specifies the period of time to wait for the completion of the
  24. move operation. When this period of time elapses, the API fails and returns
  25. an error. The default value is `30s`. For more information about time units,
  26. see <<time-units>>.
  27. `master_timeout`::
  28. (time units) Specifies the period of time to wait for the connection with master.
  29. When this period of time elapses, the API fails and returns an error.
  30. The default value is `30s`. For more information about time units, see <<time-units>>.
  31. ==== Examples
  32. The following example moves the index `my_index` from the initial step to the
  33. forcemerge step:
  34. //////////////////////////
  35. [source,js]
  36. --------------------------------------------------
  37. PUT _ilm/policy/my_policy
  38. {
  39. "policy": {
  40. "phases": {
  41. "warm": {
  42. "min_age": "10d",
  43. "actions": {
  44. "forcemerge": {
  45. "max_num_segments": 1
  46. }
  47. }
  48. },
  49. "delete": {
  50. "min_age": "30d",
  51. "actions": {
  52. "delete": {}
  53. }
  54. }
  55. }
  56. }
  57. }
  58. PUT my_index
  59. {
  60. "settings": {
  61. "index.lifecycle.name": "my_policy"
  62. }
  63. }
  64. --------------------------------------------------
  65. // CONSOLE
  66. // TEST
  67. //////////////////////////
  68. [source,js]
  69. --------------------------------------------------
  70. POST _ilm/move/my_index
  71. {
  72. "current_step": { <1>
  73. "phase": "new",
  74. "action": "complete",
  75. "name": "complete"
  76. },
  77. "next_step": { <2>
  78. "phase": "warm",
  79. "action": "forcemerge",
  80. "name": "forcemerge"
  81. }
  82. }
  83. --------------------------------------------------
  84. // CONSOLE
  85. // TEST[continued]
  86. <1> The step that the index is currently expected to be executing
  87. <2> The step that the index should move to when executing this request
  88. If the request does not encounter errors, you receive the following result:
  89. [source,js]
  90. --------------------------------------------------
  91. {
  92. "acknowledged": true
  93. }
  94. --------------------------------------------------
  95. // CONSOLE
  96. // TESTRESPONSE
  97. NOTE: An error will be returned if the index is now longer executing the step
  98. specified in `current_step`. This is so the index is not moved from an
  99. unexpected step into the `next_step`.