From 8bc6f4447a6a87de4299b3ca8ec4b3d41baf2380 Mon Sep 17 00:00:00 2001 From: philkra Date: Tue, 22 Mar 2022 14:12:14 +0100 Subject: [PATCH 1/4] Add features property to indices.get --- output/schema/schema.json | 79 +++++++++++++++++-- output/schema/validation-errors.json | 1 - output/typescript/types.ts | 5 ++ .../indices/get/IndicesGetRequest.ts | 33 +++++++- 4 files changed, 109 insertions(+), 9 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index a82fc04aa4..b2d55c779d 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -4291,6 +4291,12 @@ "description": "Returns information about one or more indices.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html", "name": "indices.get", + "privileges": { + "index": [ + "view_index_metadata", + "manage" + ] + }, "request": { "name": "Request", "namespace": "indices.get" @@ -103686,6 +103692,55 @@ }, "specLocation": "indices/forcemerge/IndicesForceMergeResponse.ts#L22-L24" }, + { + "kind": "enum", + "members": [ + { + "name": "aliases" + }, + { + "name": "mappings" + }, + { + "name": "settings" + } + ], + "name": { + "name": "Feature", + "namespace": "indices.get" + }, + "specLocation": "indices/get/IndicesGetRequest.ts#L89-L93" + }, + { + "kind": "type_alias", + "name": { + "name": "Features", + "namespace": "indices.get" + }, + "specLocation": "indices/get/IndicesGetRequest.ts#L94-L94", + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "Feature", + "namespace": "indices.get" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Feature", + "namespace": "indices.get" + } + } + } + ], + "kind": "union_of" + } + }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -103693,7 +103748,7 @@ "body": { "kind": "no_body" }, - "description": "Returns information about one or more indices.", + "description": "Returns information about one or more indices. For data streams, the API returns information about the\nstream’s backing indices.", "inherits": { "type": { "name": "RequestBase", @@ -103707,7 +103762,7 @@ }, "path": [ { - "description": "Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported.", + "description": "Comma-separated list of data streams, indices, and index aliases used to limit the request.\nWildcard expressions (*) are supported.", "name": "index", "required": true, "type": { @@ -103721,7 +103776,7 @@ ], "query": [ { - "description": "Ignore if a wildcard expression resolves to no concrete indices (default: false)", + "description": "If false, the request returns an error if any wildcard expression, index alias, or _all value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.", "name": "allow_no_indices", "required": false, "serverDefault": true, @@ -103734,7 +103789,7 @@ } }, { - "description": "Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.", + "description": "Type of index that wildcard expressions can match. If the request can target data streams, this argument\ndetermines whether wildcard expressions match hidden data streams. Supports comma-separated values,\nsuch as open,hidden.", "name": "expand_wildcards", "required": false, "serverDefault": "open", @@ -103810,9 +103865,23 @@ "namespace": "_types" } } + }, + { + "description": "Return only information on specified index features", + "name": "features", + "required": false, + "serverDefault": "[aliases, mappings, settings]", + "since": "8.1.0", + "type": { + "kind": "instance_of", + "type": { + "name": "Features", + "namespace": "indices.get" + } + } } ], - "specLocation": "indices/get/IndicesGetRequest.ts#L24-L68" + "specLocation": "indices/get/IndicesGetRequest.ts#L24-L87" }, { "body": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 455c06ccc8..c016779ca4 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1059,7 +1059,6 @@ }, "indices.get": { "request": [ - "Request: missing json spec query parameter 'features'", "Request: should not have a body" ], "response": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3e9a2fc515..4ebf56e6ff 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9959,6 +9959,10 @@ export interface IndicesForcemergeRequest extends RequestBase { export type IndicesForcemergeResponse = ShardsOperationResponseBase +export type IndicesGetFeature = 'aliases' | 'mappings' | 'settings' + +export type IndicesGetFeatures = IndicesGetFeature | IndicesGetFeature[] + export interface IndicesGetRequest extends RequestBase { index: Indices allow_no_indices?: boolean @@ -9968,6 +9972,7 @@ export interface IndicesGetRequest extends RequestBase { include_defaults?: boolean local?: boolean master_timeout?: Time + features?: IndicesGetFeatures } export type IndicesGetResponse = Record diff --git a/specification/indices/get/IndicesGetRequest.ts b/specification/indices/get/IndicesGetRequest.ts index c285c92c91..cc2ecd78a4 100644 --- a/specification/indices/get/IndicesGetRequest.ts +++ b/specification/indices/get/IndicesGetRequest.ts @@ -22,20 +22,33 @@ import { ExpandWildcards, Indices } from '@_types/common' import { Time } from '@_types/Time' /** + * Returns information about one or more indices. For data streams, the API returns information about the + * stream’s backing indices. * @rest_spec_name indices.get * @since 0.0.0 * @stability stable + * @index_privileges view_index_metadata, manage */ export interface Request extends RequestBase { path_parts: { - /** Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. */ + /** + * Comma-separated list of data streams, indices, and index aliases used to limit the request. + * Wildcard expressions (*) are supported. + */ index: Indices } query_parameters: { - /** @server_default true */ + /** + * If false, the request returns an error if any wildcard expression, index alias, or _all value targets only + * missing or closed indices. This behavior applies even if the request targets other open indices. For example, + * a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. + * @server_default true + */ allow_no_indices?: boolean /** - * Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. + * Type of index that wildcard expressions can match. If the request can target data streams, this argument + * determines whether wildcard expressions match hidden data streams. Supports comma-separated values, + * such as open,hidden. * @server_default open */ expand_wildcards?: ExpandWildcards @@ -64,5 +77,19 @@ export interface Request extends RequestBase { * @server_default 30s */ master_timeout?: Time + /** + * Return only information on specified index features + * @server_default [aliases, mappings, settings] + * @since 8.1.0 + */ + features?: Features } } + +export enum Feature { + 'aliases', + 'mappings', + 'settings' +} +export type Features = Feature | Feature[] + From 08753085c73fa6c3641c3351969925e9a878e184 Mon Sep 17 00:00:00 2001 From: philkra Date: Tue, 22 Mar 2022 14:14:59 +0100 Subject: [PATCH 2/4] linter linter linter --- specification/indices/get/IndicesGetRequest.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/indices/get/IndicesGetRequest.ts b/specification/indices/get/IndicesGetRequest.ts index cc2ecd78a4..21f94bf629 100644 --- a/specification/indices/get/IndicesGetRequest.ts +++ b/specification/indices/get/IndicesGetRequest.ts @@ -92,4 +92,3 @@ export enum Feature { 'settings' } export type Features = Feature | Feature[] - From 8077f60d9a9e47a904393d883a9fdcd483e7f6e4 Mon Sep 17 00:00:00 2001 From: Philip Krauss <35487337+philkra@users.noreply.github.com> Date: Tue, 22 Mar 2022 14:23:02 +0100 Subject: [PATCH 3/4] Update specification/indices/get/IndicesGetRequest.ts Co-authored-by: Tomas Della Vedova --- specification/indices/get/IndicesGetRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/indices/get/IndicesGetRequest.ts b/specification/indices/get/IndicesGetRequest.ts index 21f94bf629..2fa67dcc72 100644 --- a/specification/indices/get/IndicesGetRequest.ts +++ b/specification/indices/get/IndicesGetRequest.ts @@ -79,7 +79,7 @@ export interface Request extends RequestBase { master_timeout?: Time /** * Return only information on specified index features - * @server_default [aliases, mappings, settings] + * @server_default ['aliases', 'mappings', 'settings'] * @since 8.1.0 */ features?: Features From 03765cc88359d1d2ed2d7a290325621bd059389d Mon Sep 17 00:00:00 2001 From: philkra Date: Tue, 22 Mar 2022 14:29:41 +0100 Subject: [PATCH 4/4] fresh output --- output/schema/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index b2d55c779d..fe36c0b1f6 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -103870,7 +103870,7 @@ "description": "Return only information on specified index features", "name": "features", "required": false, - "serverDefault": "[aliases, mappings, settings]", + "serverDefault": "['aliases', 'mappings', 'settings']", "since": "8.1.0", "type": { "kind": "instance_of",