UpdateILMPolicy
Modifies the lifecycle policy of an Elasticsearch index.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:UpdateILMPolicy |
none |
*Instance
|
None | None |
Request syntax
PUT /openapi/instances/{InstanceId}/ilm-policies/{PolicyName} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. |
es-cn-nif24adwc0082w2ka**** |
| PolicyName |
string |
Yes |
The name of the index lifecycle policy. |
my-policy |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClientToken |
string |
No |
Ensures the idempotence of the request. The value is generated by the client and must be unique across different requests. The value can be up to 64 ASCII characters in length. |
5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
| body |
string |
No |
The name and phase configurations of the index lifecycle policy to be updated. |
RequestBody
| Parameter | Type | Example | Required | Description |
| name | String | my-policy | Yes | The name of the index lifecycle policy. |
| phases | Map | No | The content of the index lifecycle policy. For more information, see Data structure of the phases field. |
Data structure of the phases field
| Parameter | Type | Example | Required | Description |
| {key} | Struct | No | The current lifecycle phase. Valid values: hot (the hot data phase, where the index is actively updated and queried), cold (the cold data phase, where the index is no longer updated and is rarely queried. The information must still be searchable, but slower query speeds are acceptable), and delete (the delete phase, where the index is no longer needed and can be safely deleted). | |
| minAge | String | 30d | No | The time required for the index to reach the target phase. |
| actions | Struct | No | The policy settings for the current phase. For more information, see Data structure of the actions field. |
Data structure of the actions field
| Parameter | Type | Example | Required | Description |
| rollver | Struct | No | The index rollover operation in the hot phase. For more information, see Data structure of the rollver field. | |
| setPriority | Struct | No | The index priority in the hot or cold phase. For more information, see Data structure of the setPriority field. | |
| allocate | Struct | No | The allocation operation in the cold phase. For more information, see Data structure of the allocate field. | |
| delete | Struct | {} | No | The index deletion operation. This parameter is required and must be an empty object when the delete phase is enabled. |
Data structure of the rollver field
| Parameter | Type | Example | Required | Description |
| maxAge | String | 30d | No | The time threshold that triggers the index rollover. You must specify at least one of the maxAge, maxDocs, and maxSize parameters. Unit: d (days) or h (hours). |
| maxDocs | Integer | 10000 | No | The document count threshold that triggers the index rollover. |
| maxSize | String | 50gb | No | The index size threshold that triggers the index rollover. You must specify at least one of the maxAge, maxDocs, and maxSize parameters. Unit: MB or GB. |
Data structure of the setPriority field
| Parameter | Type | Example | Required | Description |
| priority | Integer | 100 | No | The default priority of the current node. |
Data structure of the allocate field
| Parameter | Type | Example | Required | Description |
| numberOfReplicas | Integer | 1 | No | The specified number of replicas to allocate. If specified, the default value is 1. This parameter is used together with the migrate parameter. When automatic migration is enabled, the number of replicas is allocated by default. |
| require | Struct | No | Optional settings. Available for clusters with a hot and cold separation architecture. For more information, see Data structure of the require field. |
Data structure of the require field
| Parameter | Type | Example | Required | Description |
| boxType | String | warm | No | The custom node attribute identifier. Available for clusters with a hot and cold separation architecture to migrate data to warm nodes. Valid values: warm. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Result |
string |
The result. |
my-policy |
| RequestId |
string |
The request ID. |
F99407AB-2FA9-489E-A259-40CF6DCC**** |
Examples
Success response
JSON format
{
"Result": "my-policy",
"RequestId": "F99407AB-2FA9-489E-A259-40CF6DCC****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.