Create or update a policy
Added in 7.4.0
Create or update a snapshot lifecycle policy. If the policy already exists, this request increments the policy version. Only the latest version of a policy is stored.
Path parameters
-
policy_id
string Required The identifier for the snapshot lifecycle policy you want to create or update.
Query parameters
-
master_timeout
string The 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. To indicate that the request should never timeout, set it to
-1
. -
timeout
string The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to
-1
.
PUT
/_slm/policy/{policy_id}
curl \
--request PUT http://api.example.com/_slm/policy/{policy_id} \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"config":{"ignore_unavailable":true,"indices":"string","include_global_state":true,"feature_states":["string"],"metadata":{"additionalProperty1":{},"additionalProperty2":{}},"partial":true},"name":"string","repository":"string","retention":{"expire_after":"string","max_count":42.0,"min_count":42.0},"schedule":"string"}'
Request examples
{
"config": {
"ignore_unavailable": true,
"indices": "string",
"include_global_state": true,
"feature_states": [
"string"
],
"metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"partial": true
},
"name": "string",
"repository": "string",
"retention": {
"expire_after": "string",
"max_count": 42.0,
"min_count": 42.0
},
"schedule": "string"
}
Response examples (200)
{
"acknowledged": true
}