Get snapshot information Generally available; Added in 0.0.0

GET /_snapshot/{repository}/{snapshot}

Required authorization

  • Cluster privileges: monitor_snapshot

Path parameters

  • repository string Required

    Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported.

  • snapshot string | array[string] Required

    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.

Query parameters

  • ignore_unavailable boolean

    If false, the request returns an error for any snapshots that are unavailable.

  • master_timeout string

    Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

    Values are -1 or 0.

  • verbose boolean

    If true, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted.

  • index_details boolean

    If true, returns additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index. Defaults to false, meaning that this information is omitted.

  • index_names boolean

    If true, returns the name of each index in each snapshot.

  • include_repository boolean

    If true, returns the repository name in each snapshot.

  • sort string

    Allows setting a sort order for the result. Defaults to start_time, i.e. sorting by snapshot start time stamp.

    Values are start_time, duration, name, index_count, repository, shard_count, or failed_shard_count.

  • size number

    Maximum number of snapshots to return. Defaults to 0 which means return all that match the request without limit.

  • order string

    Sort order. Valid values are asc for ascending and desc for descending order. Defaults to asc, meaning ascending order.

    Supported values include:

    • asc: Ascending (smallest to largest)
    • desc: Descending (largest to smallest)

    Values are asc or desc.

  • after string

    Offset identifier to start pagination from as returned by the next field in the response body.

  • offset number

    Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0.

  • from_sort_value string

    Value of the current sort column at which to start retrieval. Can either be a string snapshot- or repository name when sorting by snapshot or repository name, a millisecond time value or a number when sorting by index- or shard count.

  • slm_policy_filter string

    Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Also accepts wildcards (*) and combinations of wildcards followed by exclude patterns starting with -. To include snapshots not created by an SLM policy you can use the special pattern _none that will match all snapshots without an SLM policy.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • responses array[object]
      Hide responses attributes Show responses attributes object
      • repository string Required
      • snapshots array[object]
        Hide snapshots attributes Show snapshots attributes object
        • data_streams array[string] Required
        • duration string

          A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • duration_in_millis number

          Time unit for milliseconds

        • end_time string
        • end_time_in_millis number

          Time unit for milliseconds

        • failures array[object]
        • include_global_state boolean
        • indices array[string]
        • index_details object Generally available; Added in 7.13.0
          Hide index_details attribute Show index_details attribute object
          • * object Additional properties
        • metadata object
          Hide metadata attribute Show metadata attribute object
          • * object Additional properties
        • reason string
        • repository string
        • snapshot string Required
        • shards object
          Hide shards attributes Show shards attributes object
          • failed number Required
          • successful number Required
          • total number Required
          • failures array[object]
          • skipped number
        • start_time string
        • start_time_in_millis number

          Time unit for milliseconds

        • state string
        • uuid string Required
        • version string
        • version_id number
        • feature_states array[object]
      • error object

        Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        Hide error attributes Show error attributes object
        • type string Required

          The type of error

        • reason string | null

          A human-readable explanation of the error, in English.

        • stack_trace string

          The server stack trace. Present only if the error_trace=true parameter was sent with the request.

        • caused_by object

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        • root_cause array[object]

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        • suppressed array[object]

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

    • snapshots array[object]
      Hide snapshots attributes Show snapshots attributes object
      • data_streams array[string] Required
      • duration string

        A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

      • duration_in_millis number

        Time unit for milliseconds

      • end_time string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

        One of:

        Time unit for milliseconds

      • end_time_in_millis number

        Time unit for milliseconds

      • failures array[object]
        Hide failures attributes Show failures attributes object
        • index string Required
        • node_id string
        • reason string Required
        • shard_id number Required
        • index_uuid string Required
        • status string Required
      • include_global_state boolean
      • indices array[string]
      • index_details object Generally available; Added in 7.13.0
        Hide index_details attribute Show index_details attribute object
        • * object Additional properties
          Hide * attributes Show * attributes object
      • metadata object
        Hide metadata attribute Show metadata attribute object
        • * object Additional properties
      • reason string
      • repository string
      • snapshot string Required
      • shards object
        Hide shards attributes Show shards attributes object
        • failed number Required
        • successful number Required
        • total number Required
        • failures array[object]
          Hide failures attributes Show failures attributes object
          • index string
          • node string
          • reason object Required

            Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

          • shard number Required
          • status string
        • skipped number
      • start_time string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

        One of:

        Time unit for milliseconds

      • start_time_in_millis number

        Time unit for milliseconds

      • state string
      • uuid string Required
      • version string
      • version_id number
      • feature_states array[object]
        Hide feature_states attributes Show feature_states attributes object
        • feature_name string Required
        • indices string | array[string] Required
    • total number Required Generally available; Added in 7.15.0

      The total number of snapshots that match the request when ignoring size limit or after query parameter.

    • remaining number Required Generally available; Added in 7.15.0

      The number of remaining snapshots that were not returned due to size limits and that can be fetched by additional requests using the next field value.

