Skip to content

Commit 4319692

Browse files
authored
Improve DataStreamLifecycle definitions (and related) (#3039)
1 parent 2d0a0fd commit 4319692

File tree

3 files changed

+20
-26
lines changed

3 files changed

+20
-26
lines changed

specification/indices/_types/DataStreamLifecycle.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,29 @@ import { Duration } from '@_types/Time'
2626
* Data stream lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration.
2727
*/
2828
export class DataStreamLifecycle {
29-
data_retention?: Duration
30-
downsampling?: DataStreamLifecycleDownsampling
31-
}
32-
33-
/**
34-
* Data stream lifecycle with rollover can be used to display the configuration including the default rollover conditions,
35-
* if asked.
36-
*/
37-
export class DataStreamLifecycleWithRollover {
3829
/**
3930
* If defined, every document added to this data stream will be stored at least for this time frame.
4031
* Any time after this duration the document could be deleted.
4132
* When empty, every document in this data stream will be stored indefinitely.
4233
*/
4334
data_retention?: Duration
44-
4535
/**
4636
* The downsampling configuration to execute for the managed backing index after rollover.
4737
*/
4838
downsampling?: DataStreamLifecycleDownsampling
39+
/**
40+
* If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle
41+
* that's disabled (enabled: `false`) will have no effect on the data stream.
42+
* @server_default true
43+
*/
44+
enabled?: boolean
45+
}
46+
47+
/**
48+
* Data stream lifecycle with rollover can be used to display the configuration including the default rollover conditions,
49+
* if asked.
50+
*/
51+
export class DataStreamLifecycleWithRollover extends DataStreamLifecycle {
4952
/**
5053
* The conditions which will trigger the rollover of a backing index as configured by the cluster setting `cluster.lifecycle.default.rollover`.
5154
* This property is an implementation detail and it will only be retrieved when the query param `include_defaults` is set to true.

specification/indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
import { DataStreamLifecycle } from '@indices/_types/DataStreamLifecycle'
20+
import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle'
2121
import { DataStreamName } from '@_types/common'
2222

2323
export class Response {
@@ -26,5 +26,5 @@ export class Response {
2626

2727
class DataStreamWithLifecycle {
2828
name: DataStreamName
29-
lifecycle?: DataStreamLifecycle
29+
lifecycle?: DataStreamLifecycleWithRollover
3030
}

specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
import { DataStreamLifecycleDownsampling } from '@indices/_types/DataStreamLifecycleDownsampling'
20+
import { DataStreamLifecycle } from '@indices/_types/DataStreamLifecycle'
2121
import { RequestBase } from '@_types/Base'
2222
import { DataStreamNames, ExpandWildcards } from '@_types/common'
2323
import { Duration } from '@_types/Time'
@@ -60,17 +60,8 @@ export interface Request extends RequestBase {
6060
*/
6161
timeout?: Duration
6262
}
63-
body: {
64-
/**
65-
* If defined, every document added to this data stream will be stored at least for this time frame.
66-
* Any time after this duration the document could be deleted.
67-
* When empty, every document in this data stream will be stored indefinitely.
68-
*/
69-
data_retention?: Duration
70-
/**
71-
* If defined, every backing index will execute the configured downsampling configuration after the backing
72-
* index is not the data stream write index anymore.
73-
*/
74-
downsampling?: DataStreamLifecycleDownsampling
75-
}
63+
/**
64+
* @codegen_name lifecycle
65+
*/
66+
body: DataStreamLifecycle
7667
}

0 commit comments

Comments
 (0)