From 98bffbc9862bd1177faa67ac9a22b3b45343fe8d Mon Sep 17 00:00:00 2001 From: Luke Whiting Date: Tue, 28 Oct 2025 17:34:51 +0000 Subject: [PATCH] Add new params to cat segments API (#5554) Co-authored-by: Quentin Pradet (cherry picked from commit fc462cc7d32a6c1313478d7f53500457284d027b) --- output/openapi/elasticsearch-openapi.json | 80 +++++++++++++++++++ output/schema/schema.json | 67 +++++++++++++++- output/typescript/types.ts | 5 ++ .../cat/segments/CatSegmentsRequest.ts | 32 +++++++- 4 files changed, 182 insertions(+), 2 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 2e8cecad7c..9bab23ce66 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -2526,6 +2526,21 @@ }, { "$ref": "#/components/parameters/cat.segments-master_timeout" + }, + { + "$ref": "#/components/parameters/cat.segments-expand_wildcards" + }, + { + "$ref": "#/components/parameters/cat.segments-allow_no_indices" + }, + { + "$ref": "#/components/parameters/cat.segments-ignore_throttled" + }, + { + "$ref": "#/components/parameters/cat.segments-ignore_unavailable" + }, + { + "$ref": "#/components/parameters/cat.segments-allow_closed" } ], "responses": { @@ -2565,6 +2580,21 @@ }, { "$ref": "#/components/parameters/cat.segments-master_timeout" + }, + { + "$ref": "#/components/parameters/cat.segments-expand_wildcards" + }, + { + "$ref": "#/components/parameters/cat.segments-allow_no_indices" + }, + { + "$ref": "#/components/parameters/cat.segments-ignore_throttled" + }, + { + "$ref": "#/components/parameters/cat.segments-ignore_unavailable" + }, + { + "$ref": "#/components/parameters/cat.segments-allow_closed" } ], "responses": { @@ -136579,6 +136609,56 @@ }, "style": "form" }, + "cat.segments-expand_wildcards": { + "in": "query", + "name": "expand_wildcards", + "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.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.ExpandWildcards" + }, + "style": "form" + }, + "cat.segments-allow_no_indices": { + "in": "query", + "name": "allow_no_indices", + "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.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + "cat.segments-ignore_throttled": { + "in": "query", + "name": "ignore_throttled", + "description": "If true, concrete, expanded or aliased indices are ignored when frozen.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + "cat.segments-ignore_unavailable": { + "in": "query", + "name": "ignore_unavailable", + "description": "If true, missing or closed indices are not included in the response.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + "cat.segments-allow_closed": { + "in": "query", + "name": "allow_closed", + "description": "If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour\nof throwing an exception if index pattern matches closed indices", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, "cat.shards-index": { "in": "path", "name": "index", diff --git a/output/schema/schema.json b/output/schema/schema.json index 9b12497fb5..a726479b68 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -115463,9 +115463,74 @@ "namespace": "_types" } } + }, + { + "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", + "type": { + "kind": "instance_of", + "type": { + "name": "ExpandWildcards", + "namespace": "_types" + } + } + }, + { + "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, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "If true, concrete, expanded or aliased indices are ignored when frozen.", + "name": "ignore_throttled", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "If true, missing or closed indices are not included in the response.", + "name": "ignore_unavailable", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour\nof throwing an exception if index pattern matches closed indices", + "name": "allow_closed", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "cat/segments/CatSegmentsRequest.ts#L24-L83" + "specLocation": "cat/segments/CatSegmentsRequest.ts#L24-L113" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 6cb9ff758f..673e5ad4c8 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -8671,6 +8671,11 @@ export interface CatSegmentsRequest extends CatCatRequestBase { s?: Names local?: boolean master_timeout?: Duration + expand_wildcards?: ExpandWildcards + allow_no_indices?: boolean + ignore_throttled?: boolean + ignore_unavailable?: boolean + allow_closed?: boolean } export type CatSegmentsResponse = CatSegmentsSegmentsRecord[] diff --git a/specification/cat/segments/CatSegmentsRequest.ts b/specification/cat/segments/CatSegmentsRequest.ts index d8d18f0858..c19964b21e 100644 --- a/specification/cat/segments/CatSegmentsRequest.ts +++ b/specification/cat/segments/CatSegmentsRequest.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Indices, Names } from '@_types/common' +import { ExpandWildcards, Indices, Names } from '@_types/common' import { Duration } from '@_types/Time' import { CatRequestBase, CatSegmentsColumns } from '@cat/_types/CatBase' @@ -79,5 +79,35 @@ export interface Request extends CatRequestBase { * @server_default 30s */ master_timeout?: Duration + /** + * 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 + /** + * 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 + /** + * If true, concrete, expanded or aliased indices are ignored when frozen. + * @server_default false + */ + ignore_throttled?: boolean + /** + * If true, missing or closed indices are not included in the response. + * @server_default false + */ + ignore_unavailable?: boolean + /** + * If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour + * of throwing an exception if index pattern matches closed indices + * @server_default false + */ + allow_closed?: boolean } }