From 6b543ff14cc33966d6c6da7b9dd49a79ea6b95e8 Mon Sep 17 00:00:00 2001 From: pquentin <42327+pquentin@users.noreply.github.com> Date: Wed, 26 Feb 2025 04:06:58 +0000 Subject: [PATCH 1/2] Update rest-api-spec --- output/openapi/elasticsearch-openapi.json | 22 ++------ .../elasticsearch-serverless-openapi.json | 22 ++------ output/schema/schema-serverless.json | 55 ++++++------------- output/schema/schema.json | 55 ++++++------------- output/schema/validation-errors.json | 28 ++-------- output/typescript/types.ts | 2 +- .../_json_spec/async_search.submit.json | 5 ++ specification/_json_spec/cat.help.json | 11 ---- specification/_json_spec/cat.segments.json | 8 +++ specification/_json_spec/cat.tasks.json | 10 ++++ .../_json_spec/enrich.get_policy.json | 2 +- specification/_json_spec/eql.search.json | 2 +- .../_json_spec/ilm.migrate_to_data_tiers.json | 4 ++ .../indices.cancel_migrate_reindex.json | 2 +- .../_json_spec/indices.create_from.json | 2 +- .../indices.get_migrate_reindex_status.json | 2 +- .../_json_spec/indices.migrate_reindex.json | 2 +- ..._application.put_behavioral_analytics.json | 2 +- 18 files changed, 85 insertions(+), 151 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 38f569f3b8..7561a970af 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -109478,23 +109478,13 @@ }, "dynamic_templates": { "description": "Specify dynamic templates for the mapping.", - "oneOf": [ - { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/_types.mapping:DynamicTemplate" - } - }, - { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/_types.mapping:DynamicTemplate" - } - } + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/_types.mapping:DynamicTemplate" } - ] + } }, "_field_names": { "$ref": "#/components/schemas/_types.mapping:FieldNamesField" diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 7cb25569b4..5e7ed29728 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -64203,23 +64203,13 @@ }, "dynamic_templates": { "description": "Specify dynamic templates for the mapping.", - "oneOf": [ - { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/_types.mapping:DynamicTemplate" - } - }, - { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/_types.mapping:DynamicTemplate" - } - } + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/_types.mapping:DynamicTemplate" } - ] + } }, "_field_names": { "$ref": "#/components/schemas/_types.mapping:FieldNamesField" diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index e2787f2acf..7072e31682 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -23746,48 +23746,25 @@ "name": "dynamic_templates", "required": false, "type": { - "items": [ - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "DynamicTemplate", - "namespace": "_types.mapping" - } + "kind": "array_of", + "value": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" } }, - { - "kind": "array_of", - "value": { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "DynamicTemplate", - "namespace": "_types.mapping" - } - } + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "DynamicTemplate", + "namespace": "_types.mapping" } } - ], - "kind": "union_of" + } } }, { @@ -23994,7 +23971,7 @@ } } ], - "specLocation": "indices/put_mapping/IndicesPutMappingRequest.ts#L41-L183" + "specLocation": "indices/put_mapping/IndicesPutMappingRequest.ts#L41-L181" }, { "body": { diff --git a/output/schema/schema.json b/output/schema/schema.json index a0d6f8a87e..db5c02e547 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -139796,48 +139796,25 @@ "name": "dynamic_templates", "required": false, "type": { - "kind": "union_of", - "items": [ - { - "kind": "dictionary_of", - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "DynamicTemplate", - "namespace": "_types.mapping" - } + "kind": "array_of", + "value": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" } }, - { - "kind": "array_of", - "value": { - "kind": "dictionary_of", - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "DynamicTemplate", - "namespace": "_types.mapping" - } - } + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "DynamicTemplate", + "namespace": "_types.mapping" } } - ] + } } }, { @@ -140043,7 +140020,7 @@ } } ], - "specLocation": "indices/put_mapping/IndicesPutMappingRequest.ts#L41-L183" + "specLocation": "indices/put_mapping/IndicesPutMappingRequest.ts#L41-L181" }, { "kind": "response", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 26a3528281..530b2a014c 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -2,7 +2,6 @@ "endpointErrors": { "async_search.submit": { "request": [ - "Request: query parameter 'keep_alive' does not exist in the json spec", "interface definition _types:QueryVectorBuilder - Property text_embedding is a single-variant and must be required" ], "response": [] @@ -13,27 +12,6 @@ ], "response": [] }, - "cat.help": { - "request": [ - "Request: missing json spec query parameter 'help'", - "Request: missing json spec query parameter 's'" - ], - "response": [] - }, - "cat.segments": { - "request": [ - "Request: query parameter 'local' does not exist in the json spec", - "Request: query parameter 'master_timeout' does not exist in the json spec" - ], - "response": [] - }, - "cat.tasks": { - "request": [ - "Request: query parameter 'timeout' does not exist in the json spec", - "Request: query parameter 'wait_for_completion' does not exist in the json spec" - ], - "response": [] - }, "cluster.get_component_template": { "request": [ "Request: query parameter 'flat_settings' does not exist in the json spec" @@ -110,6 +88,12 @@ ], "response": [] }, + "ilm.migrate_to_data_tiers": { + "request": [ + "Request: missing json spec query parameter 'master_timeout'" + ], + "response": [] + }, "index": { "request": [ "Request: missing json spec query parameter 'require_data_stream'" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 640c35278a..5535df368b 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -12360,7 +12360,7 @@ export interface IndicesPutMappingRequest extends RequestBase { date_detection?: boolean dynamic?: MappingDynamicMapping dynamic_date_formats?: string[] - dynamic_templates?: Record | Record[] + dynamic_templates?: Record[] _field_names?: MappingFieldNamesField _meta?: Metadata numeric_detection?: boolean diff --git a/specification/_json_spec/async_search.submit.json b/specification/_json_spec/async_search.submit.json index 2d5ad25831..5bff2b1606 100644 --- a/specification/_json_spec/async_search.submit.json +++ b/specification/_json_spec/async_search.submit.json @@ -39,6 +39,11 @@ "description": "Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false)", "default": false }, + "keep_alive": { + "type": "time", + "description": "Update the time interval in which the results (partial or final) for this search will be available", + "default": "5d" + }, "batched_reduce_size": { "type": "number", "description": "The number of shard results that should be reduced at once on the coordinating node. This value should be used as the granularity at which progress results will be made available.", diff --git a/specification/_json_spec/cat.help.json b/specification/_json_spec/cat.help.json index 07d8b8af0f..d37747f882 100644 --- a/specification/_json_spec/cat.help.json +++ b/specification/_json_spec/cat.help.json @@ -16,17 +16,6 @@ "methods": ["GET"] } ] - }, - "params": { - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description": "Comma-separated list of column names or column aliases to sort by" - } } } } diff --git a/specification/_json_spec/cat.segments.json b/specification/_json_spec/cat.segments.json index 765f0b41ef..369c813aba 100644 --- a/specification/_json_spec/cat.segments.json +++ b/specification/_json_spec/cat.segments.json @@ -32,6 +32,14 @@ "type": "string", "description": "a short version of the Accept header, e.g. json, yaml" }, + "local": { + "type": "boolean", + "description": "Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout": { + "type": "time", + "description": "Explicit operation timeout for connection to master node" + }, "bytes": { "type": "enum", "description": "The unit in which to display byte values", diff --git a/specification/_json_spec/cat.tasks.json b/specification/_json_spec/cat.tasks.json index e8a74574f5..24164f3857 100644 --- a/specification/_json_spec/cat.tasks.json +++ b/specification/_json_spec/cat.tasks.json @@ -60,6 +60,16 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "timeout": { + "type": "time", + "default": "30s", + "description": "Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error." + }, + "wait_for_completion": { + "type": "boolean", + "default": false, + "description": "If `true`, the request blocks until the task has completed." } } } diff --git a/specification/_json_spec/enrich.get_policy.json b/specification/_json_spec/enrich.get_policy.json index 273864bca6..9bd3fbcbce 100644 --- a/specification/_json_spec/enrich.get_policy.json +++ b/specification/_json_spec/enrich.get_policy.json @@ -30,7 +30,7 @@ "params": { "master_timeout": { "type": "time", - "description": "Timeout for processing on master node" + "description": "Timeout for waiting for new cluster state in case it is blocked" } } } diff --git a/specification/_json_spec/eql.search.json b/specification/_json_spec/eql.search.json index 3818508320..1d9831a6e8 100644 --- a/specification/_json_spec/eql.search.json +++ b/specification/_json_spec/eql.search.json @@ -42,7 +42,7 @@ "allow_partial_search_results": { "type": "boolean", "description": "Control whether the query should keep running in case of shard failures, and return partial results", - "default": false + "default": true }, "allow_partial_sequence_results": { "type": "boolean", diff --git a/specification/_json_spec/ilm.migrate_to_data_tiers.json b/specification/_json_spec/ilm.migrate_to_data_tiers.json index da1ca3fd09..fdf525a5aa 100644 --- a/specification/_json_spec/ilm.migrate_to_data_tiers.json +++ b/specification/_json_spec/ilm.migrate_to_data_tiers.json @@ -19,6 +19,10 @@ ] }, "params": { + "master_timeout": { + "type": "time", + "description": "Explicit operation timeout for connection to master node" + }, "dry_run": { "type": "boolean", "description": "If set to true it will simulate the migration, providing a way to retrieve the ILM policies and indices that need to be migrated. The default is false" diff --git a/specification/_json_spec/indices.cancel_migrate_reindex.json b/specification/_json_spec/indices.cancel_migrate_reindex.json index 9c333c2736..26d8881201 100644 --- a/specification/_json_spec/indices.cancel_migrate_reindex.json +++ b/specification/_json_spec/indices.cancel_migrate_reindex.json @@ -1,7 +1,7 @@ { "indices.cancel_migrate_reindex": { "documentation": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex.html", + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex-cancel-api.html", "description": "This API returns the status of a migration reindex attempt for a data stream or index" }, "stability": "experimental", diff --git a/specification/_json_spec/indices.create_from.json b/specification/_json_spec/indices.create_from.json index 76fb06d072..342f560d1c 100644 --- a/specification/_json_spec/indices.create_from.json +++ b/specification/_json_spec/indices.create_from.json @@ -1,7 +1,7 @@ { "indices.create_from": { "documentation": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex.html", + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index-from-source.html", "description": "This API creates a destination from a source index. It copies the mappings and settings from the source index while allowing request settings and mappings to override the source values." }, "stability": "experimental", diff --git a/specification/_json_spec/indices.get_migrate_reindex_status.json b/specification/_json_spec/indices.get_migrate_reindex_status.json index 309d44f137..7e027dec38 100644 --- a/specification/_json_spec/indices.get_migrate_reindex_status.json +++ b/specification/_json_spec/indices.get_migrate_reindex_status.json @@ -1,7 +1,7 @@ { "indices.get_migrate_reindex_status": { "documentation": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex.html", + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex-status-api.html", "description": "This API returns the status of a migration reindex attempt for a data stream or index" }, "stability": "experimental", diff --git a/specification/_json_spec/indices.migrate_reindex.json b/specification/_json_spec/indices.migrate_reindex.json index 1f69103497..d1689f7eb9 100644 --- a/specification/_json_spec/indices.migrate_reindex.json +++ b/specification/_json_spec/indices.migrate_reindex.json @@ -1,7 +1,7 @@ { "indices.migrate_reindex": { "documentation": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex.html", + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex-api.html", "description": "This API reindexes all legacy backing indices for a data stream. It does this in a persistent task. The persistent task id is returned immediately, and the reindexing work is completed in that task" }, "stability": "experimental", diff --git a/specification/_json_spec/search_application.put_behavioral_analytics.json b/specification/_json_spec/search_application.put_behavioral_analytics.json index 2b81868508..90b5c11c74 100644 --- a/specification/_json_spec/search_application.put_behavioral_analytics.json +++ b/specification/_json_spec/search_application.put_behavioral_analytics.json @@ -5,11 +5,11 @@ "description": "Creates a behavioral analytics collection." }, "stability": "experimental", - "visibility": "public", "deprecated": { "version": "9.0.0", "description": "Behavioral Analytics has been deprecated and will be removed in a future release." }, + "visibility": "public", "headers": { "accept": ["application/json"] }, From 8aca986405f31fc7eba8e8e1e06320ae479c493e Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 26 Feb 2025 11:32:12 +0400 Subject: [PATCH 2/2] Add master_timeout to ilm.migrate_to_data_tiers --- output/openapi/elasticsearch-openapi.json | 10 ++++++++++ output/schema/schema.json | 15 ++++++++++++++- output/schema/validation-errors.json | 6 ------ output/typescript/types.ts | 1 + .../ilm/migrate_to_data_tiers/Request.ts | 8 ++++++++ 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 7561a970af..41e4696491 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -11270,6 +11270,16 @@ "type": "boolean" }, "style": "form" + }, + { + "in": "query", + "name": "master_timeout", + "description": "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Duration" + }, + "style": "form" } ], "requestBody": { diff --git a/output/schema/schema.json b/output/schema/schema.json index db5c02e547..9fbf58608d 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -127440,9 +127440,22 @@ "namespace": "_builtins" } } + }, + { + "description": "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } } ], - "specLocation": "ilm/migrate_to_data_tiers/Request.ts#L22-L61" + "specLocation": "ilm/migrate_to_data_tiers/Request.ts#L23-L69" }, { "kind": "response", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 530b2a014c..e8645306c9 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -88,12 +88,6 @@ ], "response": [] }, - "ilm.migrate_to_data_tiers": { - "request": [ - "Request: missing json spec query parameter 'master_timeout'" - ], - "response": [] - }, "index": { "request": [ "Request: missing json spec query parameter 'require_data_stream'" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 5535df368b..47bded71fb 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11042,6 +11042,7 @@ export interface IlmGetStatusResponse { export interface IlmMigrateToDataTiersRequest extends RequestBase { dry_run?: boolean + master_timeout?: Duration body?: { legacy_template_to_delete?: string node_attribute?: string diff --git a/specification/ilm/migrate_to_data_tiers/Request.ts b/specification/ilm/migrate_to_data_tiers/Request.ts index 1213488c69..bbcbd2333a 100644 --- a/specification/ilm/migrate_to_data_tiers/Request.ts +++ b/specification/ilm/migrate_to_data_tiers/Request.ts @@ -18,6 +18,7 @@ */ import { RequestBase } from '@_types/Base' +import { Duration } from '@_types/Time' /** * Migrate to data tiers routing. @@ -53,6 +54,13 @@ export interface Request extends RequestBase { * @server_default false */ dry_run?: boolean + /** + * The period to wait for a connection to the master node. + * If no response is received before the timeout expires, the request fails and returns an error. + * It can also be set to `-1` to indicate that the request should never timeout. + * @server_default 30s + */ + master_timeout?: Duration } body: { legacy_template_to_delete?: string