From 83f7a54c511a361ea4e3bc47b4d53fbf62b566ec Mon Sep 17 00:00:00 2001 From: pquentin <42327+pquentin@users.noreply.github.com> Date: Tue, 18 Mar 2025 04:07:07 +0000 Subject: [PATCH 1/2] Update rest-api-spec --- output/schema/schema-serverless.json | 12 ++++++------ output/schema/schema.json | 6 +++--- output/schema/validation-errors.json | 9 ++++++++- specification/_json_spec/esql.async_query.json | 5 +++++ specification/_json_spec/esql.query.json | 5 +++++ specification/_json_spec/inference.completion.json | 2 +- specification/_json_spec/inference.delete.json | 2 +- specification/_json_spec/inference.get.json | 2 +- specification/_json_spec/inference.put.json | 2 +- ...nce.put.openai.json => inference.put_openai.json} | 0 ...e.put.watsonx.json => inference.put_watsonx.json} | 0 .../_json_spec/inference.stream_completion.json | 2 +- 12 files changed, 32 insertions(+), 15 deletions(-) rename specification/_json_spec/{inference.put.openai.json => inference.put_openai.json} (100%) rename specification/_json_spec/{inference.put.watsonx.json => inference.put_watsonx.json} (100%) diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 41abf58c36..dc5d7791f0 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -16888,7 +16888,7 @@ { "description": "Only perform the operation if the document has this primary term.", "extDocId": "optimistic-concurrency", - "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/optimistic-concurrency-control.html", + "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/optimistic-concurrency-control.html", "name": "if_primary_term", "required": false, "type": { @@ -16902,7 +16902,7 @@ { "description": "Only perform the operation if the document has this sequence number.", "extDocId": "optimistic-concurrency", - "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/optimistic-concurrency-control.html", + "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/optimistic-concurrency-control.html", "name": "if_seq_no", "required": false, "type": { @@ -33043,7 +33043,7 @@ "aliases": [ "indexes" ], - "description": "An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine\nlearning nodes must have the `remote_cluster_client` role.", + "description": "An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the master\nnodes and the machine learning nodes must have the `remote_cluster_client` role.", "name": "indices", "required": false, "type": { @@ -43727,12 +43727,12 @@ }, "description": "Update an API key.\n\nUpdate attributes of an existing API key.\nThis API supports updates to an API key's access scope, expiration, and metadata.\n\nTo use this API, you must have at least the `manage_own_api_key` cluster privilege.\nUsers can only update API keys that they created or that were granted to them.\nTo update another user’s API key, use the `run_as` feature to submit a request on behalf of another user.\n\nIMPORTANT: It's not possible to use an API key as the authentication credential for this API. The owner user’s credentials are required.\n\nUse this API to update API keys created by the create API key or grant API Key APIs.\nIf you need to apply the same update to many API keys, you can use the bulk update API keys API to reduce overhead.\nIt's not possible to update expired API keys or API keys that have been invalidated by the invalidate API key API.\n\nThe access scope of an API key is derived from the `role_descriptors` you specify in the request and a snapshot of the owner user's permissions at the time of the request.\nThe snapshot of the owner's permissions is updated automatically on every call.\n\nIMPORTANT: If you don't specify `role_descriptors` in the request, a call to this API might still change the API key's access scope.\nThis change can occur if the owner user's permissions have changed since the API key was created or last modified.", "examples": { - "RequestExample1": { + "UpdateApiKeyRequestExample1": { "description": "Run `PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx` to assign new role descriptors and metadata to an API key.\n", "summary": "Update role and metadata", "value": "{\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\"*\"],\n \"privileges\": [\"write\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\"production\"]\n }\n }\n}" }, - "RequestExample2": { + "UpdateApiKeyRequestExample2": { "description": "Run `PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx` to remove the API key's previously assigned permissions. It will inherit the owner user's full permissions.\n", "summary": "Remove permissions", "value": "{\n \"role_descriptors\": {}\n}" @@ -43785,7 +43785,7 @@ ] }, "examples": { - "ResponseExample1": { + "UpdateApiKeyResponseExample1": { "description": "A successful response from `PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx`. The API key's effective permissions after the update will be the intersection of the supplied role descriptors and the owner user's permissions.\n", "summary": "Update role and metadata", "value": "{\n \"updated\": true\n}" diff --git a/output/schema/schema.json b/output/schema/schema.json index 8bd808fac3..b609a2a030 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -24322,7 +24322,7 @@ { "description": "Only perform the operation if the document has this primary term.", "extDocId": "optimistic-concurrency", - "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/optimistic-concurrency-control.html", + "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/optimistic-concurrency-control.html", "name": "if_primary_term", "required": false, "type": { @@ -24336,7 +24336,7 @@ { "description": "Only perform the operation if the document has this sequence number.", "extDocId": "optimistic-concurrency", - "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/optimistic-concurrency-control.html", + "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/optimistic-concurrency-control.html", "name": "if_seq_no", "required": false, "type": { @@ -180035,7 +180035,7 @@ "aliases": [ "indexes" ], - "description": "An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the master \nnodes and the machine learning nodes must have the `remote_cluster_client` role.", + "description": "An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the master\nnodes and the machine learning nodes must have the `remote_cluster_client` role.", "name": "indices", "required": false, "type": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 55585a2738..142d28a03c 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -228,7 +228,14 @@ "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" + "Request: query parameter 'wait_for_completion_timeout' does not exist in the json spec", + "Request: missing json spec query parameter 'allow_partial_results'" + ], + "response": [] + }, + "esql.query": { + "request": [ + "Request: missing json spec query parameter 'allow_partial_results'" ], "response": [] }, diff --git a/specification/_json_spec/esql.async_query.json b/specification/_json_spec/esql.async_query.json index fe6b455181..566bf9075b 100644 --- a/specification/_json_spec/esql.async_query.json +++ b/specification/_json_spec/esql.async_query.json @@ -32,6 +32,11 @@ "type": "boolean", "description": "Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.", "default": false + }, + "allow_partial_results": { + "type": "boolean", + "description": "If `true`, partial results will be returned if there are shard failures, but\nthe query can continue to execute on other clusters and shards.", + "default": false } }, "body": { diff --git a/specification/_json_spec/esql.query.json b/specification/_json_spec/esql.query.json index 3bb46f0a07..4e1e96fd14 100644 --- a/specification/_json_spec/esql.query.json +++ b/specification/_json_spec/esql.query.json @@ -32,6 +32,11 @@ "type": "boolean", "description": "Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.", "default": false + }, + "allow_partial_results": { + "type": "boolean", + "description": "If `true`, partial results will be returned if there are shard failures, but\nthe query can continue to execute on other clusters and shards.", + "default": false } }, "body": { diff --git a/specification/_json_spec/inference.completion.json b/specification/_json_spec/inference.completion.json index f1543c4678..1a1ebdcb32 100644 --- a/specification/_json_spec/inference.completion.json +++ b/specification/_json_spec/inference.completion.json @@ -4,7 +4,7 @@ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html", "description": "Perform completion inference" }, - "stability": "experimental", + "stability": "stable", "visibility": "public", "headers": { "accept": ["application/json"], diff --git a/specification/_json_spec/inference.delete.json b/specification/_json_spec/inference.delete.json index d9a0f0b0b6..bfd25b611d 100644 --- a/specification/_json_spec/inference.delete.json +++ b/specification/_json_spec/inference.delete.json @@ -4,7 +4,7 @@ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html", "description": "Delete an inference endpoint" }, - "stability": "experimental", + "stability": "stable", "visibility": "public", "headers": { "accept": ["application/json"] diff --git a/specification/_json_spec/inference.get.json b/specification/_json_spec/inference.get.json index 661f696f43..7f14d8babb 100644 --- a/specification/_json_spec/inference.get.json +++ b/specification/_json_spec/inference.get.json @@ -4,7 +4,7 @@ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html", "description": "Get an inference endpoint" }, - "stability": "experimental", + "stability": "stable", "visibility": "public", "headers": { "accept": ["application/json"] diff --git a/specification/_json_spec/inference.put.json b/specification/_json_spec/inference.put.json index 2c7d3fbf14..d48b65cba6 100644 --- a/specification/_json_spec/inference.put.json +++ b/specification/_json_spec/inference.put.json @@ -4,7 +4,7 @@ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html", "description": "Configure an inference endpoint for use in the Inference API" }, - "stability": "experimental", + "stability": "stable", "visibility": "public", "headers": { "accept": ["application/json"], diff --git a/specification/_json_spec/inference.put.openai.json b/specification/_json_spec/inference.put_openai.json similarity index 100% rename from specification/_json_spec/inference.put.openai.json rename to specification/_json_spec/inference.put_openai.json diff --git a/specification/_json_spec/inference.put.watsonx.json b/specification/_json_spec/inference.put_watsonx.json similarity index 100% rename from specification/_json_spec/inference.put.watsonx.json rename to specification/_json_spec/inference.put_watsonx.json diff --git a/specification/_json_spec/inference.stream_completion.json b/specification/_json_spec/inference.stream_completion.json index 871d6451a9..9df9f4a17c 100644 --- a/specification/_json_spec/inference.stream_completion.json +++ b/specification/_json_spec/inference.stream_completion.json @@ -4,7 +4,7 @@ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-stream-inference-api.html", "description": "Perform streaming completion inference" }, - "stability": "experimental", + "stability": "stable", "visibility": "public", "headers": { "accept": ["text/event-stream"], From 4c5fe4ab9bbb913d5396b56672a153e77bd27389 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 18 Mar 2025 10:15:45 +0400 Subject: [PATCH 2/2] Add allow_partial_results --- output/openapi/elasticsearch-openapi.json | 20 +++++++++++++ .../elasticsearch-serverless-openapi.json | 10 +++++++ output/schema/schema-serverless.json | 15 +++++++++- output/schema/schema.json | 30 +++++++++++++++++-- output/schema/validation-errors.json | 9 +----- output/typescript/types.ts | 2 ++ .../esql/async_query/AsyncQueryRequest.ts | 5 ++++ specification/esql/query/QueryRequest.ts | 5 ++++ 8 files changed, 85 insertions(+), 11 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index e61f34ba05..bfa975b787 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -9535,6 +9535,16 @@ }, "operationId": "esql-async-query", "parameters": [ + { + "in": "query", + "name": "allow_partial_results", + "description": "If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, { "in": "query", "name": "delimiter", @@ -9866,6 +9876,16 @@ "type": "boolean" }, "style": "form" + }, + { + "in": "query", + "name": "allow_partial_results", + "description": "If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" } ], "requestBody": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index f127ddc860..53f3c54e0c 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -5558,6 +5558,16 @@ "type": "boolean" }, "style": "form" + }, + { + "in": "query", + "name": "allow_partial_results", + "description": "If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" } ], "requestBody": { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index dc5d7791f0..9e64118e92 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -19434,9 +19434,22 @@ "namespace": "_builtins" } } + }, + { + "description": "If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.", + "name": "allow_partial_results", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "esql/query/QueryRequest.ts#L27-L105" + "specLocation": "esql/query/QueryRequest.ts#L27-L110" }, { "body": { diff --git a/output/schema/schema.json b/output/schema/schema.json index b609a2a030..2452dbeadd 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -124189,6 +124189,19 @@ }, "path": [], "query": [ + { + "description": "If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.", + "name": "allow_partial_results", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, { "description": "The character to use between values within a CSV row.\nIt is valid only for the CSV format.", "name": "delimiter", @@ -124266,7 +124279,7 @@ } } ], - "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L125" + "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L130" }, { "kind": "response", @@ -124722,9 +124735,22 @@ "namespace": "_builtins" } } + }, + { + "description": "If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.", + "name": "allow_partial_results", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "esql/query/QueryRequest.ts#L27-L105" + "specLocation": "esql/query/QueryRequest.ts#L27-L110" }, { "kind": "response", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 142d28a03c..55585a2738 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -228,14 +228,7 @@ "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", - "Request: missing json spec query parameter 'allow_partial_results'" - ], - "response": [] - }, - "esql.query": { - "request": [ - "Request: missing json spec query parameter 'allow_partial_results'" + "Request: query parameter 'wait_for_completion_timeout' does not exist in the json spec" ], "response": [] }, diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 28d0e0477f..b1e66c2abd 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -10575,6 +10575,7 @@ export type EsqlTableValuesLongDouble = double | double[] export type EsqlTableValuesLongValue = long | long[] export interface EsqlAsyncQueryRequest extends RequestBase { + allow_partial_results?: boolean delimiter?: string drop_null_columns?: boolean format?: EsqlQueryEsqlFormat @@ -10623,6 +10624,7 @@ export interface EsqlQueryRequest extends RequestBase { format?: EsqlQueryEsqlFormat delimiter?: string drop_null_columns?: boolean + allow_partial_results?: boolean body?: { columnar?: boolean filter?: QueryDslQueryContainer diff --git a/specification/esql/async_query/AsyncQueryRequest.ts b/specification/esql/async_query/AsyncQueryRequest.ts index 9f918d9114..9ac2ab078f 100644 --- a/specification/esql/async_query/AsyncQueryRequest.ts +++ b/specification/esql/async_query/AsyncQueryRequest.ts @@ -38,6 +38,11 @@ import { Duration } from '@_types/Time' */ export interface Request extends RequestBase { query_parameters: { + /** + * If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards. + * @server_default false + */ + allow_partial_results?: boolean /** * The character to use between values within a CSV row. * It is valid only for the CSV format. diff --git a/specification/esql/query/QueryRequest.ts b/specification/esql/query/QueryRequest.ts index fb2e362bca..f7863b5c48 100644 --- a/specification/esql/query/QueryRequest.ts +++ b/specification/esql/query/QueryRequest.ts @@ -55,6 +55,11 @@ export interface Request extends RequestBase { * @server_default false */ drop_null_columns?: boolean + /** + * If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards. + * @server_default false + */ + allow_partial_results?: boolean } /** * Use the `query` element to start a query. Use `time_zone` to specify an execution time zone and `columnar` to format the answer.