Get snapshot APIedit

Retrieves information about one or more snapshots.

GET /_snapshot/my_repository/my_snapshot

Requestedit

GET /_snapshot/<repository>/<snapshot>

Descriptionedit

Use the get snapshot API to return information about one or more snapshots, including:

  • Start and end time values
  • Version of Elasticsearch that created the snapshot
  • List of included indices
  • Current state of the snapshot
  • List of failures that occurred during the snapshot

Path parametersedit

<repository>

(Required, string) Snapshot repository name used to limit the request.

To get information about all snapshot repositories registered in the cluster, omit this parameter or use * or _all.

<snapshot>

(Required, string) Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*).

  • To get information about all snapshots in a registered repository, use a wildcard (*) or _all.
  • To get information about any snapshots that are currently running, use _current.

    Using _all in a request fails if any snapshots are unavailable. Set ignore_unavailable to true to return only available snapshots.

Request bodyedit

ignore_unavailable

(Optional, boolean) If false, the request returns an error for any snapshots that are unavailable. Defaults to false.

If true, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned.

verbose

(Optional, boolean) If true, returns all available information about a snapshot. Defaults to true.

If false, omits additional information about the snapshot, such as version information, start and end times, and the number of snapshotted shards.

Response bodyedit

snapshot
(string) Name of the snapshot.
uuid
(string) Universally unique identifier (UUID) of the snapshot.
version_id
(int) Build ID of the Elasticsearch version used to create the snapshot.
version
(float) Elasticsearch version used to create the snapshot.
indices
(array) List of indices included in the snapshot.
include_global_state
(boolean) Indicates whether the current cluster state is included in the snapshot.
start_time
(string) Date timestamp of when the snapshot creation process started.
start_time_in_millis
(long) The time, in milliseconds, when the snapshot creation process started.
end_time
(string) Date timestamp of when the snapshot creation process ended.
end_time_in_millis
(long) The time, in milliseconds, when the snapshot creation process ended.
duration_in_millis
(long) How long, in milliseconds, it took to create the snapshot.
failures
(array) Lists any failures that occurred when creating the snapshot.
shards

(object) Contains a count of shards in the snapshot.

Properties of shards
total
(integer) Total number of shards included in the snapshot.
successful
(integer) Number of shards that were successfully included in the snapshot.
failed
(integer) Number of shards that failed to be included in the snapshot.
state

(string) The snapshot state can be one of the following values:

Values for state
IN_PROGRESS
The snapshot is currently running.
SUCCESS
The snapshot finished and all shards were stored successfully.
FAILED
The snapshot finished with an error and failed to store any data.
PARTIAL
The global cluster state was stored, but data of at least one shard was not stored successfully. The failures section of the response contains more detailed information about shards that were not processed correctly.

Examplesedit

The following request returns information for snapshot_2 in the my_repository repository.

GET /_snapshot/my_repository/snapshot_2

The API returns the following response:

{
  "snapshots": [
    {
      "snapshot": "snapshot_2",
      "uuid": "vdRctLCxSketdKb54xw67g",
      "version_id": <version_id>,
      "version": <version>,
      "indices": [],
      "include_global_state": true,
      "state": "SUCCESS",
      "start_time": "2020-07-06T21:55:18.129Z",
      "start_time_in_millis": 1593093628850,
      "end_time": "2020-07-06T21:55:18.876Z",
      "end_time_in_millis": 1593094752018,
      "duration_in_millis": 0,
      "failures": [],
      "shards": {
        "total": 0,
        "failed": 0,
        "successful": 0
      }
    }
  ]
}