From d5292cab02cfb0e5fb9b9ec0409176b29c2bec98 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 8 Dec 2025 17:40:29 +0400 Subject: [PATCH] Fix cluster.put_component_template API (#5370) * Fix cluster.put_component_template API * Revert "Fix cluster.put_component_template API" This reverts commit 69c9eee0cb67d05a2e7b58348dccd84a572541d4. * Properly use `DataStreamOptions` and fix `cluster.put_component_template` * Also use `IndexTemplateMapping` in `IndicesSimulateIndexTemplateRequest` * Allow `null` for `data_stream_options` * Revert "Also use `IndexTemplateMapping` in `IndicesSimulateIndexTemplateRequest`" This reverts commit 85a3defdfb51896799ca24c84f1bce212da3f949. --------- Co-authored-by: Niels Bauman Co-authored-by: Mary Gouseti (cherry picked from commit 1cd36d69ee3f8e4b113a93dcc43092859e4e5cee) # Conflicts: # output/openapi/elasticsearch-openapi.json # output/openapi/elasticsearch-serverless-openapi.json # output/schema/schema.json --- output/openapi/elasticsearch-openapi.json | 306 +++++++++--------- .../elasticsearch-serverless-openapi.json | 306 +++++++++--------- output/schema/schema.json | 84 ++--- output/typescript/types.ts | 7 +- .../cluster/_types/ComponentTemplate.ts | 4 +- .../ClusterPutComponentTemplateRequest.ts | 4 +- specification/indices/_types/IndexTemplate.ts | 4 +- .../IndicesPutIndexTemplateRequest.ts | 6 + 8 files changed, 372 insertions(+), 349 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 90956087c7..d56085abbf 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -83102,13 +83102,9 @@ }, "data_stream_options": { "x-state": "Generally available; Added in 8.19.0", - "oneOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" - }, + "allOf": [ { - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/indices._types.DataStreamOptions" } ] } @@ -86299,67 +86295,48 @@ "fixed_interval" ] }, - "indices._types.DataStreamOptionsTemplate": { - "description": "Data stream options template contains the same information as DataStreamOptions but allows them to be set explicitly to null.", + "indices._types.DataStreamOptions": { + "description": "Data stream options contain the configuration of data stream level features for a given data stream, for example,\nthe failure store configuration.", "type": "object", "properties": { "failure_store": { - "oneOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamFailureStoreTemplate" - }, + "description": "If defined, it specifies configuration for the failure store of this data stream.", + "allOf": [ { - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/indices._types.DataStreamFailureStore" } ] } } }, - "indices._types.DataStreamFailureStoreTemplate": { - "description": "Template equivalent of DataStreamFailureStore that allows nullable values.", + "indices._types.DataStreamFailureStore": { + "description": "Data stream failure store contains the configuration of the failure store for a given data stream.", "type": "object", "properties": { "enabled": { "description": "If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store.", - "default": "true", - "oneOf": [ - { - "type": "boolean" - }, - { - "nullable": true, - "type": "string" - } - ] + "default": true, + "type": "boolean" }, "lifecycle": { "description": "If defined, it specifies the lifecycle configuration for the failure store of this data stream.", - "oneOf": [ - { - "$ref": "#/components/schemas/indices._types.FailureStoreLifecycleTemplate" - }, + "allOf": [ { - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/indices._types.FailureStoreLifecycle" } ] } } }, - "indices._types.FailureStoreLifecycleTemplate": { - "description": "Template equivalent of FailureStoreLifecycle that allows nullable values.", + "indices._types.FailureStoreLifecycle": { + "description": "The failure store lifecycle configures the data stream lifecycle configuration for failure indices.", "type": "object", "properties": { "data_retention": { "description": "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely.", - "oneOf": [ + "allOf": [ { "$ref": "#/components/schemas/_types.Duration" - }, - { - "nullable": true, - "type": "string" } ] }, @@ -87083,16 +87060,18 @@ "time_in_queue_millis" ] }, - "indices._types.IndexState": { + "indices.put_index_template.IndexTemplateMapping": { "type": "object", "properties": { "aliases": { + "description": "Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options.", "type": "object", "additionalProperties": { "$ref": "#/components/schemas/indices._types.Alias" } }, "mappings": { + "description": "Mapping for fields in the index.\nIf specified, this mapping can include field names, field data types, and mapping parameters.", "allOf": [ { "$ref": "#/components/schemas/_types.mapping.TypeMapping" @@ -87100,33 +87079,30 @@ ] }, "settings": { + "description": "Configuration options for the index.", "allOf": [ { "$ref": "#/components/schemas/indices._types.IndexSettings" } ] }, - "defaults": { - "description": "Default settings, included when the request's `include_default` is `true`.", + "lifecycle": { + "x-state": "Generally available; Added in 8.11.0", "allOf": [ { - "$ref": "#/components/schemas/indices._types.IndexSettings" + "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" } ] }, - "data_stream": { - "allOf": [ + "data_stream_options": { + "x-state": "Generally available; Added in 8.19.0", + "oneOf": [ { - "$ref": "#/components/schemas/_types.DataStreamName" - } - ] - }, - "lifecycle": { - "description": "Data stream lifecycle applicable if this is a data stream.", - "x-state": "Generally available; Added in 8.11.0", - "allOf": [ + "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" + }, { - "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" + "nullable": true, + "type": "string" } ] } @@ -87179,8 +87155,76 @@ } } }, - "_types.DataStreamName": { - "type": "string" + "indices._types.DataStreamOptionsTemplate": { + "description": "Data stream options template contains the same information as DataStreamOptions but allows them to be set explicitly to null.", + "type": "object", + "properties": { + "failure_store": { + "oneOf": [ + { + "$ref": "#/components/schemas/indices._types.DataStreamFailureStoreTemplate" + }, + { + "nullable": true, + "type": "string" + } + ] + } + } + }, + "indices._types.DataStreamFailureStoreTemplate": { + "description": "Template equivalent of DataStreamFailureStore that allows nullable values.", + "type": "object", + "properties": { + "enabled": { + "description": "If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store.", + "default": "true", + "oneOf": [ + { + "type": "boolean" + }, + { + "nullable": true, + "type": "string" + } + ] + }, + "lifecycle": { + "description": "If defined, it specifies the lifecycle configuration for the failure store of this data stream.", + "oneOf": [ + { + "$ref": "#/components/schemas/indices._types.FailureStoreLifecycleTemplate" + }, + { + "nullable": true, + "type": "string" + } + ] + } + } + }, + "indices._types.FailureStoreLifecycleTemplate": { + "description": "Template equivalent of FailureStoreLifecycle that allows nullable values.", + "type": "object", + "properties": { + "data_retention": { + "description": "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely.", + "oneOf": [ + { + "$ref": "#/components/schemas/_types.Duration" + }, + { + "nullable": true, + "type": "string" + } + ] + }, + "enabled": { + "description": "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream.", + "default": true, + "type": "boolean" + } + } }, "cluster.remote_info.ClusterRemoteInfo": { "discriminator": { @@ -94953,6 +94997,9 @@ "failures" ] }, + "_types.DataStreamName": { + "type": "string" + }, "indices.create_from.CreateFrom": { "type": "object", "properties": { @@ -95185,6 +95232,55 @@ "settings" ] }, + "indices._types.IndexState": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/indices._types.Alias" + } + }, + "mappings": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.mapping.TypeMapping" + } + ] + }, + "settings": { + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.IndexSettings" + } + ] + }, + "defaults": { + "description": "Default settings, included when the request's `include_default` is `true`.", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.IndexSettings" + } + ] + }, + "data_stream": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.DataStreamName" + } + ] + }, + "lifecycle": { + "description": "Data stream lifecycle applicable if this is a data stream.", + "x-state": "Generally available; Added in 8.11.0", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" + } + ] + } + } + }, "indices.get_alias._types.IndexAliases": { "type": "object", "properties": { @@ -95495,58 +95591,6 @@ "name" ] }, - "indices._types.DataStreamOptions": { - "description": "Data stream options contain the configuration of data stream level features for a given data stream, for example,\nthe failure store configuration.", - "type": "object", - "properties": { - "failure_store": { - "description": "If defined, it specifies configuration for the failure store of this data stream.", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamFailureStore" - } - ] - } - } - }, - "indices._types.DataStreamFailureStore": { - "description": "Data stream failure store contains the configuration of the failure store for a given data stream.", - "type": "object", - "properties": { - "enabled": { - "description": "If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store.", - "default": true, - "type": "boolean" - }, - "lifecycle": { - "description": "If defined, it specifies the lifecycle configuration for the failure store of this data stream.", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.FailureStoreLifecycle" - } - ] - } - } - }, - "indices._types.FailureStoreLifecycle": { - "description": "The failure store lifecycle configures the data stream lifecycle configuration for failure indices.", - "type": "object", - "properties": { - "data_retention": { - "description": "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely.", - "allOf": [ - { - "$ref": "#/components/schemas/_types.Duration" - } - ] - }, - "enabled": { - "description": "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream.", - "default": true, - "type": "boolean" - } - } - }, "indices.get_data_stream_settings.DataStreamSettings": { "type": "object", "properties": { @@ -95747,13 +95791,9 @@ }, "data_stream_options": { "x-state": "Generally available; Added in 8.19.0", - "oneOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" - }, + "allOf": [ { - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/indices._types.DataStreamOptions" } ] } @@ -96072,42 +96112,6 @@ "error" ] }, - "indices.put_index_template.IndexTemplateMapping": { - "type": "object", - "properties": { - "aliases": { - "description": "Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options.", - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/indices._types.Alias" - } - }, - "mappings": { - "description": "Mapping for fields in the index.\nIf specified, this mapping can include field names, field data types, and mapping parameters.", - "allOf": [ - { - "$ref": "#/components/schemas/_types.mapping.TypeMapping" - } - ] - }, - "settings": { - "description": "Configuration options for the index.", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.IndexSettings" - } - ] - }, - "lifecycle": { - "x-state": "Generally available; Added in 8.11.0", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" - } - ] - } - } - }, "indices._types.DataStreamVisibility": { "type": "object", "properties": { @@ -144615,7 +144619,7 @@ "description": "The template to be applied which includes mappings, settings, or aliases configuration.", "allOf": [ { - "$ref": "#/components/schemas/indices._types.IndexState" + "$ref": "#/components/schemas/indices.put_index_template.IndexTemplateMapping" } ] }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index d4bb7a8f6d..19c595edb8 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -48364,13 +48364,9 @@ }, "data_stream_options": { "x-state": "Generally available", - "oneOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" - }, + "allOf": [ { - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/indices._types.DataStreamOptions" } ] } @@ -58406,67 +58402,48 @@ "fixed_interval" ] }, - "indices._types.DataStreamOptionsTemplate": { - "description": "Data stream options template contains the same information as DataStreamOptions but allows them to be set explicitly to null.", + "indices._types.DataStreamOptions": { + "description": "Data stream options contain the configuration of data stream level features for a given data stream, for example,\nthe failure store configuration.", "type": "object", "properties": { "failure_store": { - "oneOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamFailureStoreTemplate" - }, + "description": "If defined, it specifies configuration for the failure store of this data stream.", + "allOf": [ { - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/indices._types.DataStreamFailureStore" } ] } } }, - "indices._types.DataStreamFailureStoreTemplate": { - "description": "Template equivalent of DataStreamFailureStore that allows nullable values.", + "indices._types.DataStreamFailureStore": { + "description": "Data stream failure store contains the configuration of the failure store for a given data stream.", "type": "object", "properties": { "enabled": { "description": "If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store.", - "default": "true", - "oneOf": [ - { - "type": "boolean" - }, - { - "nullable": true, - "type": "string" - } - ] + "default": true, + "type": "boolean" }, "lifecycle": { "description": "If defined, it specifies the lifecycle configuration for the failure store of this data stream.", - "oneOf": [ - { - "$ref": "#/components/schemas/indices._types.FailureStoreLifecycleTemplate" - }, + "allOf": [ { - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/indices._types.FailureStoreLifecycle" } ] } } }, - "indices._types.FailureStoreLifecycleTemplate": { - "description": "Template equivalent of FailureStoreLifecycle that allows nullable values.", + "indices._types.FailureStoreLifecycle": { + "description": "The failure store lifecycle configures the data stream lifecycle configuration for failure indices.", "type": "object", "properties": { "data_retention": { "description": "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely.", - "oneOf": [ + "allOf": [ { "$ref": "#/components/schemas/_types.Duration" - }, - { - "nullable": true, - "type": "string" } ] }, @@ -58790,16 +58767,18 @@ } } }, - "indices._types.IndexState": { + "indices.put_index_template.IndexTemplateMapping": { "type": "object", "properties": { "aliases": { + "description": "Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options.", "type": "object", "additionalProperties": { "$ref": "#/components/schemas/indices._types.Alias" } }, "mappings": { + "description": "Mapping for fields in the index.\nIf specified, this mapping can include field names, field data types, and mapping parameters.", "allOf": [ { "$ref": "#/components/schemas/_types.mapping.TypeMapping" @@ -58807,33 +58786,30 @@ ] }, "settings": { + "description": "Configuration options for the index.", "allOf": [ { "$ref": "#/components/schemas/indices._types.IndexSettings" } ] }, - "defaults": { - "description": "Default settings, included when the request's `include_default` is `true`.", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.IndexSettings" - } - ] - }, - "data_stream": { + "lifecycle": { + "x-state": "Generally available", "allOf": [ { - "$ref": "#/components/schemas/_types.DataStreamName" + "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" } ] }, - "lifecycle": { - "description": "Data stream lifecycle applicable if this is a data stream.", + "data_stream_options": { "x-state": "Generally available", - "allOf": [ + "oneOf": [ { - "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" + "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" + }, + { + "nullable": true, + "type": "string" } ] } @@ -58886,8 +58862,76 @@ } } }, - "_types.DataStreamName": { - "type": "string" + "indices._types.DataStreamOptionsTemplate": { + "description": "Data stream options template contains the same information as DataStreamOptions but allows them to be set explicitly to null.", + "type": "object", + "properties": { + "failure_store": { + "oneOf": [ + { + "$ref": "#/components/schemas/indices._types.DataStreamFailureStoreTemplate" + }, + { + "nullable": true, + "type": "string" + } + ] + } + } + }, + "indices._types.DataStreamFailureStoreTemplate": { + "description": "Template equivalent of DataStreamFailureStore that allows nullable values.", + "type": "object", + "properties": { + "enabled": { + "description": "If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store.", + "default": "true", + "oneOf": [ + { + "type": "boolean" + }, + { + "nullable": true, + "type": "string" + } + ] + }, + "lifecycle": { + "description": "If defined, it specifies the lifecycle configuration for the failure store of this data stream.", + "oneOf": [ + { + "$ref": "#/components/schemas/indices._types.FailureStoreLifecycleTemplate" + }, + { + "nullable": true, + "type": "string" + } + ] + } + } + }, + "indices._types.FailureStoreLifecycleTemplate": { + "description": "Template equivalent of FailureStoreLifecycle that allows nullable values.", + "type": "object", + "properties": { + "data_retention": { + "description": "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely.", + "oneOf": [ + { + "$ref": "#/components/schemas/_types.Duration" + }, + { + "nullable": true, + "type": "string" + } + ] + }, + "enabled": { + "description": "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream.", + "default": true, + "type": "boolean" + } + } }, "_types.Result": { "type": "string", @@ -61513,6 +61557,9 @@ "type" ] }, + "_types.DataStreamName": { + "type": "string" + }, "indices.data_streams_stats.DataStreamsStatsItem": { "type": "object", "properties": { @@ -61688,6 +61735,55 @@ "settings" ] }, + "indices._types.IndexState": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/indices._types.Alias" + } + }, + "mappings": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.mapping.TypeMapping" + } + ] + }, + "settings": { + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.IndexSettings" + } + ] + }, + "defaults": { + "description": "Default settings, included when the request's `include_default` is `true`.", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.IndexSettings" + } + ] + }, + "data_stream": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.DataStreamName" + } + ] + }, + "lifecycle": { + "description": "Data stream lifecycle applicable if this is a data stream.", + "x-state": "Generally available", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" + } + ] + } + } + }, "indices.get_alias._types.IndexAliases": { "type": "object", "properties": { @@ -61972,58 +62068,6 @@ "name" ] }, - "indices._types.DataStreamOptions": { - "description": "Data stream options contain the configuration of data stream level features for a given data stream, for example,\nthe failure store configuration.", - "type": "object", - "properties": { - "failure_store": { - "description": "If defined, it specifies configuration for the failure store of this data stream.", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamFailureStore" - } - ] - } - } - }, - "indices._types.DataStreamFailureStore": { - "description": "Data stream failure store contains the configuration of the failure store for a given data stream.", - "type": "object", - "properties": { - "enabled": { - "description": "If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store.", - "default": true, - "type": "boolean" - }, - "lifecycle": { - "description": "If defined, it specifies the lifecycle configuration for the failure store of this data stream.", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.FailureStoreLifecycle" - } - ] - } - } - }, - "indices._types.FailureStoreLifecycle": { - "description": "The failure store lifecycle configures the data stream lifecycle configuration for failure indices.", - "type": "object", - "properties": { - "data_retention": { - "description": "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely.", - "allOf": [ - { - "$ref": "#/components/schemas/_types.Duration" - } - ] - }, - "enabled": { - "description": "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream.", - "default": true, - "type": "boolean" - } - } - }, "indices.get_data_stream_settings.DataStreamSettings": { "type": "object", "properties": { @@ -62190,13 +62234,9 @@ }, "data_stream_options": { "x-state": "Generally available", - "oneOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" - }, + "allOf": [ { - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/indices._types.DataStreamOptions" } ] } @@ -62388,42 +62428,6 @@ "error" ] }, - "indices.put_index_template.IndexTemplateMapping": { - "type": "object", - "properties": { - "aliases": { - "description": "Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options.", - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/indices._types.Alias" - } - }, - "mappings": { - "description": "Mapping for fields in the index.\nIf specified, this mapping can include field names, field data types, and mapping parameters.", - "allOf": [ - { - "$ref": "#/components/schemas/_types.mapping.TypeMapping" - } - ] - }, - "settings": { - "description": "Configuration options for the index.", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.IndexSettings" - } - ] - }, - "lifecycle": { - "x-state": "Generally available", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" - } - ] - } - } - }, "indices._types.DataStreamVisibility": { "type": "object", "properties": { @@ -87068,7 +87072,7 @@ "description": "The template to be applied which includes mappings, settings, or aliases configuration.", "allOf": [ { - "$ref": "#/components/schemas/indices._types.IndexState" + "$ref": "#/components/schemas/indices.put_index_template.IndexTemplateMapping" } ] }, diff --git a/output/schema/schema.json b/output/schema/schema.json index bdd749d78e..0c75721203 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -121572,23 +121572,11 @@ "name": "data_stream_options", "required": false, "type": { - "kind": "union_of", - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DataStreamOptionsTemplate", - "namespace": "indices._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "null", - "namespace": "_builtins" - } - } - ] + "kind": "instance_of", + "type": { + "name": "DataStreamOptions", + "namespace": "indices._types" + } } } ], @@ -124721,8 +124709,8 @@ "type": { "kind": "instance_of", "type": { - "name": "IndexState", - "namespace": "indices._types" + "name": "IndexTemplateMapping", + "namespace": "indices.put_index_template" } } }, @@ -148954,23 +148942,11 @@ "name": "data_stream_options", "required": false, "type": { - "kind": "union_of", - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DataStreamOptionsTemplate", - "namespace": "indices._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "null", - "namespace": "_builtins" - } - } - ] + "kind": "instance_of", + "type": { + "name": "DataStreamOptions", + "namespace": "indices._types" + } } } ], @@ -160323,9 +160299,41 @@ "namespace": "indices._types" } } + }, + { + "availability": { + "serverless": { + "stability": "stable" + }, + "stack": { + "since": "8.19.0", + "stability": "stable" + } + }, + "name": "data_stream_options", + "required": false, + "type": { + "kind": "union_of", + "items": [ + { + "kind": "instance_of", + "type": { + "name": "DataStreamOptionsTemplate", + "namespace": "indices._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "null", + "namespace": "_builtins" + } + } + ] + } } ], - "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L165-L187" + "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L166-L193" }, { "kind": "request", @@ -160596,7 +160604,7 @@ } } ], - "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L38-L163" + "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L39-L164" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3d8f1f1306..9818e3e8d0 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9542,7 +9542,7 @@ export interface ClusterComponentTemplateSummary { mappings?: MappingTypeMapping aliases?: Record lifecycle?: IndicesDataStreamLifecycleWithRollover - data_stream_options?: IndicesDataStreamOptionsTemplate | null + data_stream_options?: IndicesDataStreamOptions } export interface ClusterAllocationExplainAllocationDecision { @@ -9825,7 +9825,7 @@ export interface ClusterPutComponentTemplateRequest extends RequestBase { cause?: string master_timeout?: Duration body?: { - template: IndicesIndexState + template: IndicesPutIndexTemplateIndexTemplateMapping version?: VersionNumber _meta?: Metadata deprecated?: boolean @@ -12129,7 +12129,7 @@ export interface IndicesIndexTemplateSummary { mappings?: MappingTypeMapping settings?: IndicesIndexSettings lifecycle?: IndicesDataStreamLifecycleWithRollover - data_stream_options?: IndicesDataStreamOptionsTemplate | null + data_stream_options?: IndicesDataStreamOptions } export interface IndicesIndexVersioning { @@ -13160,6 +13160,7 @@ export interface IndicesPutIndexTemplateIndexTemplateMapping { mappings?: MappingTypeMapping settings?: IndicesIndexSettings lifecycle?: IndicesDataStreamLifecycle + data_stream_options?: IndicesDataStreamOptionsTemplate | null } export interface IndicesPutIndexTemplateRequest extends RequestBase { diff --git a/specification/cluster/_types/ComponentTemplate.ts b/specification/cluster/_types/ComponentTemplate.ts index 2c9c497157..0e9b0cb1c0 100644 --- a/specification/cluster/_types/ComponentTemplate.ts +++ b/specification/cluster/_types/ComponentTemplate.ts @@ -21,7 +21,7 @@ import { IndexName, Metadata, Name, VersionNumber } from '@_types/common' import { TypeMapping } from '@_types/mapping/TypeMapping' import { AliasDefinition } from '@indices/_types/AliasDefinition' import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle' -import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions' +import { DataStreamOptions } from '@indices/_types/DataStreamOptions' import { IndexSettings } from '@indices/_types/IndexSettings' import { Dictionary } from '@spec_utils/Dictionary' @@ -57,5 +57,5 @@ export class ComponentTemplateSummary { * @availability stack since=8.19.0 stability=stable * @availability serverless stability=stable */ - data_stream_options?: DataStreamOptionsTemplate | null + data_stream_options?: DataStreamOptions } diff --git a/specification/cluster/put_component_template/ClusterPutComponentTemplateRequest.ts b/specification/cluster/put_component_template/ClusterPutComponentTemplateRequest.ts index 22149e5d01..d9005992b8 100644 --- a/specification/cluster/put_component_template/ClusterPutComponentTemplateRequest.ts +++ b/specification/cluster/put_component_template/ClusterPutComponentTemplateRequest.ts @@ -20,7 +20,7 @@ import { RequestBase } from '@_types/Base' import { MediaType, Metadata, Name, VersionNumber } from '@_types/common' import { Duration } from '@_types/Time' -import { IndexState } from '@indices/_types/IndexState' +import { IndexTemplateMapping } from '@indices/put_index_template/IndicesPutIndexTemplateRequest' /** * Create or update a component template. @@ -89,7 +89,7 @@ export interface Request extends RequestBase { /** * The template to be applied which includes mappings, settings, or aliases configuration. */ - template: IndexState + template: IndexTemplateMapping /** * Version number used to manage component templates externally. * This number isn't automatically generated or incremented by Elasticsearch. diff --git a/specification/indices/_types/IndexTemplate.ts b/specification/indices/_types/IndexTemplate.ts index 11bc360164..6a8ef164e2 100644 --- a/specification/indices/_types/IndexTemplate.ts +++ b/specification/indices/_types/IndexTemplate.ts @@ -21,7 +21,7 @@ import { IndexName, Metadata, Name, Names, VersionNumber } from '@_types/common' import { TypeMapping } from '@_types/mapping/TypeMapping' import { long } from '@_types/Numeric' import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle' -import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions' +import { DataStreamOptions } from '@indices/_types/DataStreamOptions' import { Dictionary } from '@spec_utils/Dictionary' import { Alias } from './Alias' import { IndexSettings } from './IndexSettings' @@ -120,5 +120,5 @@ export class IndexTemplateSummary { * @availability stack since=8.19.0 stability=stable * @availability serverless stability=stable */ - data_stream_options?: DataStreamOptionsTemplate | null + data_stream_options?: DataStreamOptions } diff --git a/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts b/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts index f60275bfc2..798dd5410b 100644 --- a/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts +++ b/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts @@ -32,6 +32,7 @@ import { Duration } from '@_types/Time' import { Alias } from '@indices/_types/Alias' import { DataStreamVisibility } from '@indices/_types/DataStream' import { DataStreamLifecycle } from '@indices/_types/DataStreamLifecycle' +import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions' import { IndexSettings } from '@indices/_types/IndexSettings' import { Dictionary } from '@spec_utils/Dictionary' @@ -184,4 +185,9 @@ export class IndexTemplateMapping { * @availability serverless stability=stable */ lifecycle?: DataStreamLifecycle + /** + * @availability stack since=8.19.0 stability=stable + * @availability serverless stability=stable + */ + data_stream_options?: DataStreamOptionsTemplate | null }