OpenSearch/docs/reference/ilm/apis/move-to-step.asciidoc

121 lines
2.7 KiB
Plaintext
Raw Normal View History

[role="xpack"]
[testenv="basic"]
[[ilm-move-to-step]]
2018-12-20 13:23:28 -05:00
=== Move to lifecycle step API
++++
2018-12-20 13:23:28 -05:00
<titleabbrev>Move to step</titleabbrev>
++++
Triggers execution of a specific step in the lifecycle policy.
==== Request
`POST _ilm/move/<index>`
==== Description
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.
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.
==== Path Parameters
`index` (required)::
(string) Identifier for the index.
==== Request Parameters
include::{docdir}/rest-api/timeoutparms.asciidoc[]
==== Authorization
You must have the `manage_ilm` privileges on the indices being managed to use this API.
For more information, see {stack-ov}/security-privileges.html[Security Privileges].
==== Examples
The following example moves `my_index` from the initial step to the
`forcemerge` step:
//////////////////////////
[source,js]
--------------------------------------------------
PUT _ilm/policy/my_policy
{
"policy": {
"phases": {
"warm": {
"min_age": "10d",
"actions": {
"forcemerge": {
"max_num_segments": 1
}
}
},
"delete": {
"min_age": "30d",
"actions": {
"delete": {}
}
}
}
}
}
Update the default for include_type_name to false. (#37285) * Default include_type_name to false for get and put mappings. * Default include_type_name to false for get field mappings. * Add a constant for the default include_type_name value. * Default include_type_name to false for get and put index templates. * Default include_type_name to false for create index. * Update create index calls in REST documentation to use include_type_name=true. * Some minor clean-ups around the get index API. * In REST tests, use include_type_name=true by default for index creation. * Make sure to use 'expression == false'. * Clarify the different IndexTemplateMetaData toXContent methods. * Fix FullClusterRestartIT#testSnapshotRestore. * Fix the ml_anomalies_default_mappings test. * Fix GetFieldMappingsResponseTests and GetIndexTemplateResponseTests. We make sure to specify include_type_name=true during xContent parsing, so we continue to test the legacy typed responses. XContent generation for the typeless responses is currently only covered by REST tests, but we will be adding unit test coverage for these as we implement each typeless API in the Java HLRC. This commit also refactors GetMappingsResponse to follow the same appraoch as the other mappings-related responses, where we read include_type_name out of the xContent params, instead of creating a second toXContent method. This gives better consistency in the response parsing code. * Fix more REST tests. * Improve some wording in the create index documentation. * Add a note about types removal in the create index docs. * Fix SmokeTestMonitoringWithSecurityIT#testHTTPExporterWithSSL. * Make sure to mention include_type_name in the REST docs for affected APIs. * Make sure to use 'expression == false' in FullClusterRestartIT. * Mention include_type_name in the REST templates docs.
2019-01-14 16:08:01 -05:00
PUT my_index?include_type_name=true
{
"settings": {
"index.lifecycle.name": "my_policy"
}
}
--------------------------------------------------
// CONSOLE
// TEST
//////////////////////////
[source,js]
--------------------------------------------------
POST _ilm/move/my_index
{
"current_step": { <1>
"phase": "new",
"action": "complete",
"name": "complete"
},
"next_step": { <2>
"phase": "warm",
"action": "forcemerge",
"name": "forcemerge"
}
}
--------------------------------------------------
// CONSOLE
// TEST[continued]
<1> The step that the index is expected to be in
<2> The step that you want to execute
If the request succeeds, you receive the following result:
[source,js]
--------------------------------------------------
{
"acknowledged": true
}
--------------------------------------------------
// CONSOLE
// TESTRESPONSE
The request will fail if the index is not in the `new` phase as specified
by the `current_step`.