diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 344955ce3c..8cda4cfdc9 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -15641,6 +15641,14 @@ "$ref": "#/components/schemas/indices._types.DownsamplingRound" } }, + "downsampling_method": { + "description": "The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires\n`downsampling` to be defined. Defaults to `aggregate`.", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.SamplingMethod" + } + ] + }, "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, @@ -88389,10 +88397,17 @@ ] }, "downsampling": { - "description": "The downsampling configuration to execute for the managed backing index after rollover.", + "description": "The list of downsampling rounds to execute as part of this downsampling configuration", + "type": "array", + "items": { + "$ref": "#/components/schemas/indices._types.DownsamplingRound" + } + }, + "downsampling_method": { + "description": "The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires\n`downsampling` to be defined. Defaults to `aggregate`.", "allOf": [ { - "$ref": "#/components/schemas/indices._types.DataStreamLifecycleDownsampling" + "$ref": "#/components/schemas/indices._types.SamplingMethod" } ] }, @@ -88403,21 +88418,6 @@ } } }, - "indices._types.DataStreamLifecycleDownsampling": { - "type": "object", - "properties": { - "rounds": { - "description": "The list of downsampling rounds to execute as part of this downsampling configuration", - "type": "array", - "items": { - "$ref": "#/components/schemas/indices._types.DownsamplingRound" - } - } - }, - "required": [ - "rounds" - ] - }, "indices._types.DownsamplingRound": { "type": "object", "properties": { @@ -88443,6 +88443,13 @@ "fixed_interval" ] }, + "indices._types.SamplingMethod": { + "type": "string", + "enum": [ + "aggregate", + "last_value" + ] + }, "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", @@ -97161,13 +97168,6 @@ "fixed_interval" ] }, - "indices._types.SamplingMethod": { - "type": "string", - "enum": [ - "aggregate", - "last_value" - ] - }, "indices.explain_data_lifecycle.DataStreamLifecycleExplain": { "type": "object", "properties": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 68d188a72e..e3a61a9289 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -9283,6 +9283,14 @@ "$ref": "#/components/schemas/indices._types.DownsamplingRound" } }, + "downsampling_method": { + "description": "The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires\n`downsampling` to be defined. Defaults to `aggregate`.", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.SamplingMethod" + } + ] + }, "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, @@ -60600,10 +60608,17 @@ ] }, "downsampling": { - "description": "The downsampling configuration to execute for the managed backing index after rollover.", + "description": "The list of downsampling rounds to execute as part of this downsampling configuration", + "type": "array", + "items": { + "$ref": "#/components/schemas/indices._types.DownsamplingRound" + } + }, + "downsampling_method": { + "description": "The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires\n`downsampling` to be defined. Defaults to `aggregate`.", "allOf": [ { - "$ref": "#/components/schemas/indices._types.DataStreamLifecycleDownsampling" + "$ref": "#/components/schemas/indices._types.SamplingMethod" } ] }, @@ -60614,21 +60629,6 @@ } } }, - "indices._types.DataStreamLifecycleDownsampling": { - "type": "object", - "properties": { - "rounds": { - "description": "The list of downsampling rounds to execute as part of this downsampling configuration", - "type": "array", - "items": { - "$ref": "#/components/schemas/indices._types.DownsamplingRound" - } - } - }, - "required": [ - "rounds" - ] - }, "indices._types.DownsamplingRound": { "type": "object", "properties": { @@ -60654,6 +60654,13 @@ "fixed_interval" ] }, + "indices._types.SamplingMethod": { + "type": "string", + "enum": [ + "aggregate", + "last_value" + ] + }, "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", diff --git a/output/schema/schema.json b/output/schema/schema.json index 10d5e4bda2..3556251033 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -149197,13 +149197,28 @@ } }, { - "description": "The downsampling configuration to execute for the managed backing index after rollover.", + "description": "The list of downsampling rounds to execute as part of this downsampling configuration", "name": "downsampling", "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "DownsamplingRound", + "namespace": "indices._types" + } + } + } + }, + { + "description": "The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires\n`downsampling` to be defined. Defaults to `aggregate`.", + "name": "downsampling_method", + "required": false, "type": { "kind": "instance_of", "type": { - "name": "DataStreamLifecycleDownsampling", + "name": "SamplingMethod", "namespace": "indices._types" } } @@ -149222,32 +149237,7 @@ } } ], - "specLocation": "indices/_types/DataStreamLifecycle.ts#L25-L45" - }, - { - "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/DataStreamLifecycleDownsampling.ts#L22-L27" + "specLocation": "indices/_types/DataStreamLifecycle.ts#L26-L51" }, { "kind": "interface", @@ -149367,7 +149357,7 @@ } } ], - "specLocation": "indices/_types/DataStreamLifecycle.ts#L60-L72" + "specLocation": "indices/_types/DataStreamLifecycle.ts#L66-L78" }, { "kind": "interface", @@ -149396,7 +149386,7 @@ } } ], - "specLocation": "indices/_types/DataStreamLifecycle.ts#L47-L58" + "specLocation": "indices/_types/DataStreamLifecycle.ts#L53-L64" }, { "kind": "interface", @@ -163166,6 +163156,18 @@ } } }, + { + "description": "The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires\n`downsampling` to be defined. Defaults to `aggregate`.", + "name": "downsampling_method", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "SamplingMethod", + "namespace": "indices._types" + } + } + }, { "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.", "name": "enabled", @@ -163308,7 +163310,7 @@ } } ], - "specLocation": "indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts#L25-L93" + "specLocation": "indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts#L26-L99" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 2bf1edf279..40c5c57742 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11882,14 +11882,11 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration - downsampling?: IndicesDataStreamLifecycleDownsampling + downsampling?: IndicesDownsamplingRound[] + downsampling_method?: IndicesSamplingMethod enabled?: boolean } -export interface IndicesDataStreamLifecycleDownsampling { - rounds: IndicesDownsamplingRound[] -} - export interface IndicesDataStreamLifecycleRolloverConditions { min_age?: Duration max_age?: string @@ -13158,6 +13155,7 @@ export interface IndicesPutDataLifecycleRequest extends RequestBase { body?: { data_retention?: Duration downsampling?: IndicesDownsamplingRound[] + downsampling_method?: IndicesSamplingMethod enabled?: boolean } } diff --git a/specification/indices/_types/DataStreamLifecycle.ts b/specification/indices/_types/DataStreamLifecycle.ts index a9af498a1d..35d83906d8 100644 --- a/specification/indices/_types/DataStreamLifecycle.ts +++ b/specification/indices/_types/DataStreamLifecycle.ts @@ -20,7 +20,8 @@ import { ByteSize } from '@_types/common' import { long } from '@_types/Numeric' import { Duration } from '@_types/Time' -import { DataStreamLifecycleDownsampling } from '@indices/_types/DataStreamLifecycleDownsampling' +import { SamplingMethod } from '@indices/_types/Downsample' +import { DownsamplingRound } from '@indices/_types/DownsamplingRound' /** * Data stream lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration. @@ -33,9 +34,14 @@ export class DataStreamLifecycle { */ data_retention?: Duration /** - * The downsampling configuration to execute for the managed backing index after rollover. + * The list of downsampling rounds to execute as part of this downsampling configuration */ - downsampling?: DataStreamLifecycleDownsampling + downsampling?: DownsamplingRound[] + /** + * The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires + * `downsampling` to be defined. Defaults to `aggregate`. + */ + downsampling_method?: SamplingMethod /** * If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle * that's disabled (enabled: `false`) will have no effect on the data stream. diff --git a/specification/indices/_types/DataStreamLifecycleDownsampling.ts b/specification/indices/_types/DataStreamLifecycleDownsampling.ts deleted file mode 100644 index 4aad62df47..0000000000 --- a/specification/indices/_types/DataStreamLifecycleDownsampling.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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/Downsample.ts b/specification/indices/_types/Downsample.ts index 46fa228a0c..93945a0fdd 100644 --- a/specification/indices/_types/Downsample.ts +++ b/specification/indices/_types/Downsample.ts @@ -30,7 +30,7 @@ export class DownsampleConfig { sampling_method?: SamplingMethod } -enum SamplingMethod { +export enum SamplingMethod { aggregate, last_value } diff --git a/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts b/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts index 32570f3ec2..7fb4a41fd2 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 { SamplingMethod } from '@indices/_types/Downsample' import { DownsamplingRound } from '@indices/_types/DownsamplingRound' /** @@ -70,7 +71,7 @@ export interface Request extends RequestBase { } /* * This is DataStreamLifecycle from @indices/_types/DataStreamLifecycle.ts, - * but kept as a properties body to avoid a breaking change + * but kept as separate properties to avoid a breaking change */ body: { /** @@ -83,6 +84,11 @@ export interface Request extends RequestBase { * The downsampling configuration to execute for the managed backing index after rollover. */ downsampling?: DownsamplingRound[] + /** + * The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires + * `downsampling` to be defined. Defaults to `aggregate`. + */ + downsampling_method?: SamplingMethod /** * If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle * that's disabled (enabled: `false`) will have no effect on the data stream.