Get snapshot information
Generally available; Added in 2.1.0
All methods and paths for this operation:
Get information about the snapshots stored in one or more repositories. A snapshot is a backup of an index or running Elasticsearch cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot API.
Required authorization
- Cluster privileges:
monitor_snapshot
Path parameters
-
A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions.
_all
returns all repositories. If any repository fails during the request, Elasticsearch returns an error.
Query parameters
-
A comma-separated list of columns names to display. It supports simple wildcards.
Supported values include:
id
(orsnapshot
): The ID of the snapshot, such as 'snap1'.repository
(orre
,repo
): The name of the repository, such as 'repo1'.status
(ors
): State of the snapshot process. Returned values are: 'FAILED': The snapshot process failed. 'INCOMPATIBLE': The snapshot process is incompatible with the current cluster version. 'IN_PROGRESS': The snapshot process started but has not completed. 'PARTIAL': The snapshot process completed with a partial success. 'SUCCESS': The snapshot process completed with a full success.start_epoch
(orste
,startEpoch
): The unix epoch time at which the snapshot process started.start_time
(orsti
,startTime
): 'HH:MM:SS' time at which the snapshot process started.end_epoch
(orete
,endEpoch
): The unix epoch time at which the snapshot process ended.end_time
(oreti
,endTime
): 'HH:MM:SS' time at which the snapshot process ended.duration
(ordur
): The time it took the snapshot process to complete in time units.indices
(ori
): The number of indices in the snapshot.successful_shards
(orss
): The number of successful shards in the snapshot.failed_shards
(orfs
): The number of failed shards in the snapshot.total_shards
(orts
): The total number of shards in the snapshot.reason
(orr
): The reason for any snapshot failures.
Values are
id
,snapshot
,repository
,re
,repo
,status
,s
,start_epoch
,ste
,startEpoch
,start_time
,sti
,startTime
,end_epoch
,ete
,endEpoch
,end_time
,eti
,endTime
,duration
,dur
,indices
,i
,successful_shards
,ss
,failed_shards
,fs
,total_shards
,ts
,reason
, orr
. -
List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting
:asc
or:desc
as a suffix to the column name. -
Period to wait for a connection to the master node.
Values are
-1
or0
. -
Unit used to display time values.
Values are
nanos
,micros
,ms
,s
,m
,h
, ord
.
GET /_cat/snapshots/repo1?v=true&s=id&format=json
resp = client.cat.snapshots(
repository="repo1",
v=True,
s="id",
format="json",
)
const response = await client.cat.snapshots({
repository: "repo1",
v: "true",
s: "id",
format: "json",
});
response = client.cat.snapshots(
repository: "repo1",
v: "true",
s: "id",
format: "json"
)
$resp = $client->cat()->snapshots([
"repository" => "repo1",
"v" => "true",
"s" => "id",
"format" => "json",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/snapshots/repo1?v=true&s=id&format=json"
client.cat().snapshots();
[
{
"id": "snap1",
"repository": "repo1",
"status": "FAILED",
"start_epoch": "1445616705",
"start_time": "18:11:45",
"end_epoch": "1445616978",
"end_time": "18:16:18",
"duration": "4.6m",
"indices": "1",
"successful_shards": "4",
"failed_shards": "1",
"total_shards": "5"
},
{
"id": "snap2",
"repository": "repo1",
"status": "SUCCESS",
"start_epoch": "1445634298",
"start_time": "23:04:58",
"end_epoch": "1445634672",
"end_time": "23:11:12",
"duration": "6.2m",
"indices": "2",
"successful_shards": "10",
"failed_shards": "0",
"total_shards": "10"
}
]