Skip to content

Commit 1cd36d6

Browse files
pquentinnielsbaumangmarouli
authored
Fix cluster.put_component_template API (#5370)
* Fix cluster.put_component_template API * Revert "Fix cluster.put_component_template API" This reverts commit 69c9eee. * 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 85a3def. --------- Co-authored-by: Niels Bauman <[email protected]> Co-authored-by: Mary Gouseti <[email protected]>
1 parent 6566f69 commit 1cd36d6

File tree

8 files changed

+372
-349
lines changed

8 files changed

+372
-349
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 155 additions & 151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 155 additions & 151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 46 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/cluster/_types/ComponentTemplate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { TypeMapping } from '@_types/mapping/TypeMapping'
2222
import { DateTime, EpochTime, UnitMillis } from '@_types/Time'
2323
import { AliasDefinition } from '@indices/_types/AliasDefinition'
2424
import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle'
25-
import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions'
25+
import { DataStreamOptions } from '@indices/_types/DataStreamOptions'
2626
import { IndexSettings } from '@indices/_types/IndexSettings'
2727
import { Dictionary } from '@spec_utils/Dictionary'
2828

@@ -82,5 +82,5 @@ export class ComponentTemplateSummary {
8282
* @availability stack since=8.19.0 stability=stable
8383
* @availability serverless stability=stable
8484
*/
85-
data_stream_options?: DataStreamOptionsTemplate | null
85+
data_stream_options?: DataStreamOptions
8686
}

specification/cluster/put_component_template/ClusterPutComponentTemplateRequest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import { RequestBase } from '@_types/Base'
2121
import { Metadata, Name, VersionNumber } from '@_types/common'
2222
import { Duration } from '@_types/Time'
23-
import { IndexState } from '@indices/_types/IndexState'
23+
import { IndexTemplateMapping } from '@indices/put_index_template/IndicesPutIndexTemplateRequest'
2424

2525
/**
2626
* Create or update a component template.
@@ -88,7 +88,7 @@ export interface Request extends RequestBase {
8888
/**
8989
* The template to be applied which includes mappings, settings, or aliases configuration.
9090
*/
91-
template: IndexState
91+
template: IndexTemplateMapping
9292
/**
9393
* Version number used to manage component templates externally.
9494
* This number isn't automatically generated or incremented by Elasticsearch.

specification/indices/_types/IndexTemplate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { TypeMapping } from '@_types/mapping/TypeMapping'
2222
import { long } from '@_types/Numeric'
2323
import { DateTime, EpochTime, UnitMillis } from '@_types/Time'
2424
import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle'
25-
import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions'
25+
import { DataStreamOptions } from '@indices/_types/DataStreamOptions'
2626
import { Dictionary } from '@spec_utils/Dictionary'
2727
import { Alias } from './Alias'
2828
import { IndexSettings } from './IndexSettings'
@@ -145,5 +145,5 @@ export class IndexTemplateSummary {
145145
* @availability stack since=8.19.0 stability=stable
146146
* @availability serverless stability=stable
147147
*/
148-
data_stream_options?: DataStreamOptionsTemplate | null
148+
data_stream_options?: DataStreamOptions
149149
}

specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { Duration } from '@_types/Time'
3131
import { Alias } from '@indices/_types/Alias'
3232
import { DataStreamVisibility } from '@indices/_types/DataStream'
3333
import { DataStreamLifecycle } from '@indices/_types/DataStreamLifecycle'
34+
import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions'
3435
import { IndexSettings } from '@indices/_types/IndexSettings'
3536
import { Dictionary } from '@spec_utils/Dictionary'
3637

@@ -182,4 +183,9 @@ export class IndexTemplateMapping {
182183
* @availability serverless stability=stable
183184
*/
184185
lifecycle?: DataStreamLifecycle
186+
/**
187+
* @availability stack since=8.19.0 stability=stable
188+
* @availability serverless stability=stable
189+
*/
190+
data_stream_options?: DataStreamOptionsTemplate | null
185191
}

0 commit comments

Comments
 (0)