diff --git a/output/schema/schema.json b/output/schema/schema.json index 3f26932639..fdf87185c9 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -5110,6 +5110,11 @@ "description": "Creates a data stream", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", "name": "indices.create_data_stream", + "privileges": { + "index": [ + "create_index" + ] + }, "request": { "name": "Request", "namespace": "indices.create_data_stream" @@ -5312,6 +5317,11 @@ "description": "Deletes a data stream.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", "name": "indices.delete_data_stream", + "privileges": { + "index": [ + "delete_index" + ] + }, "request": { "name": "Request", "namespace": "indices.delete_data_stream" @@ -5966,6 +5976,11 @@ "description": "Returns data streams.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", "name": "indices.get_data_stream", + "privileges": { + "index": [ + "view_index_metadata" + ] + }, "request": { "name": "Request", "namespace": "indices.get_data_stream" @@ -107067,6 +107082,7 @@ }, "properties": [ { + "description": "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely.", "name": "data_retention", "required": false, "type": { @@ -107078,6 +107094,7 @@ } }, { + "description": "The conditions which will trigger the rollover of a backing index as configured by the cluster setting `cluster.lifecycle.default.rollover`.\nThis property is an implementation detail and it will only be retrieved when the query param `include_defaults` is set to true.\nThe contents of this field are subject to change.", "name": "rollover", "required": false, "type": { @@ -107089,7 +107106,7 @@ } } ], - "specLocation": "indices/_types/DataLifecycle.ts#L31-L38" + "specLocation": "indices/_types/DataLifecycle.ts#L31-L48" }, { "kind": "interface", @@ -107099,42 +107116,33 @@ }, "properties": [ { - "name": "name", - "required": true, + "description": "Custom metadata for the stream, copied from the `_meta` object of the stream’s matching index template.\nIf empty, the response omits this property.", + "docId": "mapping-meta-field", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/mapping-meta-field.html", + "name": "_meta", + "required": false, "type": { "kind": "instance_of", "type": { - "name": "DataStreamName", + "name": "Metadata", "namespace": "_types" } } }, { - "name": "timestamp_field", - "required": true, + "description": "If `true`, the data stream allows custom routing on write request.", + "name": "allow_custom_routing", + "required": false, "type": { "kind": "instance_of", "type": { - "name": "DataStreamTimestampField", - "namespace": "indices._types" - } - } - }, - { - "name": "indices", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "DataStreamIndex", - "namespace": "indices._types" - } + "name": "boolean", + "namespace": "_builtins" } } }, { + "description": "Current generation for the data stream. This number acts as a cumulative count of the stream’s rollovers, starting at 1.", "name": "generation", "required": true, "type": { @@ -107146,94 +107154,114 @@ } }, { - "name": "template", + "description": "If `true`, the data stream is hidden.", + "name": "hidden", "required": true, "type": { "kind": "instance_of", "type": { - "name": "Name", - "namespace": "_types" + "name": "boolean", + "namespace": "_builtins" } } }, { - "name": "hidden", - "required": true, + "description": "Name of the current ILM lifecycle policy in the stream’s matching index template.\nThis lifecycle policy is set in the `index.lifecycle.name` setting.\nIf the template does not include a lifecycle policy, this property is not included in the response.\nNOTE: A data stream’s backing indices may be assigned different lifecycle policies. To retrieve the lifecycle policy for individual backing indices, use the get index settings API.", + "name": "ilm_policy", + "required": false, "type": { "kind": "instance_of", "type": { - "name": "boolean", - "namespace": "_builtins" + "name": "Name", + "namespace": "_types" } } }, { - "name": "replicated", - "required": false, + "description": "Array of objects containing information about the data stream’s backing indices.\nThe last item in this array contains information about the stream’s current write index.", + "name": "indices", + "required": true, "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "DataStreamIndex", + "namespace": "indices._types" + } } } }, { "availability": { - "serverless": {}, + "serverless": { + "stability": "experimental" + }, "stack": { - "since": "7.10.0" + "since": "8.8.0", + "stability": "experimental" } }, - "name": "system", + "description": "Contains the configuration for the data lifecycle management of this data stream.", + "name": "lifecycle", "required": false, - "since": "7.10.0", + "since": "8.8.0", + "stability": "experimental", "type": { "kind": "instance_of", "type": { - "name": "boolean", - "namespace": "_builtins" + "name": "DataLifecycleWithRollover", + "namespace": "indices._types" } } }, { - "name": "status", + "description": "Name of the data stream.", + "name": "name", "required": true, "type": { "kind": "instance_of", "type": { - "name": "HealthStatus", + "name": "DataStreamName", "namespace": "_types" } } }, { - "name": "ilm_policy", + "description": "If `true`, the data stream is created and managed by cross-cluster replication and the local cluster can not write into this data stream or change its mappings.", + "name": "replicated", "required": false, "type": { "kind": "instance_of", "type": { - "name": "Name", - "namespace": "_types" + "name": "boolean", + "namespace": "_builtins" } } }, { - "docId": "mapping-meta-field", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/mapping-meta-field.html", - "name": "_meta", - "required": false, + "description": "Health status of the data stream.\nThis health status is based on the state of the primary and replica shards of the stream’s backing indices.", + "name": "status", + "required": true, "type": { "kind": "instance_of", "type": { - "name": "Metadata", + "name": "HealthStatus", "namespace": "_types" } } }, { - "name": "allow_custom_routing", + "availability": { + "serverless": {}, + "stack": { + "since": "7.10.0" + } + }, + "description": "If `true`, the data stream is created and managed by an Elastic stack component and cannot be modified through normal user interaction.", + "name": "system", "required": false, + "since": "7.10.0", "type": { "kind": "instance_of", "type": { @@ -107243,29 +107271,31 @@ } }, { - "availability": { - "serverless": { - "stability": "experimental" - }, - "stack": { - "since": "8.8.0", - "stability": "experimental" + "description": "Name of the index template used to create the data stream’s backing indices.\nThe template’s index pattern must match the name of this data stream.", + "name": "template", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Name", + "namespace": "_types" } - }, - "name": "lifecycle", - "required": false, - "since": "8.8.0", - "stability": "experimental", + } + }, + { + "description": "Information about the `@timestamp` field in the data stream.", + "name": "timestamp_field", + "required": true, "type": { "kind": "instance_of", "type": { - "name": "DataLifecycleWithRollover", + "name": "DataStreamTimestampField", "namespace": "indices._types" } } } ], - "specLocation": "indices/_types/DataStream.ts#L32-L55" + "specLocation": "indices/_types/DataStream.ts#L32-L96" }, { "kind": "interface", @@ -107275,6 +107305,7 @@ }, "properties": [ { + "description": "Name of the backing index.", "name": "index_name", "required": true, "type": { @@ -107286,6 +107317,7 @@ } }, { + "description": "Universally unique identifier (UUID) for the index.", "name": "index_uuid", "required": true, "type": { @@ -107297,7 +107329,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L61-L64" + "specLocation": "indices/_types/DataStream.ts#L105-L114" }, { "kind": "interface", @@ -107307,6 +107339,7 @@ }, "properties": [ { + "description": "Name of the timestamp field for the data stream, which must be `@timestamp`. The `@timestamp` field must be included in every document indexed to the data stream.", "name": "name", "required": true, "type": { @@ -107318,7 +107351,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L57-L59" + "specLocation": "indices/_types/DataStream.ts#L98-L103" }, { "kind": "interface", @@ -107339,7 +107372,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L66-L68" + "specLocation": "indices/_types/DataStream.ts#L116-L118" }, { "kind": "interface", @@ -107459,7 +107492,7 @@ } } ], - "specLocation": "indices/_types/DataLifecycle.ts#L40-L52" + "specLocation": "indices/_types/DataLifecycle.ts#L50-L62" }, { "kind": "interface", @@ -112380,7 +112413,7 @@ "body": { "kind": "no_body" }, - "description": "Creates a data stream", + "description": "Creates a data stream.\nYou must have a matching index template with data stream enabled.", "inherits": { "type": { "name": "RequestBase", @@ -112394,7 +112427,7 @@ }, "path": [ { - "description": "The name of the data stream", + "description": "Name of the data stream, which must meet the following criteria:\nLowercase only;\nCannot include `\\`, `/`, `*`, `?`, `\"`, `<`, `>`, `|`, `,`, `#`, `:`, or a space character;\nCannot start with `-`, `_`, `+`, or `.ds-`;\nCannot be `.` or `..`;\nCannot be longer than 255 bytes. Multi-byte characters count towards this limit faster.", "name": "name", "required": true, "type": { @@ -112407,7 +112440,7 @@ } ], "query": [], - "specLocation": "indices/create_data_stream/IndicesCreateDataStreamRequest.ts#L23-L32" + "specLocation": "indices/create_data_stream/IndicesCreateDataStreamRequest.ts#L23-L43" }, { "body": { @@ -112935,7 +112968,7 @@ "body": { "kind": "no_body" }, - "description": "Deletes a data stream.", + "description": "Deletes one or more data streams and their backing indices.", "inherits": { "type": { "name": "RequestBase", @@ -112949,7 +112982,7 @@ }, "path": [ { - "description": "A comma-separated list of data streams to delete; use `*` to delete all data streams", + "description": "Comma-separated list of data streams to delete. Wildcard (`*`) expressions are supported.", "name": "name", "required": true, "type": { @@ -112963,9 +112996,10 @@ ], "query": [ { - "description": "Whether wildcard expressions should get expanded to open or closed indices (default: open)", + "description": "Type of data stream that wildcard patterns can match. Supports comma-separated values,such as `open,hidden`.", "name": "expand_wildcards", "required": false, + "serverDefault": "open", "type": { "kind": "instance_of", "type": { @@ -112975,7 +113009,7 @@ } } ], - "specLocation": "indices/delete_data_stream/IndicesDeleteDataStreamRequest.ts#L23-L35" + "specLocation": "indices/delete_data_stream/IndicesDeleteDataStreamRequest.ts#L23-L44" }, { "body": { @@ -115265,7 +115299,7 @@ "body": { "kind": "no_body" }, - "description": "Returns data streams.", + "description": "Retrieves information about one or more data streams.", "inherits": { "type": { "name": "RequestBase", @@ -115279,7 +115313,7 @@ }, "path": [ { - "description": "A comma-separated list of data streams to get; use `*` to get all data streams", + "description": "Comma-separated list of data stream names used to limit the request.\nWildcard (`*`) expressions are supported. If omitted, all data streams are returned.", "name": "name", "required": false, "type": { @@ -115293,9 +115327,10 @@ ], "query": [ { - "description": "Whether wildcard expressions should get expanded to open or closed indices (default: open)", + "description": "Type of data stream that wildcard patterns can match.\nSupports comma-separated values, such as `open,hidden`.", "name": "expand_wildcards", "required": false, + "serverDefault": "open", "type": { "kind": "instance_of", "type": { @@ -115329,7 +115364,7 @@ } } ], - "specLocation": "indices/get_data_stream/IndicesGetDataStreamRequest.ts#L23-L42" + "specLocation": "indices/get_data_stream/IndicesGetDataStreamRequest.ts#L23-L53" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index e617ef96ba..865bc68ba2 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9603,19 +9603,19 @@ export interface IndicesDataLifecycleWithRollover { } export interface IndicesDataStream { - name: DataStreamName - timestamp_field: IndicesDataStreamTimestampField - indices: IndicesDataStreamIndex[] + _meta?: Metadata + allow_custom_routing?: boolean generation: integer - template: Name hidden: boolean - replicated?: boolean - system?: boolean - status: HealthStatus ilm_policy?: Name - _meta?: Metadata - allow_custom_routing?: boolean + indices: IndicesDataStreamIndex[] lifecycle?: IndicesDataLifecycleWithRollover + name: DataStreamName + replicated?: boolean + status: HealthStatus + system?: boolean + template: Name + timestamp_field: IndicesDataStreamTimestampField } export interface IndicesDataStreamIndex { diff --git a/specification/indices/_types/DataLifecycle.ts b/specification/indices/_types/DataLifecycle.ts index 5b9997931e..d3b53a7cfa 100644 --- a/specification/indices/_types/DataLifecycle.ts +++ b/specification/indices/_types/DataLifecycle.ts @@ -33,7 +33,17 @@ export class DataLifecycle { * if asked. */ export class DataLifecycleWithRollover { + /** + * 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 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. + * The contents of this field are subject to change. + */ rollover?: DlmRolloverConditions } diff --git a/specification/indices/_types/DataStream.ts b/specification/indices/_types/DataStream.ts index 83cb79f348..4493f185e6 100644 --- a/specification/indices/_types/DataStream.ts +++ b/specification/indices/_types/DataStream.ts @@ -30,36 +30,86 @@ import { integer } from '@_types/Numeric' import { DataLifecycleWithRollover } from '@indices/_types/DataLifecycle' export class DataStream { - name: DataStreamName - timestamp_field: DataStreamTimestampField - indices: DataStreamIndex[] + /** + * Custom metadata for the stream, copied from the `_meta` object of the stream’s matching index template. + * If empty, the response omits this property. + * @doc_id mapping-meta-field */ + _meta?: Metadata + /** + * If `true`, the data stream allows custom routing on write request. + */ + allow_custom_routing?: boolean + /** + * Current generation for the data stream. This number acts as a cumulative count of the stream’s rollovers, starting at 1. + */ generation: integer - template: Name + /** + * If `true`, the data stream is hidden. + */ hidden: boolean - replicated?: boolean /** - * @availability stack since=7.10.0 - * @availability serverless + * Name of the current ILM lifecycle policy in the stream’s matching index template. + * This lifecycle policy is set in the `index.lifecycle.name` setting. + * If the template does not include a lifecycle policy, this property is not included in the response. + * NOTE: A data stream’s backing indices may be assigned different lifecycle policies. To retrieve the lifecycle policy for individual backing indices, use the get index settings API. */ - system?: boolean - status: HealthStatus ilm_policy?: Name - /** @doc_id mapping-meta-field */ - _meta?: Metadata - allow_custom_routing?: boolean /** + * Array of objects containing information about the data stream’s backing indices. + * The last item in this array contains information about the stream’s current write index. + */ + indices: DataStreamIndex[] + /** + * Contains the configuration for the data lifecycle management of this data stream. * @availability stack since=8.8.0 stability=experimental * @availability serverless stability=experimental */ lifecycle?: DataLifecycleWithRollover + /** + * Name of the data stream. + */ + name: DataStreamName + /** + * If `true`, the data stream is created and managed by cross-cluster replication and the local cluster can not write into this data stream or change its mappings. + */ + replicated?: boolean + /** + * Health status of the data stream. + * This health status is based on the state of the primary and replica shards of the stream’s backing indices. + */ + status: HealthStatus + /** + * If `true`, the data stream is created and managed by an Elastic stack component and cannot be modified through normal user interaction. + * @availability stack since=7.10.0 + * @availability serverless + */ + system?: boolean + /** + * Name of the index template used to create the data stream’s backing indices. + * The template’s index pattern must match the name of this data stream. + */ + template: Name + /** + * Information about the `@timestamp` field in the data stream. + */ + timestamp_field: DataStreamTimestampField } export class DataStreamTimestampField { + /** + * Name of the timestamp field for the data stream, which must be `@timestamp`. The `@timestamp` field must be included in every document indexed to the data stream. + */ name: Field } export class DataStreamIndex { + /** + * Name of the backing index. + */ index_name: IndexName + /** + * Universally unique identifier (UUID) for the index. + */ index_uuid: Uuid } diff --git a/specification/indices/create_data_stream/IndicesCreateDataStreamRequest.ts b/specification/indices/create_data_stream/IndicesCreateDataStreamRequest.ts index 76677870f1..cebc466357 100644 --- a/specification/indices/create_data_stream/IndicesCreateDataStreamRequest.ts +++ b/specification/indices/create_data_stream/IndicesCreateDataStreamRequest.ts @@ -21,12 +21,23 @@ import { RequestBase } from '@_types/Base' import { DataStreamName } from '@_types/common' /** + * Creates a data stream. + * You must have a matching index template with data stream enabled. * @rest_spec_name indices.create_data_stream * @availability stack since=7.9.0 stability=stable * @availability serverless stability=stable visibility=public + * @index_privileges create_index */ export interface Request extends RequestBase { path_parts: { + /** + * Name of the data stream, which must meet the following criteria: + * Lowercase only; + * Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `#`, `:`, or a space character; + * Cannot start with `-`, `_`, `+`, or `.ds-`; + * Cannot be `.` or `..`; + * Cannot be longer than 255 bytes. Multi-byte characters count towards this limit faster. + */ name: DataStreamName } } diff --git a/specification/indices/delete_data_stream/IndicesDeleteDataStreamRequest.ts b/specification/indices/delete_data_stream/IndicesDeleteDataStreamRequest.ts index fb1912afea..9bb489b960 100644 --- a/specification/indices/delete_data_stream/IndicesDeleteDataStreamRequest.ts +++ b/specification/indices/delete_data_stream/IndicesDeleteDataStreamRequest.ts @@ -21,15 +21,24 @@ import { RequestBase } from '@_types/Base' import { ExpandWildcards, DataStreamNames } from '@_types/common' /** + * Deletes one or more data streams and their backing indices. * @rest_spec_name indices.delete_data_stream * @availability stack since=7.9.0 stability=stable * @availability serverless stability=stable visibility=public + * @index_privileges delete_index */ export interface Request extends RequestBase { path_parts: { + /** + * Comma-separated list of data streams to delete. Wildcard (`*`) expressions are supported. + */ name: DataStreamNames } query_parameters: { + /** + * Type of data stream that wildcard patterns can match. Supports comma-separated values,such as `open,hidden`. + * @server_default open + */ expand_wildcards?: ExpandWildcards } } diff --git a/specification/indices/get_data_stream/IndicesGetDataStreamRequest.ts b/specification/indices/get_data_stream/IndicesGetDataStreamRequest.ts index 0fd3df70ee..8b2ea7d329 100644 --- a/specification/indices/get_data_stream/IndicesGetDataStreamRequest.ts +++ b/specification/indices/get_data_stream/IndicesGetDataStreamRequest.ts @@ -21,15 +21,26 @@ import { RequestBase } from '@_types/Base' import { ExpandWildcards, DataStreamNames } from '@_types/common' /** + * Retrieves information about one or more data streams. * @rest_spec_name indices.get_data_stream * @availability stack since=7.9.0 stability=stable * @availability serverless stability=stable visibility=public + * @index_privileges view_index_metadata */ export interface Request extends RequestBase { path_parts: { + /** + * Comma-separated list of data stream names used to limit the request. + * Wildcard (`*`) expressions are supported. If omitted, all data streams are returned. + */ name?: DataStreamNames } query_parameters: { + /** + * Type of data stream that wildcard patterns can match. + * Supports comma-separated values, such as `open,hidden`. + * @server_default open + */ expand_wildcards?: ExpandWildcards /** * If true, returns all relevant default configurations for the index template.