move-to-step.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. You must have the `manage_ilm` privileges on the indices being managed to use this API.
  30. For more information, see {stack-ov}/security-privileges.html[Security Privileges].
  31. ==== Examples
  32. The following example moves `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 expected to be in
  87. <2> The step that you want to execute
  88. If the request succeeds, you receive the following result:
  89. [source,js]
  90. --------------------------------------------------
  91. {
  92. "acknowledged": true
  93. }
  94. --------------------------------------------------
  95. // CONSOLE
  96. // TESTRESPONSE
  97. The request will fail if the index is not in the `new` phase as specified
  98. by the `current_step`.