Skip to content

Commit 07be12f

Browse files
Add documentation for GET snapshots state query parameter. (#4597)
* Add GET snapshots state query parameter. Adds documentation for the SnapshotState enum and state query parameter added in elasticsearch PR #128635. * Allow SnapshotState or SnapshotState[] * Regenerate output for updated SnapshotState definition
1 parent e2eb519 commit 07be12f

File tree

6 files changed

+136
-7
lines changed

6 files changed

+136
-7
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 64 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,6 @@
119119
],
120120
"response": []
121121
},
122-
"snapshot.get": {
123-
"request": [
124-
"Request: missing json spec query parameter 'state'"
125-
],
126-
"response": []
127-
},
128122
"snapshot.repository_analyze": {
129123
"request": [
130124
"Request: query parameter 'register_operation_count' does not exist in the json spec"

output/typescript/types.ts

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export enum SnapshotState {
21+
/** The snapshot process has started. */
22+
IN_PROGRESS,
23+
/** The snapshot process completed successfully. */
24+
SUCCESS,
25+
/** The snapshot failed. */
26+
FAILED,
27+
/** The snapshot was partially successful. */
28+
PARTIAL,
29+
/** The snapshot is incompatible with the current version of the cluster. */
30+
INCOMPATIBLE
31+
}

specification/snapshot/get/SnapshotGetRequest.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { integer } from '@_types/Numeric'
2323
import { SortOrder } from '@_types/sort'
2424
import { Duration } from '@_types/Time'
2525
import { SnapshotSort } from '@snapshot/_types/SnapshotInfo'
26+
import { SnapshotState } from '@snapshot/_types/SnapshotState'
2627

2728
/**
2829
* Get snapshot information.
@@ -147,6 +148,13 @@ export interface Request extends RequestBase {
147148
* @availability serverless
148149
*/
149150
sort?: SnapshotSort
151+
/**
152+
* Only return snapshots with a state found in the given comma-separated list of snapshot states.
153+
* The default is all snapshot states.
154+
* @availability stack since=9.1.0
155+
* @availability serverless
156+
*/
157+
state?: SnapshotState | SnapshotState[]
150158
/**
151159
* 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.
152160
*

0 commit comments

Comments
 (0)