Skip to content

Commit 8af7881

Browse files
committed
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]> (cherry picked from commit 1cd36d6) # Conflicts: # output/openapi/elasticsearch-openapi.json # output/openapi/elasticsearch-serverless-openapi.json # output/schema/schema.json
1 parent ea86e55 commit 8af7881

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
@@ -21,7 +21,7 @@ import { IndexName, Metadata, Name, VersionNumber } from '@_types/common'
2121
import { TypeMapping } from '@_types/mapping/TypeMapping'
2222
import { AliasDefinition } from '@indices/_types/AliasDefinition'
2323
import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle'
24-
import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions'
24+
import { DataStreamOptions } from '@indices/_types/DataStreamOptions'
2525
import { IndexSettings } from '@indices/_types/IndexSettings'
2626
import { Dictionary } from '@spec_utils/Dictionary'
2727

@@ -57,5 +57,5 @@ export class ComponentTemplateSummary {
5757
* @availability stack since=8.19.0 stability=stable
5858
* @availability serverless stability=stable
5959
*/
60-
data_stream_options?: DataStreamOptionsTemplate | null
60+
data_stream_options?: DataStreamOptions
6161
}

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
@@ -21,7 +21,7 @@ import { IndexName, Metadata, Name, Names, VersionNumber } from '@_types/common'
2121
import { TypeMapping } from '@_types/mapping/TypeMapping'
2222
import { long } from '@_types/Numeric'
2323
import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle'
24-
import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions'
24+
import { DataStreamOptions } from '@indices/_types/DataStreamOptions'
2525
import { Dictionary } from '@spec_utils/Dictionary'
2626
import { Alias } from './Alias'
2727
import { IndexSettings } from './IndexSettings'
@@ -120,5 +120,5 @@ export class IndexTemplateSummary {
120120
* @availability stack since=8.19.0 stability=stable
121121
* @availability serverless stability=stable
122122
*/
123-
data_stream_options?: DataStreamOptionsTemplate | null
123+
data_stream_options?: DataStreamOptions
124124
}

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

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

0 commit comments

Comments
 (0)