diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 17ebd2bb45..583c22e534 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -16589,7 +16589,7 @@ "data stream" ], "summary": "Downsample an index", - "description": "Aggregate a time series (TSDS) index and store pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval.\nFor example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index.\nAll documents within an hour interval are summarized and stored as a single document in the downsample index.\n\nNOTE: Only indices in a time series data stream are supported.\nNeither field nor document level security can be defined on the source index.\nThe source index must be read only (`index.blocks.write: true`).", + "description": "Downsamples a time series (TSDS) index and reduces its size by keeping the last value or by pre-aggregating metrics:\n\n- When running in `aggregate` mode, it pre-calculates and stores statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`)\nfor each metric field grouped by a configured time interval and their dimensions.\n- When running in `last_value` mode, it keeps the last value for each metric in the configured interval and their dimensions.\n\nFor example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index.\nAll documents within an hour interval are summarized and stored as a single document in the downsample index.\n\nNOTE: Only indices in a time series data stream are supported.\nNeither field nor document level security can be defined on the source index.\nThe source index must be read only (`index.blocks.write: true`).", "operationId": "indices-downsample", "parameters": [ { @@ -88362,12 +88362,27 @@ "$ref": "#/components/schemas/_types.DurationLarge" } ] + }, + "sampling_method": { + "description": "The sampling method used to reduce the documents; it can be either `aggregate` or `last_value`. Defaults to `aggregate`.", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.SamplingMethod" + } + ] } }, "required": [ "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/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 78d21fe479..61384c90ba 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -60601,12 +60601,27 @@ "$ref": "#/components/schemas/_types.DurationLarge" } ] + }, + "sampling_method": { + "description": "The sampling method used to reduce the documents; it can be either `aggregate` or `last_value`. Defaults to `aggregate`.", + "allOf": [ + { + "$ref": "#/components/schemas/indices._types.SamplingMethod" + } + ] } }, "required": [ "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 5b1887aa28..5ecd5e3a66 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -7348,7 +7348,7 @@ "stability": "experimental" } }, - "description": "Downsample an index.\nAggregate a time series (TSDS) index and store pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval.\nFor example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index.\nAll documents within an hour interval are summarized and stored as a single document in the downsample index.\n\nNOTE: Only indices in a time series data stream are supported.\nNeither field nor document level security can be defined on the source index.\nThe source index must be read only (`index.blocks.write: true`).", + "description": "Downsample an index.\nDownsamples a time series (TSDS) index and reduces its size by keeping the last value or by pre-aggregating metrics:\n\n- When running in `aggregate` mode, it pre-calculates and stores statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`)\nfor each metric field grouped by a configured time interval and their dimensions.\n- When running in `last_value` mode, it keeps the last value for each metric in the configured interval and their dimensions.\n\nFor example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index.\nAll documents within an hour interval are summarized and stored as a single document in the downsample index.\n\nNOTE: Only indices in a time series data stream are supported.\nNeither field nor document level security can be defined on the source index.\nThe source index must be read only (`index.blocks.write: true`).", "docId": "indices-downsample-data-stream", "docTag": "data stream", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-downsample", @@ -148414,9 +148414,21 @@ "namespace": "_types" } } + }, + { + "description": "The sampling method used to reduce the documents; it can be either `aggregate` or `last_value`. Defaults to `aggregate`.", + "name": "sampling_method", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "SamplingMethod", + "namespace": "indices._types" + } + } } ], - "specLocation": "indices/_types/Downsample.ts#L22-L27" + "specLocation": "indices/_types/Downsample.ts#L22-L31" }, { "kind": "interface", @@ -151378,6 +151390,22 @@ ], "specLocation": "indices/_types/IndexSettings.ts#L66-L68" }, + { + "kind": "enum", + "members": [ + { + "name": "aggregate" + }, + { + "name": "last_value" + } + ], + "name": { + "name": "SamplingMethod", + "namespace": "indices._types" + }, + "specLocation": "indices/_types/Downsample.ts#L33-L36" + }, { "kind": "interface", "name": { @@ -156063,7 +156091,7 @@ } } }, - "description": "Downsample an index.\nAggregate a time series (TSDS) index and store pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval.\nFor example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index.\nAll documents within an hour interval are summarized and stored as a single document in the downsample index.\n\nNOTE: Only indices in a time series data stream are supported.\nNeither field nor document level security can be defined on the source index.\nThe source index must be read only (`index.blocks.write: true`).", + "description": "Downsample an index.\nDownsamples a time series (TSDS) index and reduces its size by keeping the last value or by pre-aggregating metrics:\n\n- When running in `aggregate` mode, it pre-calculates and stores statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`)\nfor each metric field grouped by a configured time interval and their dimensions.\n- When running in `last_value` mode, it keeps the last value for each metric in the configured interval and their dimensions.\n\nFor example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index.\nAll documents within an hour interval are summarized and stored as a single document in the downsample index.\n\nNOTE: Only indices in a time series data stream are supported.\nNeither field nor document level security can be defined on the source index.\nThe source index must be read only (`index.blocks.write: true`).", "examples": { "DownsampleRequestExample1": { "alternatives": [ @@ -156129,7 +156157,7 @@ } ], "query": [], - "specLocation": "indices/downsample/Request.ts#L24-L58" + "specLocation": "indices/downsample/Request.ts#L24-L63" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 47d5b8ff87..0f5592e656 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11911,6 +11911,7 @@ export interface IndicesDataStreamVisibility { export interface IndicesDownsampleConfig { fixed_interval: DurationLarge + sampling_method?: IndicesSamplingMethod } export interface IndicesDownsamplingRound { @@ -12211,6 +12212,8 @@ export interface IndicesRetentionLease { period: Duration } +export type IndicesSamplingMethod = 'aggregate' | 'last_value' + export interface IndicesSearchIdle { after?: Duration } diff --git a/specification/indices/_types/Downsample.ts b/specification/indices/_types/Downsample.ts index f34526fc48..46fa228a0c 100644 --- a/specification/indices/_types/Downsample.ts +++ b/specification/indices/_types/Downsample.ts @@ -24,4 +24,13 @@ export class DownsampleConfig { * The interval at which to aggregate the original time series index. */ fixed_interval: DurationLarge + /** + * The sampling method used to reduce the documents; it can be either `aggregate` or `last_value`. Defaults to `aggregate`. + */ + sampling_method?: SamplingMethod +} + +enum SamplingMethod { + aggregate, + last_value } diff --git a/specification/indices/downsample/Request.ts b/specification/indices/downsample/Request.ts index 64e32d4d41..3725feb7c4 100644 --- a/specification/indices/downsample/Request.ts +++ b/specification/indices/downsample/Request.ts @@ -23,7 +23,12 @@ import { DownsampleConfig } from '@indices/_types/Downsample' /** * Downsample an index. - * Aggregate a time series (TSDS) index and store pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval. + * Downsamples a time series (TSDS) index and reduces its size by keeping the last value or by pre-aggregating metrics: + * + * - When running in `aggregate` mode, it pre-calculates and stores statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) + * for each metric field grouped by a configured time interval and their dimensions. + * - When running in `last_value` mode, it keeps the last value for each metric in the configured interval and their dimensions. + * * For example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index. * All documents within an hour interval are summarized and stored as a single document in the downsample index. *