2015-10-22 05:00:51 -04:00
|
|
|
[[cat-snapshots]]
|
|
|
|
== cat snapshots
|
|
|
|
|
|
|
|
The `snapshots` command shows all snapshots that belong to a specific repository.
|
|
|
|
To find a list of available repositories to query, the command `/_cat/repositories` can be used.
|
|
|
|
Querying the snapshots of a repository named `repo1` then looks as follows.
|
|
|
|
|
2017-05-03 20:58:23 -04:00
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET /_cat/snapshots/repo1?v&s=id
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[s/^/PUT \/_snapshot\/repo1\/snap1?wait_for_completion=true\n/]
|
|
|
|
// TEST[s/^/PUT \/_snapshot\/repo1\/snap2?wait_for_completion=true\n/]
|
|
|
|
// TEST[s/^/PUT \/_snapshot\/repo1\n{"type": "fs", "settings": {"location": "repo\/1"}}\n/]
|
|
|
|
|
|
|
|
Which looks like:
|
|
|
|
|
|
|
|
[source,txt]
|
2015-10-22 05:00:51 -04:00
|
|
|
--------------------------------------------------
|
2015-10-30 10:08:31 -04:00
|
|
|
id status start_epoch start_time end_epoch end_time duration indices successful_shards failed_shards total_shards
|
|
|
|
snap1 FAILED 1445616705 18:11:45 1445616978 18:16:18 4.6m 1 4 1 5
|
|
|
|
snap2 SUCCESS 1445634298 23:04:58 1445634672 23:11:12 6.2m 2 10 0 10
|
2015-10-22 05:00:51 -04:00
|
|
|
--------------------------------------------------
|
2017-05-03 20:58:23 -04:00
|
|
|
// TESTRESPONSE[s/FAILED/SUCCESS/ s/14456\d+/\\d+/ s/\d+(\.\d+)?(m|s|ms)/\\d+(\\.\\d+)?(m|s|ms)/]
|
|
|
|
// TESTRESPONSE[s/\d+:\d+:\d+/\\d+:\\d+:\\d+/]
|
|
|
|
// TESTRESPONSE[s/1 4 1 5/\\d+ \\d+ \\d+ \\d+/]
|
|
|
|
// TESTRESPONSE[s/2 10 0 10/\\d+ \\d+ \\d+ \\d+/]
|
|
|
|
// TESTRESPONSE[_cat]
|
2015-10-22 05:00:51 -04:00
|
|
|
|
|
|
|
Each snapshot contains information about when it was started and stopped.
|
|
|
|
Start and stop timestamps are available in two formats.
|
|
|
|
The `HH:MM:SS` output is simply for quick human consumption.
|
2017-05-03 20:58:23 -04:00
|
|
|
The epoch time retains more information, including date, and is machine sortable if the snapshot process spans days.
|