move-to-step.asciidoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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/common-parms.asciidoc[tag=timeoutparms]
  27. ==== Authorization
  28. You must have the `manage_ilm` privileges on the indices being managed to use this API.
  29. For more information, see {stack-ov}/security-privileges.html[Security Privileges].
  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,console-result]
  89. --------------------------------------------------
  90. {
  91. "acknowledged": true
  92. }
  93. --------------------------------------------------
  94. The request will fail if the index is not in the `new` phase as specified
  95. by the `current_step`.