Type to search.

Create a snapshot

Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 0.0 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.

Take a snapshot of a cluster or of data streams and indices.

Read the reference documentation

Required privileges

Cluster privileges create_snapshot

Path parameters

repository string required

The name of the repository for the snapshot.

snapshot string required

The name of the snapshot. It supportes date math. It must be unique in the repository.

Query parameters

master_timeout union oneOf · 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.

Values: -1 0
wait_for_completion boolean · default: false

If true, the request returns a response when the snapshot is complete. If false, the request returns a response when the snapshot initializes.

Request body

expand_wildcards union oneOf · default: all

Determines how wildcard patterns in the indices parameter match data streams and indices. It supports comma-separated values such as open,hidden.

Supported values include:

  • all: Match any data stream or index, including hidden ones.
  • open: Match open, non-hidden indices. Also matches any non-hidden data stream.
  • closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
  • hidden: Match hidden data streams and hidden indices. Must be combined with open, closed, or both.
  • none: Wildcard expressions are not accepted.
Values: all open closed hidden none
feature_states string[]

The feature states to include in the snapshot. Each feature state includes one or more system indices containing related data. You can view a list of eligible features using the get features API.

If include_global_state is true, all current feature states are included by default. If include_global_state is false, no feature states are included by default.

Note that specifying an empty array will result in the default behavior. To exclude all feature states, regardless of the include_global_state value, specify an array with only the value none (["none"]).

ignore_unavailable boolean · default: false

If true, the request ignores data streams and indices in indices that are missing or closed. If false, the request returns an error for any data stream or index that is missing or closed.

include_global_state boolean · default: true

If true, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indices, such as Watches and task records (configurable via feature_states).

indices union oneOf

A comma-separated list of data streams and indices to include in the snapshot. It supports a multi-target syntax. The default is an empty array ([]), which includes all regular data streams and regular indices. To exclude all data streams and indices, use -*.

You can't use this parameter to include or exclude system indices or system data streams from a snapshot. Use feature_states instead.

One of: string[] or string
metadata object

Arbitrary metadata to the snapshot, such as a record of who took the snapshot, why it was taken, or any other useful data. It can have any contents but it must be less than 1024 bytes. This information is not automatically generated by Elasticsearch.

partial boolean · default: false

If true, allows the snapshot to proceed even if some of the target shards are unavailable. In this case, the resulting snapshot will not contain snapshots of the unavailable target shards, and will report its state as PARTIAL. Additionally, if true, allows index metadata operations such as deletions while the snapshot is in progress. This is almost always preferable to failing the snapshot completely when a single shard is unavailable, and blocking index metadata operations.

If false, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available, and index metadata operations such as deletions will be forbidden until the snapshot completes.

Response

application/json
accepted boolean The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 7.15 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.

Equals true if the snapshot was accepted. Present when the request had wait_for_completion set to false