move-to-step.asciidoc 2.5 KB

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