From 2c19f6c0cf410182bc6d63239e7bb13b80d73d9d Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Wed, 11 Jun 2025 01:01:15 -0600 Subject: [PATCH 1/2] Fix AsyncQueryResuest - those parameters should be in the body (#4517) (cherry picked from commit 0ac4f3b154e93370517d5e6e3551e0a1be11470a) --- output/openapi/elasticsearch-openapi.json | 37 ++--------- output/schema/schema.json | 65 ++++++++----------- output/schema/validation-errors.json | 8 --- output/typescript/types.ts | 5 +- .../esql/async_query/AsyncQueryRequest.ts | 36 ++++------ 5 files changed, 49 insertions(+), 102 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 5cb60e3aa1..f98a571502 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -13500,36 +13500,6 @@ "$ref": "#/components/schemas/esql._types.EsqlFormat" }, "style": "form" - }, - { - "in": "query", - "name": "keep_alive", - "description": "The period for which the query and its results are stored in the cluster.\nThe default period is five days.\nWhen this period expires, the query and its results are deleted, even if the query is still ongoing.\nIf the `keep_on_completion` parameter is false, Elasticsearch only stores async queries that do not complete within the period set by the `wait_for_completion_timeout` parameter, regardless of this value.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Duration" - }, - "style": "form" - }, - { - "in": "query", - "name": "keep_on_completion", - "description": "Indicates whether the query and its results are stored in the cluster.\nIf false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter.", - "deprecated": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "wait_for_completion_timeout", - "description": "The period to wait for the request to finish.\nBy default, the request waits for 1 second for the query results.\nIf the query completes during this period, results are returned\nOtherwise, a query ID is returned that can later be used to retrieve the results.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Duration" - }, - "style": "form" } ], "requestBody": { @@ -13579,6 +13549,13 @@ }, "wait_for_completion_timeout": { "$ref": "#/components/schemas/_types.Duration" + }, + "keep_alive": { + "$ref": "#/components/schemas/_types.Duration" + }, + "keep_on_completion": { + "description": "Indicates whether the query and its results are stored in the cluster.\nIf false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter.", + "type": "boolean" } }, "required": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 137b04689d..2eeb12a565 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -132942,6 +132942,32 @@ "namespace": "_types" } } + }, + { + "description": "The period for which the query and its results are stored in the cluster.\nThe default period is five days.\nWhen this period expires, the query and its results are deleted, even if the query is still ongoing.\nIf the `keep_on_completion` parameter is false, Elasticsearch only stores async queries that do not complete within the period set by the `wait_for_completion_timeout` parameter, regardless of this value.", + "name": "keep_alive", + "required": false, + "serverDefault": "5d", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "Indicates whether the query and its results are stored in the cluster.\nIf false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter.", + "name": "keep_on_completion", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ] }, @@ -133022,45 +133048,6 @@ "namespace": "esql._types" } } - }, - { - "description": "The period for which the query and its results are stored in the cluster.\nThe default period is five days.\nWhen this period expires, the query and its results are deleted, even if the query is still ongoing.\nIf the `keep_on_completion` parameter is false, Elasticsearch only stores async queries that do not complete within the period set by the `wait_for_completion_timeout` parameter, regardless of this value.", - "name": "keep_alive", - "required": false, - "serverDefault": "5d", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - }, - { - "description": "Indicates whether the query and its results are stored in the cluster.\nIf false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter.", - "name": "keep_on_completion", - "required": false, - "serverDefault": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - }, - { - "description": "The period to wait for the request to finish.\nBy default, the request waits for 1 second for the query results.\nIf the query completes during this period, results are returned\nOtherwise, a query ID is returned that can later be used to retrieve the results.", - "name": "wait_for_completion_timeout", - "required": false, - "serverDefault": "1s", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } } ], "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L133" diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index e8e97c27e8..31a0442e64 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -37,14 +37,6 @@ ], "response": [] }, - "esql.async_query": { - "request": [ - "Request: query parameter 'keep_alive' does not exist in the json spec", - "Request: query parameter 'keep_on_completion' does not exist in the json spec", - "Request: query parameter 'wait_for_completion_timeout' does not exist in the json spec" - ], - "response": [] - }, "get_source": { "request": [ "Request: query parameter 'stored_fields' does not exist in the json spec" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ca9e02fde5..53a82d35d3 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -10822,9 +10822,6 @@ export interface EsqlAsyncQueryRequest extends RequestBase { delimiter?: string drop_null_columns?: boolean format?: EsqlEsqlFormat - keep_alive?: Duration - keep_on_completion?: boolean - wait_for_completion_timeout?: Duration body?: { columnar?: boolean filter?: QueryDslQueryContainer @@ -10835,6 +10832,8 @@ export interface EsqlAsyncQueryRequest extends RequestBase { tables?: Record> include_ccs_metadata?: boolean wait_for_completion_timeout?: Duration + keep_alive?: Duration + keep_on_completion?: boolean } } diff --git a/specification/esql/async_query/AsyncQueryRequest.ts b/specification/esql/async_query/AsyncQueryRequest.ts index 1b923c6b5d..8331428c90 100644 --- a/specification/esql/async_query/AsyncQueryRequest.ts +++ b/specification/esql/async_query/AsyncQueryRequest.ts @@ -53,28 +53,6 @@ export interface Request extends RequestBase { * A short version of the Accept header, for example `json` or `yaml`. */ format?: EsqlFormat - /** - * The period for which the query and its results are stored in the cluster. - * The default period is five days. - * When this period expires, the query and its results are deleted, even if the query is still ongoing. - * If the `keep_on_completion` parameter is false, Elasticsearch only stores async queries that do not complete within the period set by the `wait_for_completion_timeout` parameter, regardless of this value. - * @server_default 5d - */ - keep_alive?: Duration - /** - * Indicates whether the query and its results are stored in the cluster. - * If false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter. - * @server_default false - */ - keep_on_completion?: boolean - /** - * The period to wait for the request to finish. - * By default, the request waits for 1 second for the query results. - * If the query completes during this period, results are returned - * Otherwise, a query ID is returned that can later be used to retrieve the results. - * @server_default 1s - */ - wait_for_completion_timeout?: Duration } /** * Use the `query` element to start a query. Use `time_zone` to specify an execution time zone and `columnar` to format the answer. @@ -129,5 +107,19 @@ export interface Request extends RequestBase { * @server_default 1s */ wait_for_completion_timeout?: Duration + /** + * The period for which the query and its results are stored in the cluster. + * The default period is five days. + * When this period expires, the query and its results are deleted, even if the query is still ongoing. + * If the `keep_on_completion` parameter is false, Elasticsearch only stores async queries that do not complete within the period set by the `wait_for_completion_timeout` parameter, regardless of this value. + * @server_default 5d + */ + keep_alive?: Duration + /** + * Indicates whether the query and its results are stored in the cluster. + * If false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter. + * @server_default false + */ + keep_on_completion?: boolean } } From 0f534c505398941b4e189e383b4a0597a219b00d Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Wed, 11 Jun 2025 01:01:15 -0600 Subject: [PATCH 2/2] Fix AsyncQueryResuest - those parameters should be in the body (#4517) (cherry picked from commit 0ac4f3b154e93370517d5e6e3551e0a1be11470a) --- output/openapi/elasticsearch-openapi.json | 1 - output/schema/schema.json | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index f98a571502..16bf30345b 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -87895,7 +87895,6 @@ ] }, "_types.NodeRoles": { - "description": "* @doc_id node-roles", "type": "array", "items": { "$ref": "#/components/schemas/_types.NodeRole" diff --git a/output/schema/schema.json b/output/schema/schema.json index 2eeb12a565..3b0df78f80 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -52985,7 +52985,8 @@ }, { "kind": "type_alias", - "description": "* @doc_id node-roles", + "docId": "node-roles", + "docUrl": "https://www.elastic.co/docs/reference/elasticsearch/configuration-reference/node-settings#node-roles", "name": { "name": "NodeRoles", "namespace": "_types" @@ -133050,7 +133051,7 @@ } } ], - "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L133" + "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L125" }, { "kind": "response",