mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
848 lines
29 KiB
Text
848 lines
29 KiB
Text
[[get-snapshot-api]]
|
|
=== Get snapshot API
|
|
++++
|
|
<titleabbrev>Get snapshot</titleabbrev>
|
|
++++
|
|
|
|
Retrieves information about one or more snapshots.
|
|
|
|
////
|
|
[source,console]
|
|
----
|
|
PUT /_snapshot/my_repository
|
|
{
|
|
"type": "fs",
|
|
"settings": {
|
|
"location": "my_backup_location"
|
|
}
|
|
}
|
|
|
|
PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
|
|
{
|
|
"indices":"-*"
|
|
}
|
|
|
|
PUT /_snapshot/my_repository/snapshot_1?wait_for_completion=true
|
|
{
|
|
"indices":"-*"
|
|
}
|
|
|
|
PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true
|
|
{
|
|
"indices":"-*"
|
|
}
|
|
|
|
PUT /_snapshot/my_repository/snapshot_3?wait_for_completion=true
|
|
{
|
|
"indices":"-*"
|
|
}
|
|
----
|
|
// TESTSETUP
|
|
////
|
|
|
|
[source,console]
|
|
----
|
|
GET /_snapshot/my_repository/my_snapshot
|
|
----
|
|
|
|
[[get-snapshot-api-request]]
|
|
==== {api-request-title}
|
|
|
|
`GET /_snapshot/<repository>/<snapshot>`
|
|
|
|
[[get-snapshot-api-prereqs]]
|
|
==== {api-prereq-title}
|
|
|
|
* If the {es} {security-features} are enabled, you must have the
|
|
`monitor_snapshot`, `create_snapshot`, or `manage`
|
|
<<privileges-list-cluster,cluster privilege>> to use this API.
|
|
|
|
[[get-snapshot-api-path-params]]
|
|
==== {api-path-parms-title}
|
|
|
|
`<repository>`::
|
|
(Required, string)
|
|
Comma-separated list of snapshot repository names used to limit the request.
|
|
Wildcard (`*`) expressions are supported including combining wildcards with exclude patterns starting with `-`.
|
|
+
|
|
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.
|
|
Wildcard (`*`) expressions are supported including combining wildcards with exclude patterns starting with `-`.
|
|
+
|
|
* 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`.
|
|
+
|
|
NOTE: Using `_all` in a request fails if any snapshots are unavailable.
|
|
Set <<get-snapshot-api-ignore-unavailable,`ignore_unavailable`>> to `true` to return only available snapshots.
|
|
|
|
[role="child_attributes"]
|
|
[[get-snapshot-api-query-params]]
|
|
==== {api-query-parms-title}
|
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
|
|
|
[[get-snapshot-api-ignore-unavailable]]
|
|
`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 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. Defaults to `true`. If
|
|
`false`, omits the additional information.
|
|
|
|
`index_names`::
|
|
(Optional, Boolean)
|
|
If `true`, returns the list of index names included in each snapshot in the response.
|
|
Defaults to `true`.
|
|
|
|
`index_details`::
|
|
(Optional, 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.
|
|
|
|
`include_repository`::
|
|
(Optional, Boolean)
|
|
If `true`, returns the repository name for each snapshot in the response.
|
|
Defaults to `true`.
|
|
|
|
`sort`::
|
|
(Optional, string)
|
|
Allows setting a sort order for the result. Defaults to `start_time`, i.e. sorting by snapshot start time stamp.
|
|
+
|
|
.Valid values for `sort`
|
|
[%collapsible%open]
|
|
====
|
|
`start_time`::
|
|
Sort snapshots by their start time stamp and break ties by snapshot name.
|
|
|
|
`duration`::
|
|
Sort snapshots by their duration and break ties by snapshot name.
|
|
|
|
`name`::
|
|
Sort snapshots by their name.
|
|
|
|
`repository`::
|
|
Sort snapshots by their repository name and break ties by snapshot name.
|
|
|
|
`index_count`::
|
|
Sort snapshots by the number of indices they contain and break ties by snapshot name.
|
|
|
|
`shard_count`::
|
|
Sort snapshots by the number of shards they contain and break ties by snapshot name.
|
|
|
|
`failed_shard_count`::
|
|
Sort snapshots by the number of shards that they failed to snapshot and break ties by snapshot name.
|
|
====
|
|
|
|
`size`::
|
|
(Optional, integer)
|
|
Maximum number of snapshots to return. Defaults to `0` which means return all that match the request without limit.
|
|
|
|
`order`::
|
|
(Optional, string)
|
|
Sort order. Valid values are `asc` for ascending and `desc` for descending order. Defaults to `asc`, meaning ascending order.
|
|
|
|
`from_sort_value`::
|
|
(Optional, 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.
|
|
|
|
`after`::
|
|
(Optional, string)
|
|
Offset identifier to start pagination from as returned by the `next` field in the response body. Using this parameter is mutually exclusive
|
|
with using the `from_sort_value` parameter.
|
|
|
|
`offset`::
|
|
(Optional, integer)
|
|
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`.
|
|
|
|
`slm_policy_filter`::
|
|
(Optional, 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 `-`. For example, the pattern `*,-policy-a-\*` will return all snapshots except
|
|
for those that were created by an SLM policy with a name starting with `policy-a-`. Note that the wildcard pattern `*` matches all snapshots
|
|
created by an SLM policy but not those snapshots that were not created by an SLM policy. 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.
|
|
|
|
NOTE: The `after` parameter and `next` field allow for iterating through snapshots with some consistency guarantees regarding concurrent
|
|
creation or deletion of snapshots. It is guaranteed that any snapshot that exists at the beginning of the iteration and is not concurrently
|
|
deleted will be seen during the iteration. Snapshots concurrently created may be seen during an iteration.
|
|
|
|
NOTE: The parameters `size`, `order`, `after`, `from_sort_value`, `offset`, `slm_policy_filter` and `sort` are not supported when using
|
|
`verbose=false` and the sort order for requests with `verbose=false` is undefined.
|
|
|
|
[role="child_attributes"]
|
|
[[get-snapshot-api-response-body]]
|
|
==== {api-response-body-title}
|
|
|
|
`snapshot`::
|
|
(string)
|
|
Name of the snapshot.
|
|
|
|
`uuid`::
|
|
(string)
|
|
Universally unique identifier (UUID) of the snapshot.
|
|
|
|
`version_id`::
|
|
(int)
|
|
Build ID of the {es} version used to create the snapshot.
|
|
|
|
`version`::
|
|
(float)
|
|
{es} version used to create the snapshot.
|
|
|
|
`indices`::
|
|
(array)
|
|
List of indices included in the snapshot.
|
|
|
|
`index_details`::
|
|
(object)
|
|
Details of each index in the snapshot, keyed by index name. Only present if the
|
|
`?index_details` query parameter is set, and only contains details for indices
|
|
that were completely snapshotted in a sufficiently recent version of {es}.
|
|
+
|
|
.Properties of `index_details`
|
|
[%collapsible%open]
|
|
====
|
|
`shard_count`::
|
|
(integer)
|
|
Number of shards in this index.
|
|
|
|
`size`::
|
|
(string)
|
|
Total size of all shards in this index. Only present if the `?human` query
|
|
paramter is set.
|
|
|
|
`size_in_bytes`::
|
|
(long)
|
|
Total size of all shards in this index, in bytes.
|
|
|
|
`max_segments_per_shard`::
|
|
(integer)
|
|
Maximum number of segments per shard in this index snapshot.
|
|
====
|
|
|
|
`data_streams`::
|
|
(array of strings)
|
|
List of <<data-streams,data streams>> included in the snapshot.
|
|
|
|
`include_global_state`::
|
|
(Boolean)
|
|
Indicates whether the current cluster state is included in the snapshot.
|
|
|
|
[[get-snapshot-api-feature-states]]
|
|
`feature_states`::
|
|
(array of objects) <<feature-state,Feature states>> in the snapshot.
|
|
Only present if the snapshot contains one or more feature states.
|
|
+
|
|
.Properties of `features_states` objects
|
|
[%collapsible%open]
|
|
====
|
|
`feature_name`::
|
|
(string) Name of the feature, as returned by the <<get-features-api,get features
|
|
API>>.
|
|
|
|
`indices`::
|
|
(array of strings) Indices in the feature state.
|
|
====
|
|
|
|
`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.
|
|
|
|
[[get-snapshot-api-response-failures]]
|
|
`failures`::
|
|
(array)
|
|
Lists any failures that occurred when creating the snapshot.
|
|
|
|
`shards`::
|
|
(object)
|
|
Contains a count of shards in the snapshot.
|
|
+
|
|
.Properties of `shards`
|
|
[%collapsible%open]
|
|
====
|
|
`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.
|
|
====
|
|
|
|
[[get-snapshot-api-response-state]]
|
|
`state`::
|
|
+
|
|
--
|
|
(string)
|
|
The snapshot `state` can be one of the following values:
|
|
|
|
.Values for `state`
|
|
[%collapsible%open]
|
|
====
|
|
`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 <<get-snapshot-api-response-failures,`failures`>> section of the response contains more detailed information about shards
|
|
that were not processed correctly.
|
|
====
|
|
--
|
|
`next`::
|
|
(string)
|
|
If the request contained a size limit and there might be more results, a `next` field will be added to the response and can be used as the
|
|
`after` query parameter to fetch additional results.
|
|
|
|
`total`::
|
|
(integer)
|
|
The total number of snapshots that match the request when ignoring size limit or `after` query parameter.
|
|
|
|
`remaining`::
|
|
(integer)
|
|
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-api-example]]
|
|
==== {api-examples-title}
|
|
|
|
The following request returns information for `snapshot_2` in the `my_repository` repository.
|
|
|
|
[source,console]
|
|
----
|
|
GET /_snapshot/my_repository/snapshot_2
|
|
----
|
|
|
|
The API returns the following response:
|
|
|
|
[source,console-result]
|
|
----
|
|
{
|
|
"snapshots": [
|
|
{
|
|
"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.129Z",
|
|
"start_time_in_millis": 1593093628850,
|
|
"end_time": "2020-07-06T21:55:18.129Z",
|
|
"end_time_in_millis": 1593094752018,
|
|
"duration_in_millis": 0,
|
|
"failures": [],
|
|
"shards": {
|
|
"total": 0,
|
|
"failed": 0,
|
|
"successful": 0
|
|
}
|
|
}
|
|
],
|
|
"total": 1,
|
|
"remaining": 0
|
|
}
|
|
----
|
|
// TESTRESPONSE[s/"uuid": "vdRctLCxSketdKb54xw67g"/"uuid": $body.snapshots.0.uuid/]
|
|
// TESTRESPONSE[s/"version_id": <version_id>/"version_id": $body.snapshots.0.version_id/]
|
|
// TESTRESPONSE[s/"version": <version>/"version": $body.snapshots.0.version/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.129Z"/"start_time": $body.snapshots.0.start_time/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628850/"start_time_in_millis": $body.snapshots.0.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.129Z"/"end_time": $body.snapshots.0.end_time/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593094752018/"end_time_in_millis": $body.snapshots.0.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
|
|
|
|
The following request returns information for all snapshots with prefix `snapshot` in the `my_repository` repository,
|
|
limiting the response size to 2 and sorting by snapshot name.
|
|
|
|
[source,console]
|
|
----
|
|
GET /_snapshot/my_repository/snapshot*?size=2&sort=name
|
|
----
|
|
|
|
The API returns the following response:
|
|
|
|
[source,console-result]
|
|
----
|
|
{
|
|
"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.129Z",
|
|
"start_time_in_millis": 1593093628850,
|
|
"end_time": "2020-07-06T21:55:18.129Z",
|
|
"end_time_in_millis": 1593094752018,
|
|
"duration_in_millis": 0,
|
|
"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": 1593094752019,
|
|
"duration_in_millis": 1,
|
|
"failures": [],
|
|
"shards": {
|
|
"total": 0,
|
|
"failed": 0,
|
|
"successful": 0
|
|
}
|
|
}
|
|
],
|
|
"next": "c25hcHNob3RfMixteV9yZXBvc2l0b3J5LHNuYXBzaG90XzI=",
|
|
"total": 3,
|
|
"remaining": 1
|
|
}
|
|
----
|
|
// TESTRESPONSE[s/"uuid": "dKb54xw67gvdRctLCxSket"/"uuid": $body.snapshots.0.uuid/]
|
|
// TESTRESPONSE[s/"uuid": "vdRctLCxSketdKb54xw67g"/"uuid": $body.snapshots.1.uuid/]
|
|
// TESTRESPONSE[s/"version_id": <version_id>/"version_id": $body.snapshots.0.version_id/]
|
|
// TESTRESPONSE[s/"version": <version>/"version": $body.snapshots.0.version/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.129Z"/"start_time": $body.snapshots.0.start_time/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.130Z"/"start_time": $body.snapshots.1.start_time/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628850/"start_time_in_millis": $body.snapshots.0.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628851/"start_time_in_millis": $body.snapshots.1.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.129Z"/"end_time": $body.snapshots.0.end_time/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.130Z"/"end_time": $body.snapshots.1.end_time/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593094752018/"end_time_in_millis": $body.snapshots.0.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593094752019/"end_time_in_millis": $body.snapshots.1.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 1/"duration_in_millis": $body.snapshots.1.duration_in_millis/]
|
|
|
|
A subsequent request for the remaining snapshots can then be made using the `next` value from the previous response as `after` parameter.
|
|
|
|
[source,console]
|
|
----
|
|
GET /_snapshot/my_repository/snapshot*?size=2&sort=name&after=c25hcHNob3RfMixteV9yZXBvc2l0b3J5LHNuYXBzaG90XzI=
|
|
----
|
|
|
|
The API returns the following response:
|
|
|
|
[source,console-result]
|
|
----
|
|
{
|
|
"snapshots": [
|
|
{
|
|
"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.129Z",
|
|
"start_time_in_millis": 1593093628850,
|
|
"end_time": "2020-07-06T21:55:18.129Z",
|
|
"end_time_in_millis": 1593094752018,
|
|
"duration_in_millis": 0,
|
|
"failures": [],
|
|
"shards": {
|
|
"total": 0,
|
|
"failed": 0,
|
|
"successful": 0
|
|
}
|
|
}
|
|
],
|
|
"total": 3,
|
|
"remaining": 0
|
|
}
|
|
----
|
|
// TESTRESPONSE[s/"uuid": "dRctdKb54xw67gvLCxSket"/"uuid": $body.snapshots.0.uuid/]
|
|
// TESTRESPONSE[s/"version_id": <version_id>/"version_id": $body.snapshots.0.version_id/]
|
|
// TESTRESPONSE[s/"version": <version>/"version": $body.snapshots.0.version/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.129Z"/"start_time": $body.snapshots.0.start_time/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628850/"start_time_in_millis": $body.snapshots.0.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.129Z"/"end_time": $body.snapshots.0.end_time/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593094752018/"end_time_in_millis": $body.snapshots.0.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
|
|
|
|
Alternatively, the same result could be retrieved by using an offset value of `2` to skip the two snapshot already seen.
|
|
|
|
[source,console]
|
|
----
|
|
GET /_snapshot/my_repository/snapshot*?size=2&sort=name&offset=2
|
|
----
|
|
|
|
The API returns the following response:
|
|
|
|
[source,console-result]
|
|
----
|
|
{
|
|
"snapshots": [
|
|
{
|
|
"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.129Z",
|
|
"start_time_in_millis": 1593093628850,
|
|
"end_time": "2020-07-06T21:55:18.129Z",
|
|
"end_time_in_millis": 1593094752018,
|
|
"duration_in_millis": 0,
|
|
"failures": [],
|
|
"shards": {
|
|
"total": 0,
|
|
"failed": 0,
|
|
"successful": 0
|
|
}
|
|
}
|
|
],
|
|
"total": 3,
|
|
"remaining": 0
|
|
}
|
|
----
|
|
// TESTRESPONSE[s/"uuid": "dRctdKb54xw67gvLCxSket"/"uuid": $body.snapshots.0.uuid/]
|
|
// TESTRESPONSE[s/"version_id": <version_id>/"version_id": $body.snapshots.0.version_id/]
|
|
// TESTRESPONSE[s/"version": <version>/"version": $body.snapshots.0.version/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.129Z"/"start_time": $body.snapshots.0.start_time/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628850/"start_time_in_millis": $body.snapshots.0.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.129Z"/"end_time": $body.snapshots.0.end_time/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593094752018/"end_time_in_millis": $body.snapshots.0.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
|
|
|
|
The following request returns information for all snapshots with prefix `snapshot` in the `my_repository` repository,
|
|
except for the one named `snapshot_3`
|
|
|
|
[source,console]
|
|
----
|
|
GET /_snapshot/my_repository/snapshot*,-snapshot_3?sort=name
|
|
----
|
|
|
|
The API returns the following response:
|
|
|
|
[source,console-result]
|
|
----
|
|
{
|
|
"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.129Z",
|
|
"start_time_in_millis": 1593093628850,
|
|
"end_time": "2020-07-06T21:55:18.129Z",
|
|
"end_time_in_millis": 1593094752018,
|
|
"duration_in_millis": 0,
|
|
"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": 1593094752019,
|
|
"duration_in_millis": 1,
|
|
"failures": [],
|
|
"shards": {
|
|
"total": 0,
|
|
"failed": 0,
|
|
"successful": 0
|
|
}
|
|
}
|
|
],
|
|
"total": 2,
|
|
"remaining": 0
|
|
}
|
|
----
|
|
// TESTRESPONSE[s/"uuid": "dKb54xw67gvdRctLCxSket"/"uuid": $body.snapshots.0.uuid/]
|
|
// TESTRESPONSE[s/"uuid": "vdRctLCxSketdKb54xw67g"/"uuid": $body.snapshots.1.uuid/]
|
|
// TESTRESPONSE[s/"version_id": <version_id>/"version_id": $body.snapshots.0.version_id/]
|
|
// TESTRESPONSE[s/"version": <version>/"version": $body.snapshots.0.version/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.129Z"/"start_time": $body.snapshots.0.start_time/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.130Z"/"start_time": $body.snapshots.1.start_time/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628850/"start_time_in_millis": $body.snapshots.0.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628851/"start_time_in_millis": $body.snapshots.1.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.129Z"/"end_time": $body.snapshots.0.end_time/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.130Z"/"end_time": $body.snapshots.1.end_time/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593094752018/"end_time_in_millis": $body.snapshots.0.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593094752019/"end_time_in_millis": $body.snapshots.1.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 1/"duration_in_millis": $body.snapshots.1.duration_in_millis/]
|
|
|
|
|
|
The following request returns information for all snapshots that come after `snapshot_2` when sorted by snapshot name in the default
|
|
ascending order.
|
|
|
|
[source,console]
|
|
----
|
|
GET /_snapshot/my_repository/*?sort=name&from_sort_value=snapshot_2
|
|
----
|
|
|
|
The API returns the following response:
|
|
|
|
[source,console-result]
|
|
----
|
|
{
|
|
"snapshots": [
|
|
{
|
|
"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": 1593094752019,
|
|
"duration_in_millis": 1,
|
|
"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.129Z",
|
|
"start_time_in_millis": 1593093628850,
|
|
"end_time": "2020-07-06T21:55:18.129Z",
|
|
"end_time_in_millis": 1593094752018,
|
|
"duration_in_millis": 0,
|
|
"failures": [],
|
|
"shards": {
|
|
"total": 0,
|
|
"failed": 0,
|
|
"successful": 0
|
|
}
|
|
}
|
|
],
|
|
"total": 2,
|
|
"remaining": 0
|
|
}
|
|
----
|
|
// TESTRESPONSE[s/"uuid": "vdRctLCxSketdKb54xw67g"/"uuid": $body.snapshots.0.uuid/]
|
|
// TESTRESPONSE[s/"uuid": "dRctdKb54xw67gvLCxSket"/"uuid": $body.snapshots.1.uuid/]
|
|
// TESTRESPONSE[s/"version_id": <version_id>/"version_id": $body.snapshots.0.version_id/]
|
|
// TESTRESPONSE[s/"version": <version>/"version": $body.snapshots.0.version/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.130Z"/"start_time": $body.snapshots.0.start_time/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.129Z"/"start_time": $body.snapshots.1.start_time/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628851/"start_time_in_millis": $body.snapshots.0.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628850/"start_time_in_millis": $body.snapshots.1.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.130Z"/"end_time": $body.snapshots.0.end_time/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.129Z"/"end_time": $body.snapshots.1.end_time/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593094752019/"end_time_in_millis": $body.snapshots.0.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593094752018/"end_time_in_millis": $body.snapshots.1.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 1/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.1.duration_in_millis/]
|
|
|
|
|
|
The following request returns 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.
|
|
|
|
[source,console]
|
|
----
|
|
GET /_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000
|
|
----
|
|
|
|
The API returns the following response:
|
|
|
|
[source,console-result]
|
|
----
|
|
{
|
|
"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
|
|
}
|
|
----
|
|
// TESTRESPONSE[s/"uuid": "dKb54xw67gvdRctLCxSket"/"uuid": $body.snapshots.0.uuid/]
|
|
// TESTRESPONSE[s/"uuid": "vdRctLCxSketdKb54xw67g"/"uuid": $body.snapshots.1.uuid/]
|
|
// TESTRESPONSE[s/"uuid": "dRctdKb54xw67gvLCxSket"/"uuid": $body.snapshots.2.uuid/]
|
|
// TESTRESPONSE[s/"version_id": <version_id>/"version_id": $body.snapshots.0.version_id/]
|
|
// TESTRESPONSE[s/"version": <version>/"version": $body.snapshots.0.version/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.128Z"/"start_time": $body.snapshots.0.start_time/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.130Z"/"start_time": $body.snapshots.1.start_time/]
|
|
// TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.131Z"/"start_time": $body.snapshots.2.start_time/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628849/"start_time_in_millis": $body.snapshots.0.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628851/"start_time_in_millis": $body.snapshots.1.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"start_time_in_millis": 1593093628852/"start_time_in_millis": $body.snapshots.2.start_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.129Z"/"end_time": $body.snapshots.0.end_time/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.130Z"/"end_time": $body.snapshots.1.end_time/]
|
|
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.135Z"/"end_time": $body.snapshots.2.end_time/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593093628850/"end_time_in_millis": $body.snapshots.0.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593093628851/"end_time_in_millis": $body.snapshots.1.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"end_time_in_millis": 1593093628856/"end_time_in_millis": $body.snapshots.2.end_time_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 1/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.1.duration_in_millis/]
|
|
// TESTRESPONSE[s/"duration_in_millis": 4/"duration_in_millis": $body.snapshots.2.duration_in_millis/]
|