Type to search.

Create or update a policy

Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 7.4 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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.

Required privileges

Index privileges manage
Cluster privileges manage_slm

Path parameters

policy_id string required

The identifier for the snapshot lifecycle policy you want to create or update.

Query parameters

master_timeout string · default: 30s

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 · default: 30s

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.

Request body

name string

Name automatically assigned to each snapshot created by the policy. Date math is supported. To prevent conflicting snapshot names, a UUID is automatically appended to each snapshot name.

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.

schedule string

Periodic or absolute schedule at which the policy creates snapshots. SLM applies schedule changes immediately.

Response

application/json
acknowledged boolean required

For a successful response, this value is always true. On failure, an exception is returned instead.