Create or update a lifecycle policy
- PUT /_ilm/policy/{policy}
If the specified policy exists, it is replaced and the policy version is incremented.
NOTE: Only the latest version of the policy is stored, you cannot revert to previous versions.
- Index privileges:
manage - Cluster privileges:
manage_ilm
Path Parameters
-
policystring Namerequired -
Identifier for the policy.
Query Parameters
-
master_timeoutstring Duration · default: 30s Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
-
timeoutstring Duration · default: 30s Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
Request
-
policyPolicy -
phasesPhasesrequired -
coldPhase -
actionsActions -
allocateAllocateAction -
Phases allowed: warm, cold.
-
number_of_replicasnumber -
total_shards_per_nodenumber -
includemap string to string -
excludemap string to string -
requiremap string to string -
downsampleDownsampleAction -
Phases allowed: hot, warm, cold.
-
fixed_intervalstringrequired -
wait_timeoutstring Duration -
freezeEmptyObjectdeprecated -
The freeze action is a noop in 8.x
-
forcemergeForceMergeAction -
Phases allowed: hot, warm.
-
max_num_segmentsnumberrequired -
index_codecstring -
readonlyEmptyObject -
Phases allowed: hot, warm, cold.
-
rolloverRolloverAction -
Phases allowed: hot.
-
max_sizenumber | string ByteSizedeprecated -
The
max_sizecondition has been deprecated in 9.3.0 andmax_primary_shard_sizeshould be used instead -
max_primary_shard_sizenumber | string ByteSize -
max_agestring Duration -
max_docsnumber -
max_primary_shard_docsnumber -
min_sizenumber | string ByteSize -
min_primary_shard_sizenumber | string ByteSize -
min_agestring Duration -
min_docsnumber -
min_primary_shard_docsnumber -
searchable_snapshotSearchableSnapshotAction -
Phases allowed: hot, cold, frozen.
-
snapshot_repositorystringrequired -
force_merge_indexboolean -
shrinkShrinkAction -
Phases allowed: hot, warm.
-
number_of_shardsnumber -
max_primary_shard_sizenumber | string ByteSize -
allow_write_after_shrinkboolean -
unfollowEmptyObject -
Phases allowed: hot, warm, cold, frozen.
-
min_agestring Duration -
deletePhase -
frozenPhase -
hotPhase -
warmPhase -
_metaMetadata -
Arbitrary metadata that is not automatically generated or used by Elasticsearch.
Response
-
acknowledgedbooleanrequired -
For a successful response, this value is always true. On failure, an exception is returned instead.