2018-10-16 15:18:54 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
|
|
|
[[ilm-move-to-step]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Move to lifecycle step API
|
2018-10-16 15:18:54 -04:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Move to step</titleabbrev>
|
2018-10-16 15:18:54 -04:00
|
|
|
++++
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
Triggers execution of a specific step in the lifecycle policy.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
|
|
|
==== Request
|
|
|
|
|
|
|
|
`POST _ilm/move/<index>`
|
|
|
|
|
|
|
|
==== Description
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
WARNING: This operation can result in the loss of data. Manually moving an index
|
|
|
|
into a specific step executes that step even if it has already been performed.
|
|
|
|
This is a potentially destructive action and this should be considered an expert
|
|
|
|
level API.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
Manually moves an index into the specified step and executes that step.
|
|
|
|
You must specify both the current step and the step to be executed in the
|
|
|
|
body of the request.
|
|
|
|
|
|
|
|
The request will fail if the current step does not match the step currently
|
|
|
|
being executed for the index. This is to prevent the index from being moved from
|
|
|
|
an unexpected step into the next step.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
|
|
|
==== Path Parameters
|
|
|
|
|
|
|
|
`index` (required)::
|
|
|
|
(string) Identifier for the index.
|
|
|
|
|
|
|
|
==== Request Parameters
|
|
|
|
|
2019-08-02 08:42:33 -04:00
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
==== Authorization
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-12-18 12:53:25 -05:00
|
|
|
You must have the `manage_ilm` privileges on the indices being managed to use this API.
|
2019-10-07 18:23:19 -04:00
|
|
|
For more information, see <<security-privileges>>.
|
2018-10-16 15:18:54 -04:00
|
|
|
|
|
|
|
==== Examples
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
The following example moves `my_index` from the initial step to the
|
|
|
|
`forcemerge` step:
|
2018-10-16 15:18:54 -04:00
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
2018-10-30 19:19:05 -04:00
|
|
|
PUT _ilm/policy/my_policy
|
2018-10-16 15:18:54 -04:00
|
|
|
{
|
|
|
|
"policy": {
|
|
|
|
"phases": {
|
|
|
|
"warm": {
|
2018-10-30 15:54:02 -04:00
|
|
|
"min_age": "10d",
|
2018-10-16 15:18:54 -04:00
|
|
|
"actions": {
|
|
|
|
"forcemerge": {
|
|
|
|
"max_num_segments": 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
2018-10-30 15:54:02 -04:00
|
|
|
"min_age": "30d",
|
2018-10-16 15:18:54 -04:00
|
|
|
"actions": {
|
|
|
|
"delete": {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-18 03:34:11 -05:00
|
|
|
PUT my_index
|
2018-10-16 15:18:54 -04:00
|
|
|
{
|
|
|
|
"settings": {
|
|
|
|
"index.lifecycle.name": "my_policy"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
POST _ilm/move/my_index
|
|
|
|
{
|
|
|
|
"current_step": { <1>
|
|
|
|
"phase": "new",
|
|
|
|
"action": "complete",
|
|
|
|
"name": "complete"
|
|
|
|
},
|
|
|
|
"next_step": { <2>
|
|
|
|
"phase": "warm",
|
|
|
|
"action": "forcemerge",
|
|
|
|
"name": "forcemerge"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
2018-11-08 18:26:27 -05:00
|
|
|
<1> The step that the index is expected to be in
|
|
|
|
<2> The step that you want to execute
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
If the request succeeds, you receive the following result:
|
2018-10-16 15:18:54 -04:00
|
|
|
|
2019-09-06 09:22:08 -04:00
|
|
|
[source,console-result]
|
2018-10-16 15:18:54 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"acknowledged": true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2018-11-08 18:26:27 -05:00
|
|
|
The request will fail if the index is not in the `new` phase as specified
|
|
|
|
by the `current_step`.
|