From 69c9eee0cb67d05a2e7b58348dccd84a572541d4 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 30 Sep 2025 10:25:16 +0400 Subject: [PATCH 1/3] Fix cluster.put_component_template API --- output/openapi/elasticsearch-openapi.json | 8 +++++++ .../elasticsearch-serverless-openapi.json | 8 +++++++ output/schema/schema.json | 22 ++++++++++++++++++- output/typescript/types.ts | 1 + specification/indices/_types/IndexState.ts | 6 +++++ 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index a416aedf9f..c47c4a4809 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -88635,6 +88635,14 @@ } ] }, + "data_stream_options": { + "x-state": "Generally available; Added in 8.18.0", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" + } + ] + }, "lifecycle": { "description": "Data stream lifecycle applicable if this is a data stream.", "x-state": "Generally available; Added in 8.11.0", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 2431ed80ef..73539e932d 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -60504,6 +60504,14 @@ } ] }, + "data_stream_options": { + "x-state": "Generally available", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" + } + ] + }, "lifecycle": { "description": "Data stream lifecycle applicable if this is a data stream.", "x-state": "Generally available", diff --git a/output/schema/schema.json b/output/schema/schema.json index 75a2b0e795..e7cd552c26 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -149348,6 +149348,26 @@ } } }, + { + "availability": { + "serverless": { + "stability": "stable" + }, + "stack": { + "since": "8.18.0", + "stability": "stable" + } + }, + "name": "data_stream_options", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DataStreamOptionsTemplate", + "namespace": "indices._types" + } + } + }, { "availability": { "serverless": { @@ -149370,7 +149390,7 @@ } } ], - "specLocation": "indices/_types/IndexState.ts#L27-L40" + "specLocation": "indices/_types/IndexState.ts#L28-L46" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 04b2414291..90aa5440e0 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11981,6 +11981,7 @@ export interface IndicesIndexState { settings?: IndicesIndexSettings defaults?: IndicesIndexSettings data_stream?: DataStreamName + data_stream_options?: IndicesDataStreamOptionsTemplate lifecycle?: IndicesDataStreamLifecycle } diff --git a/specification/indices/_types/IndexState.ts b/specification/indices/_types/IndexState.ts index 4c0bc3c81c..317ac2eb03 100644 --- a/specification/indices/_types/IndexState.ts +++ b/specification/indices/_types/IndexState.ts @@ -22,6 +22,7 @@ import { TypeMapping } from '@_types/mapping/TypeMapping' import { DataStreamLifecycle } from '@indices/_types/DataStreamLifecycle' import { Dictionary } from '@spec_utils/Dictionary' import { Alias } from './Alias' +import { DataStreamOptionsTemplate } from './DataStreamOptions' import { IndexSettings } from './IndexSettings' export class IndexState { @@ -31,6 +32,11 @@ export class IndexState { /** Default settings, included when the request's `include_default` is `true`. */ defaults?: IndexSettings data_stream?: DataStreamName + /** + * @availability stack since=8.18.0 stability=stable + * @availability serverless stability=stable + */ + data_stream_options?: DataStreamOptionsTemplate /** * Data stream lifecycle applicable if this is a data stream. * @availability stack since=8.11.0 stability=stable From 1de905b2f274e9bfee00ad23085605b01c806ad2 Mon Sep 17 00:00:00 2001 From: Niels Bauman Date: Tue, 30 Sep 2025 15:27:42 -0300 Subject: [PATCH 2/3] Revert "Fix cluster.put_component_template API" This reverts commit 69c9eee0cb67d05a2e7b58348dccd84a572541d4. --- output/openapi/elasticsearch-openapi.json | 8 ------- .../elasticsearch-serverless-openapi.json | 8 ------- output/schema/schema.json | 22 +------------------ output/typescript/types.ts | 1 - specification/indices/_types/IndexState.ts | 6 ----- 5 files changed, 1 insertion(+), 44 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index c47c4a4809..a416aedf9f 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -88635,14 +88635,6 @@ } ] }, - "data_stream_options": { - "x-state": "Generally available; Added in 8.18.0", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" - } - ] - }, "lifecycle": { "description": "Data stream lifecycle applicable if this is a data stream.", "x-state": "Generally available; Added in 8.11.0", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 73539e932d..2431ed80ef 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -60504,14 +60504,6 @@ } ] }, - "data_stream_options": { - "x-state": "Generally available", - "allOf": [ - { - "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" - } - ] - }, "lifecycle": { "description": "Data stream lifecycle applicable if this is a data stream.", "x-state": "Generally available", diff --git a/output/schema/schema.json b/output/schema/schema.json index e7cd552c26..75a2b0e795 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -149348,26 +149348,6 @@ } } }, - { - "availability": { - "serverless": { - "stability": "stable" - }, - "stack": { - "since": "8.18.0", - "stability": "stable" - } - }, - "name": "data_stream_options", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "DataStreamOptionsTemplate", - "namespace": "indices._types" - } - } - }, { "availability": { "serverless": { @@ -149390,7 +149370,7 @@ } } ], - "specLocation": "indices/_types/IndexState.ts#L28-L46" + "specLocation": "indices/_types/IndexState.ts#L27-L40" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 90aa5440e0..04b2414291 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11981,7 +11981,6 @@ export interface IndicesIndexState { settings?: IndicesIndexSettings defaults?: IndicesIndexSettings data_stream?: DataStreamName - data_stream_options?: IndicesDataStreamOptionsTemplate lifecycle?: IndicesDataStreamLifecycle } diff --git a/specification/indices/_types/IndexState.ts b/specification/indices/_types/IndexState.ts index 317ac2eb03..4c0bc3c81c 100644 --- a/specification/indices/_types/IndexState.ts +++ b/specification/indices/_types/IndexState.ts @@ -22,7 +22,6 @@ import { TypeMapping } from '@_types/mapping/TypeMapping' import { DataStreamLifecycle } from '@indices/_types/DataStreamLifecycle' import { Dictionary } from '@spec_utils/Dictionary' import { Alias } from './Alias' -import { DataStreamOptionsTemplate } from './DataStreamOptions' import { IndexSettings } from './IndexSettings' export class IndexState { @@ -32,11 +31,6 @@ export class IndexState { /** Default settings, included when the request's `include_default` is `true`. */ defaults?: IndexSettings data_stream?: DataStreamName - /** - * @availability stack since=8.18.0 stability=stable - * @availability serverless stability=stable - */ - data_stream_options?: DataStreamOptionsTemplate /** * Data stream lifecycle applicable if this is a data stream. * @availability stack since=8.11.0 stability=stable From 30176b8c495be1107b93add352cdddb542d4b684 Mon Sep 17 00:00:00 2001 From: Niels Bauman Date: Tue, 30 Sep 2025 15:50:54 -0300 Subject: [PATCH 3/3] Properly use `DataStreamOptions` and fix `cluster.put_component_template` --- output/openapi/elasticsearch-openapi.json | 302 +++++++++--------- .../elasticsearch-serverless-openapi.json | 300 ++++++++--------- output/schema/schema.json | 72 ++--- 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, 351 insertions(+), 348 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index a416aedf9f..615390c875 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -84573,13 +84573,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" } ] } @@ -87813,67 +87809,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" } ] }, @@ -88597,16 +88574,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" @@ -88614,33 +88593,26 @@ ] }, "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; Added in 8.11.0", "allOf": [ { - "$ref": "#/components/schemas/_types.DataStreamName" + "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" } ] }, - "lifecycle": { - "description": "Data stream lifecycle applicable if this is a data stream.", - "x-state": "Generally available; Added in 8.11.0", + "data_stream_options": { + "x-state": "Generally available; Added in 8.19.0", "allOf": [ { - "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" + "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" } ] } @@ -88693,8 +88665,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": { @@ -96341,6 +96381,9 @@ "failures" ] }, + "_types.DataStreamName": { + "type": "string" + }, "indices.create_from.CreateFrom": { "type": "object", "properties": { @@ -96573,6 +96616,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": { @@ -96946,58 +97038,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": { @@ -97234,13 +97274,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" } ] } @@ -97600,42 +97636,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": { @@ -145629,7 +145629,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 2431ed80ef..1430319c07 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -49964,13 +49964,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" } ] } @@ -60082,67 +60078,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" } ] }, @@ -60466,16 +60443,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" @@ -60483,33 +60462,26 @@ ] }, "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": [ { - "$ref": "#/components/schemas/indices._types.DataStreamLifecycle" + "$ref": "#/components/schemas/indices._types.DataStreamOptionsTemplate" } ] } @@ -60562,8 +60534,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", @@ -62856,6 +62896,9 @@ "type" ] }, + "_types.DataStreamName": { + "type": "string" + }, "indices.create_from.CreateFrom": { "type": "object", "properties": { @@ -63014,6 +63057,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": { @@ -63361,58 +63453,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": { @@ -63615,13 +63655,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" } ] } @@ -63854,42 +63890,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": { @@ -88414,7 +88414,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 75a2b0e795..58d1b1b4b2 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -122461,23 +122461,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" + } } } ], @@ -125658,8 +125646,8 @@ "type": { "kind": "instance_of", "type": { - "name": "IndexState", - "namespace": "indices._types" + "name": "IndexTemplateMapping", + "namespace": "indices.put_index_template" } } }, @@ -149731,23 +149719,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" + } } } ], @@ -161304,9 +161280,29 @@ "namespace": "indices._types" } } + }, + { + "availability": { + "serverless": { + "stability": "stable" + }, + "stack": { + "since": "8.19.0", + "stability": "stable" + } + }, + "name": "data_stream_options", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DataStreamOptionsTemplate", + "namespace": "indices._types" + } + } } ], - "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L159-L181" + "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L160-L187" }, { "kind": "request", @@ -161568,7 +161564,7 @@ } } ], - "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L37-L157" + "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L38-L158" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 04b2414291..f1c5251aa0 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9434,7 +9434,7 @@ export interface ClusterComponentTemplateSummary { mappings?: MappingTypeMapping aliases?: Record lifecycle?: IndicesDataStreamLifecycleWithRollover - data_stream_options?: IndicesDataStreamOptionsTemplate | null + data_stream_options?: IndicesDataStreamOptions } export interface ClusterAllocationExplainAllocationDecision { @@ -9721,7 +9721,7 @@ export interface ClusterPutComponentTemplateRequest extends RequestBase { cause?: string master_timeout?: Duration body?: { - template: IndicesIndexState + template: IndicesPutIndexTemplateIndexTemplateMapping version?: VersionNumber _meta?: Metadata deprecated?: boolean @@ -12011,7 +12011,7 @@ export interface IndicesIndexTemplateSummary { mappings?: MappingTypeMapping settings?: IndicesIndexSettings lifecycle?: IndicesDataStreamLifecycleWithRollover - data_stream_options?: IndicesDataStreamOptionsTemplate | null + data_stream_options?: IndicesDataStreamOptions } export interface IndicesIndexVersioning { @@ -13076,6 +13076,7 @@ export interface IndicesPutIndexTemplateIndexTemplateMapping { mappings?: MappingTypeMapping settings?: IndicesIndexSettings lifecycle?: IndicesDataStreamLifecycle + data_stream_options?: IndicesDataStreamOptionsTemplate } export interface IndicesPutIndexTemplateRequest extends RequestBase { diff --git a/specification/cluster/_types/ComponentTemplate.ts b/specification/cluster/_types/ComponentTemplate.ts index 932a561ed2..f3e2d36318 100644 --- a/specification/cluster/_types/ComponentTemplate.ts +++ b/specification/cluster/_types/ComponentTemplate.ts @@ -22,7 +22,7 @@ import { TypeMapping } from '@_types/mapping/TypeMapping' import { DateTime, EpochTime, UnitMillis } from '@_types/Time' 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' @@ -82,5 +82,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 4701e5cadb..7a5eff4626 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 { 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. @@ -87,7 +87,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 b25a8a661c..28831a4f6c 100644 --- a/specification/indices/_types/IndexTemplate.ts +++ b/specification/indices/_types/IndexTemplate.ts @@ -22,7 +22,7 @@ import { TypeMapping } from '@_types/mapping/TypeMapping' import { long } from '@_types/Numeric' import { DateTime, EpochTime, UnitMillis } from '@_types/Time' 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' @@ -145,5 +145,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 52bbd20df8..5d8b57fe56 100644 --- a/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts +++ b/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts @@ -31,6 +31,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' @@ -178,4 +179,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 }