@@ -60,14 +60,15 @@ Use the get snapshot API to return information about one or more snapshots, incl
60
60
`<repository>`::
61
61
(Required, string)
62
62
Comma-separated list of snapshot repository names used to limit the request.
63
- Wildcard (`*`) expressions are supported.
63
+ Wildcard (`*`) expressions are supported including combining wildcards with exclude patterns starting with `-` .
64
64
+
65
65
To get information about all snapshot repositories registered in the
66
66
cluster, omit this parameter or use `*` or `_all`.
67
67
68
68
`<snapshot>`::
69
69
(Required, string)
70
- Comma-separated list of snapshot names to retrieve. Also accepts wildcards (`*`).
70
+ Comma-separated list of snapshot names to retrieve.
71
+ Wildcard (`*`) expressions are supported including combining wildcards with exclude patterns starting with `-`.
71
72
+
72
73
* To get information about all snapshots in a registered repository, use a wildcard (`*`) or `_all`.
73
74
* To get information about any snapshots that are currently running, use `_current`.
@@ -151,8 +152,8 @@ exclusive with using the `after` parameter. Defaults to `0`.
151
152
`slm_policy_filter`::
152
153
(Optional, string)
153
154
Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Also accepts wildcards (`\*`) and combinations
154
- of wildcards followed by exclude patterns starting in `-`. For example, the pattern `*,-policy-a-\*` will return all snapshots except
155
- for those that were created by an SLM policy with a name starting in `policy-a-`. Note that the wildcard pattern `*` matches all snapshots
155
+ of wildcards followed by exclude patterns starting with `-`. For example, the pattern `*,-policy-a-\*` will return all snapshots except
156
+ for those that were created by an SLM policy with a name starting with `policy-a-`. Note that the wildcard pattern `*` matches all snapshots
156
157
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
157
158
policy you can use the special pattern `_none` that will match all snapshots without an SLM policy.
158
159
@@ -546,4 +547,84 @@ The API returns the following response:
546
547
// TESTRESPONSE[s/"start_time_in_millis": 1593093628850/"start_time_in_millis": $body.snapshots.0.start_time_in_millis/]
547
548
// TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.129Z"/"end_time": $body.snapshots.0.end_time/]
548
549
// TESTRESPONSE[s/"end_time_in_millis": 1593094752018/"end_time_in_millis": $body.snapshots.0.end_time_in_millis/]
549
- // TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
550
+ // TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
551
+
552
+ The following request returns information for all snapshots with prefix `snapshot` in the `my_repository` repository,
553
+ except for the one named `snapshot_3`
554
+
555
+ [source,console]
556
+ ----
557
+ GET /_snapshot/my_repository/snapshot*,-snapshot_3?sort=name
558
+ ----
559
+
560
+ The API returns the following response:
561
+
562
+ [source,console-result]
563
+ ----
564
+ {
565
+ "snapshots": [
566
+ {
567
+ "snapshot": "snapshot_1",
568
+ "uuid": "dKb54xw67gvdRctLCxSket",
569
+ "repository": "my_repository",
570
+ "version_id": <version_id>,
571
+ "version": <version>,
572
+ "indices": [],
573
+ "data_streams": [],
574
+ "feature_states": [],
575
+ "include_global_state": true,
576
+ "state": "SUCCESS",
577
+ "start_time": "2020-07-06T21:55:18.129Z",
578
+ "start_time_in_millis": 1593093628850,
579
+ "end_time": "2020-07-06T21:55:18.129Z",
580
+ "end_time_in_millis": 1593094752018,
581
+ "duration_in_millis": 0,
582
+ "failures": [],
583
+ "shards": {
584
+ "total": 0,
585
+ "failed": 0,
586
+ "successful": 0
587
+ }
588
+ },
589
+ {
590
+ "snapshot": "snapshot_2",
591
+ "uuid": "vdRctLCxSketdKb54xw67g",
592
+ "repository": "my_repository",
593
+ "version_id": <version_id>,
594
+ "version": <version>,
595
+ "indices": [],
596
+ "data_streams": [],
597
+ "feature_states": [],
598
+ "include_global_state": true,
599
+ "state": "SUCCESS",
600
+ "start_time": "2020-07-06T21:55:18.130Z",
601
+ "start_time_in_millis": 1593093628851,
602
+ "end_time": "2020-07-06T21:55:18.130Z",
603
+ "end_time_in_millis": 1593094752019,
604
+ "duration_in_millis": 1,
605
+ "failures": [],
606
+ "shards": {
607
+ "total": 0,
608
+ "failed": 0,
609
+ "successful": 0
610
+ },
611
+ }
612
+ ],
613
+ "total": 2,
614
+ "remaining": 0
615
+ }
616
+ ----
617
+ // TESTRESPONSE[s/"uuid": "dKb54xw67gvdRctLCxSket"/"uuid": $body.snapshots.0.uuid/]
618
+ // TESTRESPONSE[s/"uuid": "vdRctLCxSketdKb54xw67g"/"uuid": $body.snapshots.1.uuid/]
619
+ // TESTRESPONSE[s/"version_id": <version_id>/"version_id": $body.snapshots.0.version_id/]
620
+ // TESTRESPONSE[s/"version": <version>/"version": $body.snapshots.0.version/]
621
+ // TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.129Z"/"start_time": $body.snapshots.0.start_time/]
622
+ // TESTRESPONSE[s/"start_time": "2020-07-06T21:55:18.130Z"/"start_time": $body.snapshots.1.start_time/]
623
+ // TESTRESPONSE[s/"start_time_in_millis": 1593093628850/"start_time_in_millis": $body.snapshots.0.start_time_in_millis/]
624
+ // TESTRESPONSE[s/"start_time_in_millis": 1593093628851/"start_time_in_millis": $body.snapshots.1.start_time_in_millis/]
625
+ // TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.129Z"/"end_time": $body.snapshots.0.end_time/]
626
+ // TESTRESPONSE[s/"end_time": "2020-07-06T21:55:18.130Z"/"end_time": $body.snapshots.1.end_time/]
627
+ // TESTRESPONSE[s/"end_time_in_millis": 1593094752018/"end_time_in_millis": $body.snapshots.0.end_time_in_millis/]
628
+ // TESTRESPONSE[s/"end_time_in_millis": 1593094752019/"end_time_in_millis": $body.snapshots.1.end_time_in_millis/]
629
+ // TESTRESPONSE[s/"duration_in_millis": 0/"duration_in_millis": $body.snapshots.0.duration_in_millis/]
630
+ // TESTRESPONSE[s/"duration_in_millis": 1/"duration_in_millis": $body.snapshots.1.duration_in_millis/]
0 commit comments