Creates a snapshot in a repository Added in 0.0.0
Path parameters
-
Repository for the snapshot.
-
Name of the snapshot. Must be unique in the repository.
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.
-
wait_for_completion boolean
If
true
, the request returns a response when the snapshot is complete. Iffalse
, the request returns a response when the snapshot initializes.
Body
-
include_global_state boolean
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
). -
indices string | array[string]
-
feature_states array[string]
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
istrue
, all current feature states are included by default. Ifinclude_global_state
isfalse
, no feature states are included by default. -
metadata object
-
partial boolean
If
true
, allows restoring 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. Iffalse
, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.
curl \
-X POST http://api.example.com/_snapshot/{repository}/{snapshot} \
-H "Content-Type: application/json" \
-d '{"ignore_unavailable":true,"include_global_state":true,"indices":"string","feature_states":["string"],"metadata":{"additionalProperty1":{},"additionalProperty2":{}},"partial":true}'
{
"ignore_unavailable": true,
"include_global_state": true,
"indices": "string",
"feature_states": [
"string"
],
"metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"partial": true
}
{
"accepted": true,
"snapshot": {
"data_streams": [
"string"
],
"duration": "string",
"": 42.0,
"failures": [
{
"index": "string",
"node_id": "string",
"reason": "string",
"shard_id": "string",
"index_uuid": "string",
"status": "string"
}
],
"include_global_state": true,
"indices": [
"string"
],
"index_details": {
"additionalProperty1": {
"shard_count": 42.0,
"": 42.0,
"size_in_bytes": 42.0,
"max_segments_per_shard": 42.0
},
"additionalProperty2": {
"shard_count": 42.0,
"": 42.0,
"size_in_bytes": 42.0,
"max_segments_per_shard": 42.0
}
},
"metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"reason": "string",
"repository": "string",
"snapshot": "string",
"shards": {
"failed": 42.0,
"successful": 42.0,
"total": 42.0,
"failures": [
{
"index": "string",
"node": "string",
"reason": {
"type": "string",
"reason": "string",
"stack_trace": "string",
"caused_by": {},
"root_cause": [
{}
],
"suppressed": [
{}
]
},
"shard": 42.0,
"status": "string"
}
],
"skipped": 42.0
},
"state": "string",
"uuid": "string",
"version": "string",
"version_id": 42.0,
"feature_states": [
{
"feature_name": "string",
"indices": "string"
}
]
}
}