diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 1619d7f58..072395dbe 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -4016,6 +4016,8 @@ To target all data streams use `*` or `_all`. ** *`data_retention` (Optional, string | -1 | 0)*: If defined, every document added to this data stream will be stored at least for this time frame. Any time after this duration the document could be deleted. When empty, every document in this data stream will be stored indefinitely. +** *`downsampling` (Optional, { rounds })*: If defined, every backing index will execute the configured downsampling configuration after the backing +index is not the data stream write index anymore. ** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of data stream that wildcard patterns can match. Supports a list of values, such as `open,hidden`. Valid values are: `all`, `hidden`, `open`, `closed`, `none`. diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index 2dcf18270..078b1c52d 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -1233,7 +1233,7 @@ export default class Indices { async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['data_retention'] + const acceptedBody: string[] = ['data_retention', 'downsampling'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/types.ts b/src/api/types.ts index 384ca440a..242ee9f69 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -9519,6 +9519,11 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling +} + +export interface IndicesDataStreamLifecycleDownsampling { + rounds: IndicesDownsamplingRound[] } export interface IndicesDataStreamLifecycleRolloverConditions { @@ -9536,6 +9541,7 @@ export interface IndicesDataStreamLifecycleRolloverConditions { export interface IndicesDataStreamLifecycleWithRollover { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling rollover?: IndicesDataStreamLifecycleRolloverConditions } @@ -9551,6 +9557,11 @@ export interface IndicesDownsampleConfig { fixed_interval: DurationLarge } +export interface IndicesDownsamplingRound { + after: Duration + config: IndicesDownsampleConfig +} + export interface IndicesFielddataFrequencyFilter { max: double min: double @@ -10537,6 +10548,7 @@ export interface IndicesPutDataLifecycleRequest extends RequestBase { master_timeout?: Duration timeout?: Duration data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling } export type IndicesPutDataLifecycleResponse = AcknowledgedResponseBase diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 94861b37d..2401a1d6d 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -9642,6 +9642,11 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling +} + +export interface IndicesDataStreamLifecycleDownsampling { + rounds: IndicesDownsamplingRound[] } export interface IndicesDataStreamLifecycleRolloverConditions { @@ -9659,6 +9664,7 @@ export interface IndicesDataStreamLifecycleRolloverConditions { export interface IndicesDataStreamLifecycleWithRollover { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling rollover?: IndicesDataStreamLifecycleRolloverConditions } @@ -9674,6 +9680,11 @@ export interface IndicesDownsampleConfig { fixed_interval: DurationLarge } +export interface IndicesDownsamplingRound { + after: Duration + config: IndicesDownsampleConfig +} + export interface IndicesFielddataFrequencyFilter { max: double min: double @@ -10678,6 +10689,7 @@ export interface IndicesPutDataLifecycleRequest extends RequestBase { /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling } }