Create a snapshot
- POST also PUT /_snapshot/{repository}/{snapshot}
Take a snapshot of a cluster or of data streams and indices.
More about managing snapshotsRequired authorization
- Cluster privileges create_snapshot
Request body
-
expand_wildcardsstring · default: all -
Determines how wildcard patterns in the
indicesparameter match data streams and indices. It supports comma-separated values such asopen,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 withopen,closed, orboth.none: Wildcard expressions are not accepted.
-
Values:
allopenclosedhiddennone -
feature_statesstring -
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_stateistrue, all current feature states are included by default. Ifinclude_global_stateisfalse, 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_statevalue, specify an array with only the valuenone(["none"]). - Reference
-
If
true, the request ignores data streams and indices inindicesthat are missing or closed. Iffalse, the request returns an error for any data stream or index that is missing or closed. -
include_global_stateboolean · 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 viafeature_states). -
indicesstring -
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_statesinstead. -
metadataobject -
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.
-
partialboolean · default: false -
If
true, it enables you to restore a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty.If
false, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.