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
-
The identifier for the snapshot lifecycle policy you want to create or update.
Query parameters
-
master_timeout string
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.
-
timeout string
Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
Body
-
config object
Additional properties are allowed.
-
name string
-
repository string
Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API.
-
retention object
Additional properties are allowed.
-
schedule string
curl \
-X PUT http://api.example.com/_slm/policy/{policy_id} \
-H "Content-Type: application/json" \
-d '{"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"}'
{
"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"
}
{
"acknowledged": true
}