1
1
[[cat-snapshots]]
2
2
=== cat snapshots
3
3
4
- The `snapshots` command shows all snapshots that belong to a specific repository
5
- or multiple repositories.
6
- To find a list of available repositories to query, the command `/_cat/repositories` can be used.
7
- Querying the snapshots of a repository named `repo1` then looks as follows.
4
+ Returns information about the <<modules-snapshots,snapshots>>, stored in one or
5
+ more repositories. A snapshot is a backup of an index or running {es} cluster.
6
+
7
+
8
+ [[cat-snapshots-api-request]]
9
+ ==== {api-request-title}
10
+
11
+ `GET /_cat/snapshots/{repository}`
12
+
13
+
14
+ [[cat-snapshots-path-params]]
15
+ ==== {api-path-parms-title}
16
+
17
+ `{repository}`::
18
+ +
19
+ --
20
+ (Optional, string) Comma-separated list of snapshot repositories used to limit
21
+ the request. Accepts wildcard expressions. `_all` returns all repositories.
22
+
23
+ If any repository fails during the request, {es} returns an error.
24
+ --
25
+
26
+
27
+ [[cat-snapshots-query-params]]
28
+ ==== {api-query-parms-title}
29
+
30
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
31
+
32
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
33
+ +
34
+ --
35
+ If you do not specify which columns to include, the API returns the default
36
+ columns in the order listed below. If you explicitly specify one or more
37
+ columns, it only returns the specified columns.
38
+
39
+ Valid columns are:
40
+
41
+ `id`, `snapshot`::
42
+ (Default) ID of the snapshot, such as `snap1`.
43
+
44
+ `repository`, `re`, `repo`::
45
+ (Default) Name of the repository, such as `repo1`.
46
+
47
+ `status`, `s`::
48
+ (Default) State of the snapshot process. Returned values are:
49
+ +
50
+ * `FAILED`: The snapshot process failed.
51
+ * `INCOMPATIBLE`: The snapshot process is incompatible with the current cluster
52
+ version.
53
+ * `IN_PROGRESS`: The snapshot process started but has not completed.
54
+ * `PARTIAL`: The snapshot process completed with a partial success.
55
+ * `SUCCESS`: The snapshot process completed with a full success.
56
+
57
+ `start_epoch`, `ste`, `startEpoch`::
58
+ (Default) https://en.wikipedia.org/wiki/Unix_time[Unix `epoch` time] at which
59
+ the snapshot process started.
60
+
61
+ `start_time`, `sti`, `startTime`::
62
+ (Default) `HH:MM:SS` time at which the snapshot process started.
63
+
64
+ `end_epoch`, `ete`, `endEpoch`::
65
+ (Default) https://en.wikipedia.org/wiki/Unix_time[Unix `epoch` time] at which
66
+ the snapshot process ended.
67
+
68
+ `end_time`, `eti`, `endTime`::
69
+ (Default) `HH:MM:SS` time at which the snapshot process ended.
70
+
71
+ `duration`, `dur`::
72
+ (Default) Time it took the snapshot process to complete in <<time-units,time
73
+ units>>.
74
+
75
+ `indices`, `i`::
76
+ (Default) Number of indices in the snapshot.
77
+
78
+ `successful_shards`, `ss`::
79
+ (Default) Number of successful shards in the snapshot.
80
+
81
+ `failed_shards`, `fs`::
82
+ (Default) Number of failed shards in the snapshot.
83
+
84
+ `total_shards`, `ts`::
85
+ (Default) Total number of shards in the snapshot.
86
+
87
+ `reason, `r`::
88
+ Reason for any snapshot failures.
89
+ --
90
+
91
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
92
+
93
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
94
+
95
+ `ignore_unavailable`::
96
+ (Optional, boolean) If `true`, the response does not include information from
97
+ unavailable snapshots. Defaults to `false`.
98
+
99
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
100
+
101
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
102
+
103
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
104
+
105
+
106
+ [[cat-snapshots-api-example]]
107
+ ==== {api-examples-title}
8
108
9
109
[source,js]
10
110
--------------------------------------------------
@@ -15,7 +115,7 @@ GET /_cat/snapshots/repo1?v&s=id
15
115
// TEST[s/^/PUT \/_snapshot\/repo1\/snap2?wait_for_completion=true\n/]
16
116
// TEST[s/^/PUT \/_snapshot\/repo1\n{"type": "fs", "settings": {"location": "repo\/1"}}\n/]
17
117
18
- Which looks like :
118
+ The API returns the following response :
19
119
20
120
[source,txt]
21
121
--------------------------------------------------
@@ -29,21 +129,3 @@ snap2 repo1 SUCCESS 1445634298 23:04:58 1445634672 23:11:12 6.2m
29
129
// TESTRESPONSE[s/2 10 0 10/\\d+ \\d+ \\d+ \\d+/]
30
130
// TESTRESPONSE[non_json]
31
131
32
- Each snapshot contains information about when it was started and stopped.
33
- Start and stop timestamps are available in two formats.
34
- The `HH:MM:SS` output is simply for quick human consumption.
35
- The epoch time retains more information, including date, and is machine sortable if the snapshot process spans days.
36
-
37
- It is also possible to get the list of snapshots from multiple repositories.
38
- Here are some examples:
39
-
40
- [source,js]
41
- --------------------------------------------------
42
- GET /_cat/snapshots/_all
43
- GET /_cat/snapshots/repo1,repo2
44
- GET /_cat/snapshots/repo*
45
- --------------------------------------------------
46
- // CONSOLE
47
- // TEST[skip:no repo2]
48
-
49
- Please note that if one of the repositories fails during the request you will get an exception instead of the table.
0 commit comments