From 545c9ee9fe2ec2737955bfe4c2c04f5f59364b34 Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Mon, 10 Mar 2025 14:06:19 -0600 Subject: [PATCH 1/2] Add the index mode to the output of get-data-stream API. Relates to https://github.com/elastic/elasticsearch/pull/122486 --- output/schema/schema.json | 56 ++++++++++++++++++++-- output/typescript/types.ts | 4 ++ specification/indices/_types/DataStream.ts | 16 +++++++ 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 6b56e317ef..089fee221e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -128571,9 +128571,21 @@ "namespace": "indices._types" } } + }, + { + "description": "The index mode for the data stream that will be used for newly created backing indices.", + "name": "index_mode", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexMode", + "namespace": "indices._types" + } + } } ], - "specLocation": "indices/_types/DataStream.ts#L45-L127" + "specLocation": "indices/_types/DataStream.ts#L53-L139" }, { "kind": "interface", @@ -128641,9 +128653,21 @@ "namespace": "_builtins" } } + }, + { + "description": "The index mode of this backing index of the data stream.", + "name": "index_mode", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexMode", + "namespace": "indices._types" + } + } } ], - "specLocation": "indices/_types/DataStream.ts#L136-L157" + "specLocation": "indices/_types/DataStream.ts#L148-L173" }, { "kind": "interface", @@ -128887,7 +128911,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L129-L134" + "specLocation": "indices/_types/DataStream.ts#L141-L146" }, { "kind": "interface", @@ -128919,7 +128943,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L159-L162" + "specLocation": "indices/_types/DataStream.ts#L175-L178" }, { "kind": "interface", @@ -129021,7 +129045,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L39-L43" + "specLocation": "indices/_types/DataStream.ts#L47-L51" }, { "kind": "interface", @@ -129086,6 +129110,28 @@ }, "specLocation": "indices/_types/IndexSettings.ts#L270-L277" }, + { + "kind": "enum", + "members": [ + { + "name": "standard" + }, + { + "name": "time_series" + }, + { + "name": "logsdb" + }, + { + "name": "lookup" + } + ], + "name": { + "name": "IndexMode", + "namespace": "indices._types" + }, + "specLocation": "indices/_types/DataStream.ts#L40-L45" + }, { "kind": "interface", "name": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 10487650e5..10354dd50e 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11157,6 +11157,7 @@ export interface IndicesDataStream { system?: boolean template: Name timestamp_field: IndicesDataStreamTimestampField + index_mode?: IndicesIndexMode } export interface IndicesDataStreamIndex { @@ -11165,6 +11166,7 @@ export interface IndicesDataStreamIndex { ilm_policy?: Name managed_by?: IndicesManagedBy prefer_ilm?: boolean + index_mode?: IndicesIndexMode } export interface IndicesDataStreamLifecycle { @@ -11226,6 +11228,8 @@ export interface IndicesFielddataFrequencyFilter { export type IndicesIndexCheckOnStartup = boolean | 'true' | 'false' | 'checksum' +export type IndicesIndexMode = 'standard' | 'time_series' | 'logsdb' | 'lookup' + export interface IndicesIndexRouting { allocation?: IndicesIndexRoutingAllocation rebalance?: IndicesIndexRoutingRebalance diff --git a/specification/indices/_types/DataStream.ts b/specification/indices/_types/DataStream.ts index b416ef5383..d3fb857ccf 100644 --- a/specification/indices/_types/DataStream.ts +++ b/specification/indices/_types/DataStream.ts @@ -36,6 +36,14 @@ enum ManagedBy { unmanaged = 'Unmanaged' } +// Available index modes (for the `index.mode` setting) See the `IndexMode` class in Elasticsearch for the options. +export enum IndexMode { + standard, + time_series, + logsdb, + lookup +} + export class FailureStore { enabled: boolean indices: DataStreamIndex[] @@ -124,6 +132,10 @@ export class DataStream { * Information about the `@timestamp` field in the data stream. */ timestamp_field: DataStreamTimestampField + /** + * The index mode for the data stream that will be used for newly created backing indices. + */ + index_mode?: IndexMode } export class DataStreamTimestampField { @@ -154,6 +166,10 @@ export class DataStreamIndex { * Indicates if ILM should take precedence over DSL in case both are configured to manage this index. */ prefer_ilm?: boolean + /** + * The index mode of this backing index of the data stream. + */ + index_mode?: IndexMode } export class DataStreamVisibility { From b65d48eeab1775fb130a1d3a0b0bcf631864542b Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 14 Mar 2025 11:00:14 +0400 Subject: [PATCH 2/2] Run make contrib --- output/openapi/elasticsearch-openapi.json | 15 +++++ .../elasticsearch-serverless-openapi.json | 15 +++++ output/schema/schema-serverless.json | 56 +++++++++++++++++-- specification/indices/_types/DataStream.ts | 8 +-- 4 files changed, 85 insertions(+), 9 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index df0a8eda4d..b9f53a5d9e 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -72360,6 +72360,9 @@ }, "timestamp_field": { "$ref": "#/components/schemas/indices._types:DataStreamTimestampField" + }, + "index_mode": { + "$ref": "#/components/schemas/indices._types:IndexMode" } }, "required": [ @@ -72415,6 +72418,9 @@ "prefer_ilm": { "description": "Indicates if ILM should take precedence over DSL in case both are configured to manage this index.", "type": "boolean" + }, + "index_mode": { + "$ref": "#/components/schemas/indices._types:IndexMode" } }, "required": [ @@ -72430,6 +72436,15 @@ "Unmanaged" ] }, + "indices._types:IndexMode": { + "type": "string", + "enum": [ + "standard", + "time_series", + "logsdb", + "lookup" + ] + }, "indices._types:DataStreamTimestampField": { "type": "object", "properties": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index c4cb3a220c..c5187f97d4 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -46172,6 +46172,9 @@ }, "timestamp_field": { "$ref": "#/components/schemas/indices._types:DataStreamTimestampField" + }, + "index_mode": { + "$ref": "#/components/schemas/indices._types:IndexMode" } }, "required": [ @@ -46227,6 +46230,9 @@ "prefer_ilm": { "description": "Indicates if ILM should take precedence over DSL in case both are configured to manage this index.", "type": "boolean" + }, + "index_mode": { + "$ref": "#/components/schemas/indices._types:IndexMode" } }, "required": [ @@ -46242,6 +46248,15 @@ "Unmanaged" ] }, + "indices._types:IndexMode": { + "type": "string", + "enum": [ + "standard", + "time_series", + "logsdb", + "lookup" + ] + }, "indices._types:DataStreamTimestampField": { "type": "object", "properties": { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index b9d0371627..50afe39c58 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -97017,6 +97017,28 @@ }, "specLocation": "indices/_types/IndexSettings.ts#L270-L277" }, + { + "kind": "enum", + "members": [ + { + "name": "standard" + }, + { + "name": "time_series" + }, + { + "name": "logsdb" + }, + { + "name": "lookup" + } + ], + "name": { + "name": "IndexMode", + "namespace": "indices._types" + }, + "specLocation": "indices/_types/DataStream.ts#L40-L45" + }, { "kind": "enum", "members": [ @@ -123009,9 +123031,21 @@ "namespace": "indices._types" } } + }, + { + "description": "The index mode for the data stream that will be used for newly created backing indices.", + "name": "index_mode", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexMode", + "namespace": "indices._types" + } + } } ], - "specLocation": "indices/_types/DataStream.ts#L45-L127" + "specLocation": "indices/_types/DataStream.ts#L53-L139" }, { "kind": "interface", @@ -123057,7 +123091,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L39-L43" + "specLocation": "indices/_types/DataStream.ts#L47-L51" }, { "kind": "interface", @@ -123125,9 +123159,21 @@ "namespace": "_builtins" } } + }, + { + "description": "The index mode of this backing index of the data stream.", + "name": "index_mode", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexMode", + "namespace": "indices._types" + } + } } ], - "specLocation": "indices/_types/DataStream.ts#L136-L157" + "specLocation": "indices/_types/DataStream.ts#L148-L173" }, { "kind": "interface", @@ -123149,7 +123195,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L129-L134" + "specLocation": "indices/_types/DataStream.ts#L141-L146" }, { "kind": "interface", @@ -123652,7 +123698,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L159-L162" + "specLocation": "indices/_types/DataStream.ts#L175-L178" }, { "kind": "interface", diff --git a/specification/indices/_types/DataStream.ts b/specification/indices/_types/DataStream.ts index d3fb857ccf..4c9e8e223f 100644 --- a/specification/indices/_types/DataStream.ts +++ b/specification/indices/_types/DataStream.ts @@ -38,10 +38,10 @@ enum ManagedBy { // Available index modes (for the `index.mode` setting) See the `IndexMode` class in Elasticsearch for the options. export enum IndexMode { - standard, - time_series, - logsdb, - lookup + standard, + time_series, + logsdb, + lookup } export class FailureStore {