GET /_snapshot/{repository}/{snapshot}
GET /_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000
resp = client.snapshot.get(
    repository="my_repository",
    snapshot="snapshot_*",
    sort="start_time",
    from_sort_value="1577833200000",
)
const response = await client.snapshot.get({
  repository: "my_repository",
  snapshot: "snapshot_*",
  sort: "start_time",
  from_sort_value: 1577833200000,
});
response = client.snapshot.get(
  repository: "my_repository",
  snapshot: "snapshot_*",
  sort: "start_time",
  from_sort_value: "1577833200000"
)
$resp = $client->snapshot()->get([
    "repository" => "my_repository",
    "snapshot" => "snapshot_*",
    "sort" => "start_time",
    "from_sort_value" => "1577833200000",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000"
Response examples (200)
A successful response from `GET /_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000`. The response contains information for all snapshots with names starting with `snapshot_` and that started on or after timestamp `1577833200000` (Jan 1st 2020) when sorted by snapshot start time in the default ascending order.
{
  "snapshots": [
    {
      "snapshot": "snapshot_1",
      "uuid": "dKb54xw67gvdRctLCxSket",
      "repository": "my_repository",
      "version_id": <version_id>,
      "version": <version>,
      "indices": [],
      "data_streams": [],
      "feature_states": [],
      "include_global_state": true,
      "state": "SUCCESS",
      "start_time": "2020-07-06T21:55:18.128Z",
      "start_time_in_millis": 1593093628849,
      "end_time": "2020-07-06T21:55:18.129Z",
      "end_time_in_millis": 1593093628850,
      "duration_in_millis": 1,
      "failures": [],
      "shards": {
        "total": 0,
        "failed": 0,
        "successful": 0
      }
    },
    {
      "snapshot": "snapshot_2",
      "uuid": "vdRctLCxSketdKb54xw67g",
      "repository": "my_repository",
      "version_id": <version_id>,
      "version": <version>,
      "indices": [],
      "data_streams": [],
      "feature_states": [],
      "include_global_state": true,
      "state": "SUCCESS",
      "start_time": "2020-07-06T21:55:18.130Z",
      "start_time_in_millis": 1593093628851,
      "end_time": "2020-07-06T21:55:18.130Z",
      "end_time_in_millis": 1593093628851,
      "duration_in_millis": 0,
      "failures": [],
      "shards": {
        "total": 0,
        "failed": 0,
        "successful": 0
      }
    },
    {
      "snapshot": "snapshot_3",
      "uuid": "dRctdKb54xw67gvLCxSket",
      "repository": "my_repository",
      "version_id": <version_id>,
      "version": <version>,
      "indices": [],
      "data_streams": [],
      "feature_states": [],
      "include_global_state": true,
      "state": "SUCCESS",
      "start_time": "2020-07-06T21:55:18.131Z",
      "start_time_in_millis": 1593093628852,
      "end_time": "2020-07-06T21:55:18.135Z",
      "end_time_in_millis": 1593093628856,
      "duration_in_millis": 4,
      "failures": [],
      "shards": {
        "total": 0,
        "failed": 0,
        "successful": 0
      }
    }
  ],
  "total": 3,
  "remaining": 0
}