Skip to content

Commit 12d3761

Browse files
gmaroulipquentin
andauthored
Add downsampling_method to the data stream lifecycle (#5594)
* Fix data stream lifecycle type, to correctly handle downsampling. * Add sampling method to data stream lifecycle * Run make contrib --------- Co-authored-by: Quentin Pradet <[email protected]>
1 parent 6cf9874 commit 12d3761

File tree

7 files changed

+90
-13
lines changed

7 files changed

+90
-13
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 23 additions & 7 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: 23 additions & 0 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: 28 additions & 4 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: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/indices/_types/DataStreamLifecycle.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { ByteSize } from '@_types/common'
2121
import { long } from '@_types/Numeric'
2222
import { Duration } from '@_types/Time'
2323
import { DownsamplingRound } from '@indices/_types/DownsamplingRound'
24+
import { SamplingMethod } from './Downsample'
2425

2526
/**
2627
* Data stream lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration.
@@ -36,6 +37,11 @@ export class DataStreamLifecycle {
3637
* The list of downsampling rounds to execute as part of this downsampling configuration
3738
*/
3839
downsampling?: DownsamplingRound[]
40+
/**
41+
* The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires
42+
* `downsampling` to be defined. Defaults to `aggregate`.
43+
*/
44+
downsampling_method?: SamplingMethod
3945
/**
4046
* If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle
4147
* that's disabled (enabled: `false`) will have no effect on the data stream.

specification/indices/_types/Downsample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class DownsampleConfig {
3030
sampling_method?: SamplingMethod
3131
}
3232

33-
enum SamplingMethod {
33+
export enum SamplingMethod {
3434
aggregate,
3535
last_value
3636
}

specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import { RequestBase } from '@_types/Base'
2121
import { DataStreamNames, ExpandWildcards } from '@_types/common'
2222
import { Duration } from '@_types/Time'
23+
import { SamplingMethod } from '@indices/_types/Downsample'
2324
import { DownsamplingRound } from '@indices/_types/DownsamplingRound'
2425

2526
/**
@@ -71,7 +72,7 @@ export interface Request extends RequestBase {
7172
}
7273
/*
7374
* This is DataStreamLifecycle from @indices/_types/DataStreamLifecycle.ts,
74-
* but kept as a properties body to avoid a breaking change
75+
* but kept as separate properties to avoid a breaking change
7576
*/
7677
body: {
7778
/**
@@ -84,6 +85,11 @@ export interface Request extends RequestBase {
8485
* The downsampling configuration to execute for the managed backing index after rollover.
8586
*/
8687
downsampling?: DownsamplingRound[]
88+
/**
89+
* The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires
90+
* `downsampling` to be defined. Defaults to `aggregate`.
91+
*/
92+
downsampling_method?: SamplingMethod
8793
/**
8894
* If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle
8995
* that's disabled (enabled: `false`) will have no effect on the data stream.

0 commit comments

Comments
 (0)