Skip to content

Commit

Permalink
Improve DataStreamLifecycle definitions (and related) (#3039)
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd authored Oct 22, 2024
1 parent 2d0a0fd commit 4319692
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 26 deletions.
23 changes: 13 additions & 10 deletions specification/indices/_types/DataStreamLifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,29 @@ import { Duration } from '@_types/Time'
* Data stream 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
}

/**
* Data stream lifecycle with rollover can be used to display the configuration including the default rollover conditions,
* if asked.
*/
export class DataStreamLifecycleWithRollover {
/**
* 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.
*/
data_retention?: Duration

/**
* The downsampling configuration to execute for the managed backing index after rollover.
*/
downsampling?: DataStreamLifecycleDownsampling
/**
* 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.
* @server_default true
*/
enabled?: boolean
}

/**
* Data stream lifecycle with rollover can be used to display the configuration including the default rollover conditions,
* if asked.
*/
export class DataStreamLifecycleWithRollover extends DataStreamLifecycle {
/**
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { DataStreamLifecycle } from '@indices/_types/DataStreamLifecycle'
import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle'
import { DataStreamName } from '@_types/common'

export class Response {
Expand All @@ -26,5 +26,5 @@ export class Response {

class DataStreamWithLifecycle {
name: DataStreamName
lifecycle?: DataStreamLifecycle
lifecycle?: DataStreamLifecycleWithRollover
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { DataStreamLifecycleDownsampling } from '@indices/_types/DataStreamLifecycleDownsampling'
import { DataStreamLifecycle } from '@indices/_types/DataStreamLifecycle'
import { RequestBase } from '@_types/Base'
import { DataStreamNames, ExpandWildcards } from '@_types/common'
import { Duration } from '@_types/Time'
Expand Down Expand Up @@ -60,17 +60,8 @@ export interface Request extends RequestBase {
*/
timeout?: Duration
}
body: {
/**
* 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.
*/
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
}
/**
* @codegen_name lifecycle
*/
body: DataStreamLifecycle
}

0 comments on commit 4319692

Please sign in to comment.