diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 273e2b1144..9b11b62f4e 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -39606,6 +39606,26 @@ }, "style": "form" }, + { + "in": "query", + "name": "state", + "description": "Only return snapshots with a state found in the given comma-separated list of snapshot states.\nThe default is all snapshot states.", + "deprecated": false, + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/snapshot._types.SnapshotState" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/snapshot._types.SnapshotState" + } + } + ] + }, + "style": "form" + }, { "in": "query", "name": "verbose", @@ -98932,6 +98952,16 @@ "failed_shard_count" ] }, + "snapshot._types.SnapshotState": { + "type": "string", + "enum": [ + "IN_PROGRESS", + "SUCCESS", + "FAILED", + "PARTIAL", + "INCOMPATIBLE" + ] + }, "snapshot.get.SnapshotResponseItem": { "type": "object", "properties": { diff --git a/output/schema/schema.json b/output/schema/schema.json index a285952546..32c57b0d7a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -243637,6 +243637,36 @@ }, "specLocation": "snapshot/_types/SnapshotInfo.ts#L73-L93" }, + { + "kind": "enum", + "members": [ + { + "description": "The snapshot process has started.", + "name": "IN_PROGRESS" + }, + { + "description": "The snapshot process completed successfully.", + "name": "SUCCESS" + }, + { + "description": "The snapshot failed.", + "name": "FAILED" + }, + { + "description": "The snapshot was partially successful.", + "name": "PARTIAL" + }, + { + "description": "The snapshot is incompatible with the current version of the cluster.", + "name": "INCOMPATIBLE" + } + ], + "name": { + "name": "SnapshotState", + "namespace": "snapshot._types" + }, + "specLocation": "snapshot/_types/SnapshotState.ts#L20-L31" + }, { "kind": "interface", "name": { @@ -245286,6 +245316,39 @@ } } }, + { + "availability": { + "serverless": {}, + "stack": { + "since": "9.1.0" + } + }, + "description": "Only return snapshots with a state found in the given comma-separated list of snapshot states.\nThe default is all snapshot states.", + "name": "state", + "required": false, + "type": { + "kind": "union_of", + "items": [ + { + "kind": "instance_of", + "type": { + "name": "SnapshotState", + "namespace": "snapshot._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "SnapshotState", + "namespace": "snapshot._types" + } + } + } + ] + } + }, { "description": "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.\n\nNOTE: The parameters `size`, `order`, `after`, `from_sort_value`, `offset`, `slm_policy_filter`, and `sort` are not supported when you set `verbose=false` and the sort order for requests with `verbose=false` is undefined.", "name": "verbose", @@ -245300,7 +245363,7 @@ } } ], - "specLocation": "snapshot/get/SnapshotGetRequest.ts#L27-L158" + "specLocation": "snapshot/get/SnapshotGetRequest.ts#L28-L166" }, { "kind": "response", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index c08c05427d..31a0442e64 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -119,12 +119,6 @@ ], "response": [] }, - "snapshot.get": { - "request": [ - "Request: missing json spec query parameter 'state'" - ], - "response": [] - }, "snapshot.repository_analyze": { "request": [ "Request: query parameter 'register_operation_count' does not exist in the json spec" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 78457c7139..5b48b57bb7 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -21009,6 +21009,8 @@ export interface SnapshotSnapshotShardsStatus { export type SnapshotSnapshotSort = 'start_time' | 'duration' | 'name' | 'index_count' | 'repository' | 'shard_count' | 'failed_shard_count' +export type SnapshotSnapshotState = 'IN_PROGRESS' | 'SUCCESS' | 'FAILED' | 'PARTIAL' | 'INCOMPATIBLE' + export interface SnapshotSnapshotStats { incremental: SnapshotFileCountSnapshotStats start_time_in_millis: EpochTime @@ -21129,6 +21131,7 @@ export interface SnapshotGetRequest extends RequestBase { size?: integer slm_policy_filter?: Name sort?: SnapshotSnapshotSort + state?: SnapshotSnapshotState | SnapshotSnapshotState[] verbose?: boolean } diff --git a/specification/snapshot/_types/SnapshotState.ts b/specification/snapshot/_types/SnapshotState.ts new file mode 100644 index 0000000000..71373df66e --- /dev/null +++ b/specification/snapshot/_types/SnapshotState.ts @@ -0,0 +1,31 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export enum SnapshotState { + /** The snapshot process has started. */ + IN_PROGRESS, + /** The snapshot process completed successfully. */ + SUCCESS, + /** The snapshot failed. */ + FAILED, + /** The snapshot was partially successful. */ + PARTIAL, + /** The snapshot is incompatible with the current version of the cluster. */ + INCOMPATIBLE +} diff --git a/specification/snapshot/get/SnapshotGetRequest.ts b/specification/snapshot/get/SnapshotGetRequest.ts index 69875f92b6..e509a5e666 100644 --- a/specification/snapshot/get/SnapshotGetRequest.ts +++ b/specification/snapshot/get/SnapshotGetRequest.ts @@ -23,6 +23,7 @@ import { integer } from '@_types/Numeric' import { SortOrder } from '@_types/sort' import { Duration } from '@_types/Time' import { SnapshotSort } from '@snapshot/_types/SnapshotInfo' +import { SnapshotState } from '@snapshot/_types/SnapshotState' /** * Get snapshot information. @@ -147,6 +148,13 @@ export interface Request extends RequestBase { * @availability serverless */ sort?: SnapshotSort + /** + * Only return snapshots with a state found in the given comma-separated list of snapshot states. + * The default is all snapshot states. + * @availability stack since=9.1.0 + * @availability serverless + */ + state?: SnapshotState | SnapshotState[] /** * 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. *