From 1361a9ae45dfcc8f7e9e210788dcdb7345003bdf Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Thu, 26 Jun 2025 12:37:45 +0200 Subject: [PATCH] backport esql changes --- output/openapi/elasticsearch-openapi.json | 205 ++++++- .../elasticsearch-serverless-openapi.json | 178 +++++- output/schema/schema.json | 511 +++++++++++++++++- output/schema/validation-errors.json | 3 +- output/typescript/types.ts | 64 ++- specification/_types/Binary.ts | 3 - specification/esql/_types/EsqlResult.ts | 93 ++++ .../esql/async_query/AsyncQueryResponse.ts | 2 +- .../async_query_get/AsyncQueryGetResponse.ts | 4 +- .../AsyncQueryStopResponse.ts | 2 +- specification/esql/query/QueryResponse.ts | 2 +- 11 files changed, 1022 insertions(+), 45 deletions(-) create mode 100644 specification/esql/_types/EsqlResult.ts diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 9f62551331..c6525ac2d6 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -9625,7 +9625,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/_types.EsqlResult" + "$ref": "#/components/schemas/esql._types.EsqlResult" } } } @@ -9704,7 +9704,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/_types.EsqlResult" + "$ref": "#/components/schemas/esql._types.AsyncEsqlResult" } } } @@ -9790,7 +9790,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/_types.EsqlResult" + "$ref": "#/components/schemas/esql._types.EsqlResult" } } } @@ -9918,7 +9918,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/_types.EsqlResult" + "$ref": "#/components/schemas/esql._types.EsqlResult" } } } @@ -74860,8 +74860,201 @@ } ] }, - "_types.EsqlResult": { - "type": "object" + "esql._types.EsqlResult": { + "type": "object", + "properties": { + "took": { + "$ref": "#/components/schemas/_types.DurationValueUnitMillis" + }, + "is_partial": { + "type": "boolean" + }, + "all_columns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/esql._types.ColumnInfo" + } + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/esql._types.ColumnInfo" + } + }, + "values": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/_types.FieldValue" + } + } + }, + "_clusters": { + "$ref": "#/components/schemas/esql._types.ClusterInfo" + }, + "profile": { + "description": "Profiling information. Present if `profile` was `true` in the request.\nThe contents of this field are currently unstable.", + "type": "object" + } + }, + "required": [ + "columns", + "values" + ] + }, + "esql._types.ColumnInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "name", + "type" + ] + }, + "esql._types.ClusterInfo": { + "type": "object", + "properties": { + "total": { + "type": "number" + }, + "successful": { + "type": "number" + }, + "running": { + "type": "number" + }, + "skipped": { + "type": "number" + }, + "partial": { + "type": "number" + }, + "failed": { + "type": "number" + }, + "details": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/esql._types.EsqlClusterDetails" + } + } + }, + "required": [ + "total", + "successful", + "running", + "skipped", + "partial", + "failed", + "details" + ] + }, + "esql._types.EsqlClusterDetails": { + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/esql._types.EsqlClusterStatus" + }, + "indices": { + "type": "string" + }, + "took": { + "$ref": "#/components/schemas/_types.DurationValueUnitMillis" + }, + "_shards": { + "$ref": "#/components/schemas/esql._types.EsqlShardInfo" + } + }, + "required": [ + "status", + "indices" + ] + }, + "esql._types.EsqlClusterStatus": { + "type": "string", + "enum": [ + "running", + "successful", + "partial", + "skipped", + "failed" + ] + }, + "esql._types.EsqlShardInfo": { + "type": "object", + "properties": { + "total": { + "type": "number" + }, + "successful": { + "type": "number" + }, + "skipped": { + "type": "number" + }, + "failed": { + "type": "number" + }, + "failures": { + "type": "array", + "items": { + "$ref": "#/components/schemas/esql._types.EsqlShardFailure" + } + } + }, + "required": [ + "total" + ] + }, + "esql._types.EsqlShardFailure": { + "type": "object", + "properties": { + "shard": { + "$ref": "#/components/schemas/_types.Id" + }, + "index": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "node": { + "$ref": "#/components/schemas/_types.NodeId" + }, + "reason": { + "$ref": "#/components/schemas/_types.ErrorCause" + } + }, + "required": [ + "shard", + "index", + "reason" + ] + }, + "esql._types.AsyncEsqlResult": { + "allOf": [ + { + "$ref": "#/components/schemas/esql._types.EsqlResult" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "is_running": { + "type": "boolean" + } + }, + "required": [ + "is_running" + ] + } + ] }, "_types.InlineGet": { "type": "object", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 8cbd3c1734..13cd9d95a5 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -5673,7 +5673,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/_types.EsqlResult" + "$ref": "#/components/schemas/esql._types.EsqlResult" } } } @@ -49026,8 +49026,180 @@ } ] }, - "_types.EsqlResult": { - "type": "object" + "esql._types.EsqlResult": { + "type": "object", + "properties": { + "took": { + "$ref": "#/components/schemas/_types.DurationValueUnitMillis" + }, + "is_partial": { + "type": "boolean" + }, + "all_columns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/esql._types.ColumnInfo" + } + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/esql._types.ColumnInfo" + } + }, + "values": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/_types.FieldValue" + } + } + }, + "_clusters": { + "$ref": "#/components/schemas/esql._types.ClusterInfo" + }, + "profile": { + "description": "Profiling information. Present if `profile` was `true` in the request.\nThe contents of this field are currently unstable.", + "type": "object" + } + }, + "required": [ + "columns", + "values" + ] + }, + "esql._types.ColumnInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "name", + "type" + ] + }, + "esql._types.ClusterInfo": { + "type": "object", + "properties": { + "total": { + "type": "number" + }, + "successful": { + "type": "number" + }, + "running": { + "type": "number" + }, + "skipped": { + "type": "number" + }, + "partial": { + "type": "number" + }, + "failed": { + "type": "number" + }, + "details": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/esql._types.EsqlClusterDetails" + } + } + }, + "required": [ + "total", + "successful", + "running", + "skipped", + "partial", + "failed", + "details" + ] + }, + "esql._types.EsqlClusterDetails": { + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/esql._types.EsqlClusterStatus" + }, + "indices": { + "type": "string" + }, + "took": { + "$ref": "#/components/schemas/_types.DurationValueUnitMillis" + }, + "_shards": { + "$ref": "#/components/schemas/esql._types.EsqlShardInfo" + } + }, + "required": [ + "status", + "indices" + ] + }, + "esql._types.EsqlClusterStatus": { + "type": "string", + "enum": [ + "running", + "successful", + "partial", + "skipped", + "failed" + ] + }, + "esql._types.EsqlShardInfo": { + "type": "object", + "properties": { + "total": { + "type": "number" + }, + "successful": { + "type": "number" + }, + "skipped": { + "type": "number" + }, + "failed": { + "type": "number" + }, + "failures": { + "type": "array", + "items": { + "$ref": "#/components/schemas/esql._types.EsqlShardFailure" + } + } + }, + "required": [ + "total" + ] + }, + "esql._types.EsqlShardFailure": { + "type": "object", + "properties": { + "shard": { + "$ref": "#/components/schemas/_types.Id" + }, + "index": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "node": { + "$ref": "#/components/schemas/_types.NodeId" + }, + "reason": { + "$ref": "#/components/schemas/_types.ErrorCause" + } + }, + "required": [ + "shard", + "index", + "reason" + ] }, "_types.InlineGet": { "type": "object", diff --git a/output/schema/schema.json b/output/schema/schema.json index 584fa4dc8c..c5cac0c896 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -50765,21 +50765,6 @@ ], "specLocation": "_types/Base.ts#L127-L136" }, - { - "kind": "type_alias", - "name": { - "name": "EsqlResult", - "namespace": "_types" - }, - "specLocation": "_types/Binary.ts#L24-L24", - "type": { - "kind": "instance_of", - "type": { - "name": "binary", - "namespace": "_builtins" - } - } - }, { "kind": "enum", "members": [ @@ -57044,7 +57029,7 @@ "name": "StreamResult", "namespace": "_types" }, - "specLocation": "_types/Binary.ts#L27-L27", + "specLocation": "_types/Binary.ts#L24-L24", "type": { "kind": "instance_of", "type": { @@ -133299,6 +133284,490 @@ }, "specLocation": "eql/search/types.ts#L20-L32" }, + { + "kind": "interface", + "inherits": { + "type": { + "name": "EsqlResult", + "namespace": "esql._types" + } + }, + "name": { + "name": "AsyncEsqlResult", + "namespace": "esql._types" + }, + "properties": [ + { + "name": "id", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "is_running", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "esql/_types/EsqlResult.ts#L45-L48" + }, + { + "kind": "interface", + "name": { + "name": "ClusterInfo", + "namespace": "esql._types" + }, + "properties": [ + { + "name": "total", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "successful", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "running", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "skipped", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "partial", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "failed", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "details", + "required": true, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "EsqlClusterDetails", + "namespace": "esql._types" + } + } + } + } + ], + "specLocation": "esql/_types/EsqlResult.ts#L55-L63" + }, + { + "kind": "interface", + "name": { + "name": "ColumnInfo", + "namespace": "esql._types" + }, + "properties": [ + { + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "esql/_types/EsqlResult.ts#L50-L53" + }, + { + "kind": "interface", + "name": { + "name": "EsqlClusterDetails", + "namespace": "esql._types" + }, + "properties": [ + { + "name": "status", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "EsqlClusterStatus", + "namespace": "esql._types" + } + } + }, + { + "name": "indices", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "took", + "required": false, + "type": { + "kind": "instance_of", + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "type": { + "name": "DurationValue", + "namespace": "_types" + } + } + }, + { + "name": "_shards", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "EsqlShardInfo", + "namespace": "esql._types" + } + } + } + ], + "specLocation": "esql/_types/EsqlResult.ts#L65-L70" + }, + { + "kind": "enum", + "members": [ + { + "name": "running" + }, + { + "name": "successful" + }, + { + "name": "partial" + }, + { + "name": "skipped" + }, + { + "name": "failed" + } + ], + "name": { + "name": "EsqlClusterStatus", + "namespace": "esql._types" + }, + "specLocation": "esql/_types/EsqlResult.ts#L72-L78" + }, + { + "kind": "interface", + "name": { + "name": "EsqlResult", + "namespace": "esql._types" + }, + "properties": [ + { + "name": "took", + "required": false, + "type": { + "kind": "instance_of", + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "type": { + "name": "DurationValue", + "namespace": "_types" + } + } + }, + { + "name": "is_partial", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "all_columns", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ColumnInfo", + "namespace": "esql._types" + } + } + } + }, + { + "name": "columns", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ColumnInfo", + "namespace": "esql._types" + } + } + } + }, + { + "name": "values", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "FieldValue", + "namespace": "_types" + } + } + } + } + }, + { + "description": "Cross-cluster search information. Present if `include_ccs_metadata` was `true` in the request\nand a cross-cluster search was performed.", + "name": "_clusters", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ClusterInfo", + "namespace": "esql._types" + } + } + }, + { + "description": "Profiling information. Present if `profile` was `true` in the request.\nThe contents of this field are currently unstable.", + "name": "profile", + "required": false, + "type": { + "kind": "user_defined_value" + } + } + ], + "specLocation": "esql/_types/EsqlResult.ts#L27-L43" + }, + { + "kind": "interface", + "name": { + "name": "EsqlShardFailure", + "namespace": "esql._types" + }, + "properties": [ + { + "name": "shard", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + }, + { + "name": "node", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "NodeId", + "namespace": "_types" + } + } + }, + { + "name": "reason", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ErrorCause", + "namespace": "_types" + } + } + } + ], + "specLocation": "esql/_types/EsqlResult.ts#L88-L93" + }, + { + "kind": "interface", + "name": { + "name": "EsqlShardInfo", + "namespace": "esql._types" + }, + "properties": [ + { + "name": "total", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "successful", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "skipped", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "failed", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "failures", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "EsqlShardFailure", + "namespace": "esql._types" + } + } + } + } + ], + "specLocation": "esql/_types/EsqlResult.ts#L80-L86" + }, { "kind": "interface", "name": { @@ -133762,7 +134231,7 @@ "kind": "instance_of", "type": { "name": "EsqlResult", - "namespace": "_types" + "namespace": "esql._types" } } }, @@ -133973,8 +134442,8 @@ "value": { "kind": "instance_of", "type": { - "name": "EsqlResult", - "namespace": "_types" + "name": "AsyncEsqlResult", + "namespace": "esql._types" } } }, @@ -134069,7 +134538,7 @@ "kind": "instance_of", "type": { "name": "EsqlResult", - "namespace": "_types" + "namespace": "esql._types" } } }, @@ -134353,7 +134822,7 @@ "kind": "instance_of", "type": { "name": "EsqlResult", - "namespace": "_types" + "namespace": "esql._types" } } }, diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index a29a430705..78791f4f76 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -392,6 +392,7 @@ } }, "generalErrors": [ - "Query is present in multiple namespaces: _global.knn_search._types and xpack.usage" + "Query is present in multiple namespaces: _global.knn_search._types and xpack.usage", + "ClusterInfo is present in multiple namespaces: cluster.allocation_explain and esql._types" ] } \ No newline at end of file diff --git a/output/typescript/types.ts b/output/typescript/types.ts index bc58c54e16..8127fe577c 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2337,8 +2337,6 @@ export interface ErrorResponseBase { status: integer } -export type EsqlResult = ArrayBuffer - export type ExpandWildcard = 'all' | 'open' | 'closed' | 'hidden' | 'none' export type ExpandWildcards = ExpandWildcard | ExpandWildcard[] @@ -10776,6 +10774,60 @@ export type EqlSearchResponse = EqlEqlSearchResponseBase +} + +export interface EsqlColumnInfo { + name: string + type: string +} + +export interface EsqlEsqlClusterDetails { + status: EsqlEsqlClusterStatus + indices: string + took?: DurationValue + _shards?: EsqlEsqlShardInfo +} + +export type EsqlEsqlClusterStatus = 'running' | 'successful' | 'partial' | 'skipped' | 'failed' + +export interface EsqlEsqlResult { + took?: DurationValue + is_partial?: boolean + all_columns?: EsqlColumnInfo[] + columns: EsqlColumnInfo[] + values: FieldValue[][] + _clusters?: EsqlClusterInfo + profile?: any +} + +export interface EsqlEsqlShardFailure { + shard: Id + index: IndexName + node?: NodeId + reason: ErrorCause +} + +export interface EsqlEsqlShardInfo { + total: integer + successful?: integer + skipped?: integer + failed?: integer + failures?: EsqlEsqlShardFailure[] +} + export interface EsqlTableValuesContainer { integer?: EsqlTableValuesIntegerValue[] keyword?: EsqlTableValuesKeywordValue[] @@ -10811,7 +10863,7 @@ export interface EsqlAsyncQueryRequest extends RequestBase { } } -export type EsqlAsyncQueryResponse = EsqlResult +export type EsqlAsyncQueryResponse = EsqlEsqlResult export interface EsqlAsyncQueryDeleteRequest extends RequestBase { id: Id @@ -10827,14 +10879,14 @@ export interface EsqlAsyncQueryGetRequest extends RequestBase { wait_for_completion_timeout?: Duration } -export type EsqlAsyncQueryGetResponse = EsqlResult +export type EsqlAsyncQueryGetResponse = EsqlAsyncEsqlResult export interface EsqlAsyncQueryStopRequest extends RequestBase { id: Id drop_null_columns?: boolean } -export type EsqlAsyncQueryStopResponse = EsqlResult +export type EsqlAsyncQueryStopResponse = EsqlEsqlResult export type EsqlQueryEsqlFormat = 'csv' | 'json' | 'tsv' | 'txt' | 'yaml' | 'cbor' | 'smile' | 'arrow' @@ -10855,7 +10907,7 @@ export interface EsqlQueryRequest extends RequestBase { } } -export type EsqlQueryResponse = EsqlResult +export type EsqlQueryResponse = EsqlEsqlResult export interface FeaturesFeature { name: string diff --git a/specification/_types/Binary.ts b/specification/_types/Binary.ts index ee7a540c2f..3b7c8326b2 100644 --- a/specification/_types/Binary.ts +++ b/specification/_types/Binary.ts @@ -20,8 +20,5 @@ // Vector tile response export type MapboxVectorTiles = ArrayBuffer -// ES|QL generic response -export type EsqlResult = ArrayBuffer - // Streaming endpoints response export type StreamResult = ArrayBuffer diff --git a/specification/esql/_types/EsqlResult.ts b/specification/esql/_types/EsqlResult.ts new file mode 100644 index 0000000000..58ef6e835f --- /dev/null +++ b/specification/esql/_types/EsqlResult.ts @@ -0,0 +1,93 @@ +/* + * 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. + */ + +import { FieldValue, Id, IndexName, NodeId } from '@_types/common' +import { ErrorCause } from '@_types/Errors' +import { integer } from '@_types/Numeric' +import { DurationValue, UnitMillis } from '@_types/Time' +import { Dictionary } from '@spec_utils/Dictionary' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' + +export class EsqlResult { + took?: DurationValue + is_partial?: boolean + all_columns?: ColumnInfo[] + columns: ColumnInfo[] + values: Array> + /** + * Cross-cluster search information. Present if `include_ccs_metadata` was `true` in the request + * and a cross-cluster search was performed. + */ + _clusters?: ClusterInfo + /** + * Profiling information. Present if `profile` was `true` in the request. + * The contents of this field are currently unstable. + */ + profile?: UserDefinedValue +} + +export class AsyncEsqlResult extends EsqlResult { + id?: string + is_running: boolean +} + +export class ColumnInfo { + name: string + type: string +} + +export class ClusterInfo { + total: integer + successful: integer + running: integer + skipped: integer + partial: integer + failed: integer + details: Dictionary +} + +export class EsqlClusterDetails { + status: EsqlClusterStatus + indices: string + took?: DurationValue + _shards?: EsqlShardInfo +} + +export enum EsqlClusterStatus { + running, + successful, + partial, + skipped, + failed +} + +export class EsqlShardInfo { + total: integer + successful?: integer + skipped?: integer + failed?: integer + failures?: EsqlShardFailure[] +} + +export class EsqlShardFailure { + shard: Id + index: IndexName + node?: NodeId + reason: ErrorCause +} diff --git a/specification/esql/async_query/AsyncQueryResponse.ts b/specification/esql/async_query/AsyncQueryResponse.ts index 33fc735dbe..295baf13f5 100644 --- a/specification/esql/async_query/AsyncQueryResponse.ts +++ b/specification/esql/async_query/AsyncQueryResponse.ts @@ -17,7 +17,7 @@ * under the License. */ -import { EsqlResult } from '@_types/Binary' +import { EsqlResult } from '@esql/_types/EsqlResult' export class Response { body: EsqlResult diff --git a/specification/esql/async_query_get/AsyncQueryGetResponse.ts b/specification/esql/async_query_get/AsyncQueryGetResponse.ts index 33fc735dbe..316f9555a3 100644 --- a/specification/esql/async_query_get/AsyncQueryGetResponse.ts +++ b/specification/esql/async_query_get/AsyncQueryGetResponse.ts @@ -17,8 +17,8 @@ * under the License. */ -import { EsqlResult } from '@_types/Binary' +import { AsyncEsqlResult } from '@esql/_types/EsqlResult' export class Response { - body: EsqlResult + body: AsyncEsqlResult } diff --git a/specification/esql/async_query_stop/AsyncQueryStopResponse.ts b/specification/esql/async_query_stop/AsyncQueryStopResponse.ts index 33fc735dbe..295baf13f5 100644 --- a/specification/esql/async_query_stop/AsyncQueryStopResponse.ts +++ b/specification/esql/async_query_stop/AsyncQueryStopResponse.ts @@ -17,7 +17,7 @@ * under the License. */ -import { EsqlResult } from '@_types/Binary' +import { EsqlResult } from '@esql/_types/EsqlResult' export class Response { body: EsqlResult diff --git a/specification/esql/query/QueryResponse.ts b/specification/esql/query/QueryResponse.ts index ba2058f084..1ee2c24f33 100644 --- a/specification/esql/query/QueryResponse.ts +++ b/specification/esql/query/QueryResponse.ts @@ -17,7 +17,7 @@ * under the License. */ -import { EsqlResult } from '@_types/Binary' +import { EsqlResult } from '@esql/_types/EsqlResult' export class Response { /** @codegen_name data */