move-to-step.asciidoc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[ilm-move-to-step]]
  4. === Move to Lifecycle Step API
  5. ++++
  6. <titleabbrev>Move to Step</titleabbrev>
  7. ++++
  8. beta[]
  9. Triggers execution of a specific step in the lifecycle policy.
  10. ==== Request
  11. `POST _ilm/move/<index>`
  12. ==== Description
  13. WARNING: This operation can result in the loss of data. Manually moving an index
  14. into a specific step executes that step even if it has already been performed.
  15. This is a potentially destructive action and this should be considered an expert
  16. level API.
  17. Manually moves an index into the specified step and executes that step.
  18. You must specify both the current step and the step to be executed in the
  19. body of the request.
  20. The request will fail if the current step does not match the step currently
  21. being executed for the index. This is to prevent the index from being moved from
  22. an unexpected step into the next step.
  23. ==== Path Parameters
  24. `index` (required)::
  25. (string) Identifier for the index.
  26. ==== Request Parameters
  27. include::{docdir}/rest-api/timeoutparms.asciidoc[]
  28. ==== Authorization
  29. include::ilm-index-mgt-privilege.asciidoc[]
  30. ==== Examples
  31. The following example moves `my_index` from the initial step to the
  32. `forcemerge` step:
  33. //////////////////////////
  34. [source,js]
  35. --------------------------------------------------
  36. PUT _ilm/policy/my_policy
  37. {
  38. "policy": {
  39. "phases": {
  40. "warm": {
  41. "min_age": "10d",
  42. "actions": {
  43. "forcemerge": {
  44. "max_num_segments": 1
  45. }
  46. }
  47. },
  48. "delete": {
  49. "min_age": "30d",
  50. "actions": {
  51. "delete": {}
  52. }
  53. }
  54. }
  55. }
  56. }
  57. PUT my_index
  58. {
  59. "settings": {
  60. "index.lifecycle.name": "my_policy"
  61. }
  62. }
  63. --------------------------------------------------
  64. // CONSOLE
  65. // TEST
  66. //////////////////////////
  67. [source,js]
  68. --------------------------------------------------
  69. POST _ilm/move/my_index
  70. {
  71. "current_step": { <1>
  72. "phase": "new",
  73. "action": "complete",
  74. "name": "complete"
  75. },
  76. "next_step": { <2>
  77. "phase": "warm",
  78. "action": "forcemerge",
  79. "name": "forcemerge"
  80. }
  81. }
  82. --------------------------------------------------
  83. // CONSOLE
  84. // TEST[continued]
  85. <1> The step that the index is expected to be in
  86. <2> The step that you want to execute
  87. If the request succeeds, you receive the following result:
  88. [source,js]
  89. --------------------------------------------------
  90. {
  91. "acknowledged": true
  92. }
  93. --------------------------------------------------
  94. // CONSOLE
  95. // TESTRESPONSE
  96. The request will fail if the index is not in the `new` phase as specified
  97. by the `current_step`.