2015-10-22 05:00:51 -04:00
|
|
|
[[cat-snapshots]]
|
2019-08-13 08:35:08 -04:00
|
|
|
=== cat snapshots API
|
|
|
|
++++
|
|
|
|
<titleabbrev>cat snapshots</titleabbrev>
|
|
|
|
++++
|
2015-10-22 05:00:51 -04:00
|
|
|
|
2019-08-12 08:40:33 -04:00
|
|
|
Returns information about the <<modules-snapshots,snapshots>> stored in one or
|
|
|
|
more repositories. A snapshot is a backup of an index or running {es} cluster.
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-snapshots-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
2019-08-23 10:57:20 -04:00
|
|
|
`GET /_cat/snapshots/<repository>`
|
2019-08-12 08:40:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
[[cat-snapshots-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
2019-08-23 10:57:20 -04:00
|
|
|
`<repository>`::
|
2019-08-12 08:40:33 -04:00
|
|
|
+
|
|
|
|
--
|
2019-12-17 09:23:38 -05:00
|
|
|
(Required, string) Snapshot repository used to limit the request.
|
2019-08-12 08:40:33 -04:00
|
|
|
|
2019-12-17 09:23:38 -05:00
|
|
|
If the repository fails during the request, {es} returns an error.
|
2019-08-12 08:40:33 -04:00
|
|
|
--
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-snapshots-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
|
|
|
|
+
|
|
|
|
--
|
|
|
|
If you do not specify which columns to include, the API returns the default
|
|
|
|
columns in the order listed below. If you explicitly specify one or more
|
|
|
|
columns, it only returns the specified columns.
|
|
|
|
|
|
|
|
Valid columns are:
|
|
|
|
|
|
|
|
`id`, `snapshot`::
|
|
|
|
(Default) ID of the snapshot, such as `snap1`.
|
|
|
|
|
|
|
|
`repository`, `re`, `repo`::
|
|
|
|
(Default) Name of the repository, such as `repo1`.
|
|
|
|
|
|
|
|
`status`, `s`::
|
|
|
|
(Default) 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`, `ste`, `startEpoch`::
|
|
|
|
(Default) https://en.wikipedia.org/wiki/Unix_time[Unix `epoch` time] at which
|
|
|
|
the snapshot process started.
|
|
|
|
|
|
|
|
`start_time`, `sti`, `startTime`::
|
|
|
|
(Default) `HH:MM:SS` time at which the snapshot process started.
|
|
|
|
|
|
|
|
`end_epoch`, `ete`, `endEpoch`::
|
|
|
|
(Default) https://en.wikipedia.org/wiki/Unix_time[Unix `epoch` time] at which
|
|
|
|
the snapshot process ended.
|
|
|
|
|
|
|
|
`end_time`, `eti`, `endTime`::
|
|
|
|
(Default) `HH:MM:SS` time at which the snapshot process ended.
|
|
|
|
|
|
|
|
`duration`, `dur`::
|
|
|
|
(Default) Time it took the snapshot process to complete in <<time-units,time
|
|
|
|
units>>.
|
|
|
|
|
|
|
|
`indices`, `i`::
|
|
|
|
(Default) Number of indices in the snapshot.
|
|
|
|
|
|
|
|
`successful_shards`, `ss`::
|
|
|
|
(Default) Number of successful shards in the snapshot.
|
|
|
|
|
|
|
|
`failed_shards`, `fs`::
|
|
|
|
(Default) Number of failed shards in the snapshot.
|
|
|
|
|
|
|
|
`total_shards`, `ts`::
|
|
|
|
(Default) Total number of shards in the snapshot.
|
|
|
|
|
|
|
|
`reason, `r`::
|
|
|
|
Reason for any snapshot failures.
|
|
|
|
--
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
|
|
|
|
|
|
|
|
`ignore_unavailable`::
|
|
|
|
(Optional, boolean) If `true`, the response does not include information from
|
|
|
|
unavailable snapshots. Defaults to `false`.
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
|
|
|
|
|
2019-10-10 09:48:40 -04:00
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=time]
|
|
|
|
|
2019-08-12 08:40:33 -04:00
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-snapshots-api-example]]
|
|
|
|
==== {api-examples-title}
|
2015-10-22 05:00:51 -04:00
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2017-05-03 20:58:23 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_cat/snapshots/repo1?v&s=id
|
|
|
|
--------------------------------------------------
|
|
|
|
// 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/]
|
|
|
|
|
2019-08-12 08:40:33 -04:00
|
|
|
The API returns the following response:
|
2017-05-03 20:58:23 -04:00
|
|
|
|
|
|
|
[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+/]
|
2019-06-10 09:33:32 -04:00
|
|
|
// TESTRESPONSE[non_json]
|
2015-10-22 05:00:51 -04:00
|
|
|
|