English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Elasticsearch Manage Index Lifecycle

Managing index lifecycle involves performing management operations based on factors such as shard size and performance requirements. The Index Lifecycle Management (ILM) API allows you to automatically manage indices over time.

This chapter lists the ILM API and its usage.

Policy Management API

API NameFunction
Instance
Create lifecycle policy.Create a lifecycle policy. If the specified policy exists, replace the policy and increase the policy version.PUT_ilm / policy / policy_id
Get lifecycle policy.Return the specified policy definition. Includes policy version and last modified date. If no policy is specified, all defined policies are returned.GET_ilm / policy / policy_id
Delete lifecycle policyDelete the specified lifecycle policy definition. You cannot delete the policy currently in use. If the policy is used to manage any index, the request will fail and return an error.DELETE_ilm / policy / policy_id

Index Management API

API NameFunction
Instance

Transfer to lifecycle step API.

Manually move the index to the specified step and execute that step.POST_ilm/move/index

Retry the policy.

Set the policy back to the step where an error occurred and execute that step.POST index/_ilm/retry
Remove the policy from the index API editing.Remove the allocated lifecycle policy and stop managing the specified index. If the index pattern is specified, the allocated policy will be removed from all matching indices.POST index/_ilm/remove

Operation Management API

API NameFunctionInstance
Get the index lifecycle management status API.Return the status of the ILM plugin. The operation_mode field in the response shows one of the following three statuses: STARTED, STOPPING, or STOPPED.GET /_ilm/status
Start the index lifecycle management API.If the current state is stopped, start the ILM plugin. The ILM will automatically start after the cluster is formed.POST /_ilm/start
Stop the index lifecycle management API.Stop all lifecycle management operations and stop the ILM plugin. This feature is very useful when you are performing maintenance on the cluster and need to prevent ILM from performing any operations on the index.POST /_ilm/stop
Explain the lifecycle API.Retrieve information about the current lifecycle state of the index, such as the current phase, operation, and steps being executed. It shows when the index was entered, the definition of the running phase, and information about any failures.GET index/_ilm/explain