diff --git a/output/schema/schema.json b/output/schema/schema.json index 072022e30d..9e6e1909c5 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -109662,9 +109662,45 @@ "namespace": "_types" } } + }, + { + "name": "downsampling", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DataStreamLifecycleDownsampling", + "namespace": "indices._types" + } + } + } + ], + "specLocation": "indices/_types/DataStreamLifecycle.ts#L25-L31" + }, + { + "kind": "interface", + "name": { + "name": "DataStreamLifecycleDownsampling", + "namespace": "indices._types" + }, + "properties": [ + { + "description": "The list of downsampling rounds to execute as part of this downsampling configuration", + "name": "rounds", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "DownsamplingRound", + "namespace": "indices._types" + } + } + } } ], - "specLocation": "indices/_types/DataStreamLifecycle.ts#L24-L29" + "specLocation": "indices/_types/DataStreamLifecycleDownsampling.ts#L22-L27" }, { "kind": "interface", @@ -109784,7 +109820,7 @@ } } ], - "specLocation": "indices/_types/DataStreamLifecycle.ts#L50-L62" + "specLocation": "indices/_types/DataStreamLifecycle.ts#L57-L69" }, { "description": "Data lifecycle with rollover can be used to display the configuration including the default rollover conditions,\nif asked.", @@ -109806,6 +109842,18 @@ } } }, + { + "description": "The downsampling configuration to execute for the managed backing index after rollover.", + "name": "downsampling", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DataStreamLifecycleDownsampling", + "namespace": "indices._types" + } + } + }, { "description": "The conditions which will trigger the rollover of a backing index as configured by the cluster setting `cluster.lifecycle.default.rollover`.\nThis property is an implementation detail and it will only be retrieved when the query param `include_defaults` is set to true.\nThe contents of this field are subject to change.", "name": "rollover", @@ -109819,7 +109867,7 @@ } } ], - "specLocation": "indices/_types/DataStreamLifecycle.ts#L31-L48" + "specLocation": "indices/_types/DataStreamLifecycle.ts#L33-L55" }, { "kind": "interface", @@ -109886,6 +109934,40 @@ ], "specLocation": "indices/_types/Downsample.ts#L22-L27" }, + { + "kind": "interface", + "name": { + "name": "DownsamplingRound", + "namespace": "indices._types" + }, + "properties": [ + { + "description": "The duration since rollover when this downsampling round should execute", + "name": "after", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "The downsample configuration to execute.", + "name": "config", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "DownsampleConfig", + "namespace": "indices._types" + } + } + } + ], + "specLocation": "indices/_types/DownsamplingRound.ts#L23-L32" + }, { "kind": "interface", "name": { @@ -119268,6 +119350,18 @@ "namespace": "_types" } } + }, + { + "description": "If defined, every backing index will execute the configured downsampling configuration after the backing\nindex is not the data stream write index anymore.", + "name": "downsampling", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DataStreamLifecycleDownsampling", + "namespace": "indices._types" + } + } } ] }, @@ -119338,7 +119432,7 @@ } } ], - "specLocation": "indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts#L24-L69" + "specLocation": "indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts#L25-L75" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 41f3dcfe54..1bf2bddf6f 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9654,6 +9654,11 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling +} + +export interface IndicesDataStreamLifecycleDownsampling { + rounds: IndicesDownsamplingRound[] } export interface IndicesDataStreamLifecycleRolloverConditions { @@ -9671,6 +9676,7 @@ export interface IndicesDataStreamLifecycleRolloverConditions { export interface IndicesDataStreamLifecycleWithRollover { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling rollover?: IndicesDataStreamLifecycleRolloverConditions } @@ -9686,6 +9692,11 @@ export interface IndicesDownsampleConfig { fixed_interval: DurationLarge } +export interface IndicesDownsamplingRound { + after: Duration + config: IndicesDownsampleConfig +} + export interface IndicesFielddataFrequencyFilter { max: double min: double @@ -10683,6 +10694,7 @@ export interface IndicesPutDataLifecycleRequest extends RequestBase { timeout?: Duration body?: { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling } } diff --git a/specification/indices/_types/DataStreamLifecycle.ts b/specification/indices/_types/DataStreamLifecycle.ts index 98687fa666..3f818eeaba 100644 --- a/specification/indices/_types/DataStreamLifecycle.ts +++ b/specification/indices/_types/DataStreamLifecycle.ts @@ -20,12 +20,14 @@ import { Duration } from '@_types/Time' import { long } from '@_types/Numeric' import { ByteSize } from '@_types/common' +import { DataStreamLifecycleDownsampling } from '@indices/_types/DataStreamLifecycleDownsampling' /** * Data lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration. */ export class DataStreamLifecycle { data_retention?: Duration + downsampling?: DataStreamLifecycleDownsampling } /** @@ -39,6 +41,11 @@ export class DataStreamLifecycleWithRollover { * When empty, every document in this data stream will be stored indefinitely. */ data_retention?: Duration + + /** + * The downsampling configuration to execute for the managed backing index after rollover. + */ + downsampling?: DataStreamLifecycleDownsampling /** * The conditions which will trigger the rollover of a backing index as configured by the cluster setting `cluster.lifecycle.default.rollover`. * This property is an implementation detail and it will only be retrieved when the query param `include_defaults` is set to true. diff --git a/specification/indices/_types/DataStreamLifecycleDownsampling.ts b/specification/indices/_types/DataStreamLifecycleDownsampling.ts new file mode 100644 index 0000000000..4aad62df47 --- /dev/null +++ b/specification/indices/_types/DataStreamLifecycleDownsampling.ts @@ -0,0 +1,27 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { DownsamplingRound } from '@indices/_types/DownsamplingRound' + +export class DataStreamLifecycleDownsampling { + /** + * The list of downsampling rounds to execute as part of this downsampling configuration + */ + rounds: DownsamplingRound[] +} diff --git a/specification/indices/_types/DownsamplingRound.ts b/specification/indices/_types/DownsamplingRound.ts new file mode 100644 index 0000000000..71cb430c4d --- /dev/null +++ b/specification/indices/_types/DownsamplingRound.ts @@ -0,0 +1,32 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { Duration } from '@_types/Time' +import { DownsampleConfig } from '@indices/_types/Downsample' + +export class DownsamplingRound { + /** + * The duration since rollover when this downsampling round should execute + */ + after: Duration + /** + * The downsample configuration to execute. + */ + config: DownsampleConfig +} diff --git a/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts b/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts index 182495935c..7bf6638913 100644 --- a/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts +++ b/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts @@ -20,6 +20,7 @@ import { RequestBase } from '@_types/Base' import { DataStreamNames, ExpandWildcards } from '@_types/common' import { Duration } from '@_types/Time' +import { DataStreamLifecycleDownsampling } from '@indices/_types/DataStreamLifecycleDownsampling' /** * Update the data lifecycle of the specified data streams. @@ -65,5 +66,10 @@ export interface Request extends RequestBase { * When empty, every document in this data stream will be stored indefinitely. */ data_retention?: Duration + /** + * If defined, every backing index will execute the configured downsampling configuration after the backing + * index is not the data stream write index anymore. + */ + downsampling?: DataStreamLifecycleDownsampling } }