diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 880e764ae1..e0764a1372 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -16235,6 +16235,177 @@ "x-state": "Added in 7.9.0" } }, + "/_data_stream/{name}/_settings": { + "get": { + "tags": [ + "data stream" + ], + "summary": "Get data stream settings", + "description": "Get setting information for one or more data streams.", + "operationId": "indices-get-data-stream-settings", + "parameters": [ + { + "in": "path", + "name": "name", + "description": "A comma-separated list of data streams or data stream patterns. Supports wildcards (`*`).", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Indices" + }, + "style": "simple" + }, + { + "in": "query", + "name": "master_timeout", + "description": "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data_streams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/indices.get_data_stream_settings.DataStreamSettings" + } + } + }, + "required": [ + "data_streams" + ] + }, + "examples": { + "IndicesGetDataStreamSettingsResponseExample1": { + "summary": "Get data stream settings on a data stream", + "description": "This is a response to `GET /_data_stream/my-data-stream/_settings` where my-data-stream that has two settings set. The `effective_settings` field shows additional settings that are pulled from its template.\n", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n }\n }\n ]\n}" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "data stream" + ], + "summary": "Update data stream settings", + "description": "This API can be used to override settings on specific data streams. These overrides will take precedence over what\nis specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state,\nonly certain settings are allowed. If possible, the setting change is applied to all\nbacking indices. Otherwise, it will be applied when the data stream is next rolled over.", + "operationId": "indices-put-data-stream-settings", + "parameters": [ + { + "in": "path", + "name": "name", + "description": "A comma-separated list of data streams or data stream patterns.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Indices" + }, + "style": "simple" + }, + { + "in": "query", + "name": "dry_run", + "description": "If `true`, the request does not actually change the settings on any data streams or indices. Instead, it\nsimulates changing the settings and reports back to the user what would have happened had these settings\nactually been applied.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "master_timeout", + "description": "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + }, + { + "in": "query", + "name": "timeout", + "description": "The period to wait for a response. If no response is received before the\n timeout expires, the request fails and returns an error.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, + "examples": { + "IndicesPutDataStreamSettingsRequestExample1": { + "summary": "Change a data stream setting", + "description": "This is a request to change two settings on a data stream.\n", + "value": "{\n \"index.lifecycle.name\" : \"new-test-policy\",\n \"index.number_of_shards\": 11\n}" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data_streams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/indices.put_data_stream_settings.UpdatedDataStreamSettings" + } + } + }, + "required": [ + "data_streams" + ] + }, + "examples": { + "IndicesPutDataStreamSettingsResponseExample1": { + "summary": "Change data stream settings on a data stream", + "description": "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when two settings are successfully updated on the data stream. In this case, `index.number_of_shards` is only applied to the data stream -- it will be applied to the write index on rollover. The setting `index.lifecycle.name` is applied to the data stream and all backing indices.\n", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": true,\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n },\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [\n \"index.number_of_shards\"\n ],\n \"applied_to_data_stream_and_backing_indices\": [\n \"index.lifecycle.name\"\n ]\n }\n }\n ]\n}" + }, + "IndicesPutDataStreamSettingsResponseExample2": { + "summary": "Change data stream settings on a data stream that has an index with a metadata block", + "description": "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a setting is successfully applied to the data stream, but one of the backing indices, `.ds-my-data-stream-2025.05.28-000001`, has a write block. The response reports that the setting was not successfully applied to that index.\n", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": true,\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n },\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [\n \"index.number_of_shards\"\n ],\n \"applied_to_data_stream_and_backing_indices\": [\n \"index.lifecycle.name\"\n ],\n \"errors\": [\n {\n \"index\": \".ds-my-data-stream-2025.05.28-000001\",\n \"error\": \"index [.ds-my-data-stream-2025.05.28-000001] blocked by: [FORBIDDEN/9/index metadata (api)];\"\n }\n ]\n }\n }\n ]\n}" + }, + "IndicesPutDataStreamSettingsResponseExample3": { + "summary": "Attempt to change a data stream setting that is not allowed", + "description": "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a user attempts to set a setting that is not allowed on a data stream. As a result, no change was applied to the data stream.\n", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": false,\n \"error\": \"Cannot set the following settings on a data stream: [index.number_of_replicas]\",\n \"settings\": {},\n \"effective_settings\": {},\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [],\n \"applied_to_data_stream_and_backing_indices\": []\n }\n }\n ]\n}" + } + } + } + } + } + } + } + }, "/_mapping/field/{fields}": { "get": { "tags": [ @@ -80313,6 +80484,9 @@ "description": "If `true`, the next write to this data stream will trigger a rollover first and the document will be indexed in the new backing index. If the rollover fails the indexing request will fail too.", "type": "boolean" }, + "settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, "status": { "$ref": "#/components/schemas/_types.HealthStatus" }, @@ -80338,6 +80512,7 @@ "indices", "name", "rollover_on_write", + "settings", "status", "template", "timestamp_field" @@ -80467,6 +80642,26 @@ } } }, + "indices.get_data_stream_settings.DataStreamSettings": { + "type": "object", + "properties": { + "name": { + "description": "The name of the data stream.", + "type": "string" + }, + "settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, + "effective_settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + } + }, + "required": [ + "name", + "settings", + "effective_settings" + ] + }, "indices.get_field_mapping.TypeFieldMappings": { "type": "object", "properties": { @@ -80754,6 +80949,83 @@ "index" ] }, + "indices.put_data_stream_settings.UpdatedDataStreamSettings": { + "type": "object", + "properties": { + "name": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "applied_to_data_stream": { + "description": "If the settings were successfully applied to the data stream (or would have been, if running in `dry_run`\nmode), it is `true`. If an error occurred, it is `false`.", + "type": "boolean" + }, + "error": { + "description": "A message explaining why the settings could not be applied to the data stream.", + "type": "string" + }, + "settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, + "effective_settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, + "index_settings_results": { + "$ref": "#/components/schemas/indices.put_data_stream_settings.IndexSettingResults" + } + }, + "required": [ + "name", + "applied_to_data_stream", + "settings", + "effective_settings", + "index_settings_results" + ] + }, + "indices.put_data_stream_settings.IndexSettingResults": { + "type": "object", + "properties": { + "applied_to_data_stream_only": { + "description": "The list of settings that were applied to the data stream but not to backing indices. These will be applied to\nthe write index the next time the data stream is rolled over.", + "type": "array", + "items": { + "type": "string" + } + }, + "applied_to_data_stream_and_backing_indices": { + "description": "The list of settings that were applied to the data stream and to all of its backing indices. These settings will\nalso be applied to the write index the next time the data stream is rolled over.", + "type": "array", + "items": { + "type": "string" + } + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/indices.put_data_stream_settings.DataStreamSettingsError" + } + } + }, + "required": [ + "applied_to_data_stream_only", + "applied_to_data_stream_and_backing_indices" + ] + }, + "indices.put_data_stream_settings.DataStreamSettingsError": { + "type": "object", + "properties": { + "index": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "error": { + "description": "A message explaining why the settings could not be applied to specific indices.", + "type": "string" + } + }, + "required": [ + "index", + "error" + ] + }, "indices.put_index_template.IndexTemplateMapping": { "type": "object", "properties": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 4fe8ad9cb0..499565918f 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -8737,6 +8737,177 @@ "x-state": "Added in 8.19.0" } }, + "/_data_stream/{name}/_settings": { + "get": { + "tags": [ + "data stream" + ], + "summary": "Get data stream settings", + "description": "Get setting information for one or more data streams.", + "operationId": "indices-get-data-stream-settings", + "parameters": [ + { + "in": "path", + "name": "name", + "description": "A comma-separated list of data streams or data stream patterns. Supports wildcards (`*`).", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Indices" + }, + "style": "simple" + }, + { + "in": "query", + "name": "master_timeout", + "description": "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data_streams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/indices.get_data_stream_settings.DataStreamSettings" + } + } + }, + "required": [ + "data_streams" + ] + }, + "examples": { + "IndicesGetDataStreamSettingsResponseExample1": { + "summary": "Get data stream settings on a data stream", + "description": "This is a response to `GET /_data_stream/my-data-stream/_settings` where my-data-stream that has two settings set. The `effective_settings` field shows additional settings that are pulled from its template.\n", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n }\n }\n ]\n}" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "data stream" + ], + "summary": "Update data stream settings", + "description": "This API can be used to override settings on specific data streams. These overrides will take precedence over what\nis specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state,\nonly certain settings are allowed. If possible, the setting change is applied to all\nbacking indices. Otherwise, it will be applied when the data stream is next rolled over.", + "operationId": "indices-put-data-stream-settings", + "parameters": [ + { + "in": "path", + "name": "name", + "description": "A comma-separated list of data streams or data stream patterns.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Indices" + }, + "style": "simple" + }, + { + "in": "query", + "name": "dry_run", + "description": "If `true`, the request does not actually change the settings on any data streams or indices. Instead, it\nsimulates changing the settings and reports back to the user what would have happened had these settings\nactually been applied.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "master_timeout", + "description": "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + }, + { + "in": "query", + "name": "timeout", + "description": "The period to wait for a response. If no response is received before the\n timeout expires, the request fails and returns an error.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, + "examples": { + "IndicesPutDataStreamSettingsRequestExample1": { + "summary": "Change a data stream setting", + "description": "This is a request to change two settings on a data stream.\n", + "value": "{\n \"index.lifecycle.name\" : \"new-test-policy\",\n \"index.number_of_shards\": 11\n}" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data_streams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/indices.put_data_stream_settings.UpdatedDataStreamSettings" + } + } + }, + "required": [ + "data_streams" + ] + }, + "examples": { + "IndicesPutDataStreamSettingsResponseExample1": { + "summary": "Change data stream settings on a data stream", + "description": "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when two settings are successfully updated on the data stream. In this case, `index.number_of_shards` is only applied to the data stream -- it will be applied to the write index on rollover. The setting `index.lifecycle.name` is applied to the data stream and all backing indices.\n", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": true,\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n },\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [\n \"index.number_of_shards\"\n ],\n \"applied_to_data_stream_and_backing_indices\": [\n \"index.lifecycle.name\"\n ]\n }\n }\n ]\n}" + }, + "IndicesPutDataStreamSettingsResponseExample2": { + "summary": "Change data stream settings on a data stream that has an index with a metadata block", + "description": "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a setting is successfully applied to the data stream, but one of the backing indices, `.ds-my-data-stream-2025.05.28-000001`, has a write block. The response reports that the setting was not successfully applied to that index.\n", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": true,\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n },\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [\n \"index.number_of_shards\"\n ],\n \"applied_to_data_stream_and_backing_indices\": [\n \"index.lifecycle.name\"\n ],\n \"errors\": [\n {\n \"index\": \".ds-my-data-stream-2025.05.28-000001\",\n \"error\": \"index [.ds-my-data-stream-2025.05.28-000001] blocked by: [FORBIDDEN/9/index metadata (api)];\"\n }\n ]\n }\n }\n ]\n}" + }, + "IndicesPutDataStreamSettingsResponseExample3": { + "summary": "Attempt to change a data stream setting that is not allowed", + "description": "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a user attempts to set a setting that is not allowed on a data stream. As a result, no change was applied to the data stream.\n", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": false,\n \"error\": \"Cannot set the following settings on a data stream: [index.number_of_replicas]\",\n \"settings\": {},\n \"effective_settings\": {},\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [],\n \"applied_to_data_stream_and_backing_indices\": []\n }\n }\n ]\n}" + } + } + } + } + } + } + } + }, "/_index_template": { "get": { "tags": [ @@ -51615,6 +51786,9 @@ "description": "If `true`, the next write to this data stream will trigger a rollover first and the document will be indexed in the new backing index. If the rollover fails the indexing request will fail too.", "type": "boolean" }, + "settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, "status": { "$ref": "#/components/schemas/_types.HealthStatus" }, @@ -51640,6 +51814,7 @@ "indices", "name", "rollover_on_write", + "settings", "status", "template", "timestamp_field" @@ -51769,6 +51944,26 @@ } } }, + "indices.get_data_stream_settings.DataStreamSettings": { + "type": "object", + "properties": { + "name": { + "description": "The name of the data stream.", + "type": "string" + }, + "settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, + "effective_settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + } + }, + "required": [ + "name", + "settings", + "effective_settings" + ] + }, "indices.get_index_template.IndexTemplateItem": { "type": "object", "properties": { @@ -51917,6 +52112,83 @@ "index" ] }, + "indices.put_data_stream_settings.UpdatedDataStreamSettings": { + "type": "object", + "properties": { + "name": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "applied_to_data_stream": { + "description": "If the settings were successfully applied to the data stream (or would have been, if running in `dry_run`\nmode), it is `true`. If an error occurred, it is `false`.", + "type": "boolean" + }, + "error": { + "description": "A message explaining why the settings could not be applied to the data stream.", + "type": "string" + }, + "settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, + "effective_settings": { + "$ref": "#/components/schemas/indices._types.IndexSettings" + }, + "index_settings_results": { + "$ref": "#/components/schemas/indices.put_data_stream_settings.IndexSettingResults" + } + }, + "required": [ + "name", + "applied_to_data_stream", + "settings", + "effective_settings", + "index_settings_results" + ] + }, + "indices.put_data_stream_settings.IndexSettingResults": { + "type": "object", + "properties": { + "applied_to_data_stream_only": { + "description": "The list of settings that were applied to the data stream but not to backing indices. These will be applied to\nthe write index the next time the data stream is rolled over.", + "type": "array", + "items": { + "type": "string" + } + }, + "applied_to_data_stream_and_backing_indices": { + "description": "The list of settings that were applied to the data stream and to all of its backing indices. These settings will\nalso be applied to the write index the next time the data stream is rolled over.", + "type": "array", + "items": { + "type": "string" + } + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/indices.put_data_stream_settings.DataStreamSettingsError" + } + } + }, + "required": [ + "applied_to_data_stream_only", + "applied_to_data_stream_and_backing_indices" + ] + }, + "indices.put_data_stream_settings.DataStreamSettingsError": { + "type": "object", + "properties": { + "index": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "error": { + "description": "A message explaining why the settings could not be applied to specific indices.", + "type": "string" + } + }, + "required": [ + "index", + "error" + ] + }, "indices.put_index_template.IndexTemplateMapping": { "type": "object", "properties": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 7522edfca6..743c5af16b 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -7781,18 +7781,34 @@ }, { "availability": { + "serverless": { + "stability": "stable", + "visibility": "public" + }, "stack": { - "featureFlag": "logs_stream", "stability": "stable", - "visibility": "feature_flag" + "visibility": "public" } }, - "description": "Gets a data stream's settings", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", + "description": "Get data stream settings.\n\nGet setting information for one or more data streams.", + "docId": "indices-get-data-stream-settings", + "docTag": "data stream", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-settings", "name": "indices.get_data_stream_settings", - "request": null, + "privileges": { + "index": [ + "view_index_metadata" + ] + }, + "request": { + "name": "Request", + "namespace": "indices.get_data_stream_settings" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "indices.get_data_stream_settings" + }, "responseMediaType": [ "application/json" ], @@ -8404,18 +8420,34 @@ }, { "availability": { + "serverless": { + "stability": "stable", + "visibility": "public" + }, "stack": { - "featureFlag": "logs_stream", "stability": "stable", - "visibility": "feature_flag" + "visibility": "public" } }, - "description": "Updates a data stream's settings", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", + "description": "Update data stream settings.\n\nThis API can be used to override settings on specific data streams. These overrides will take precedence over what\nis specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state,\nonly certain settings are allowed. If possible, the setting change is applied to all\nbacking indices. Otherwise, it will be applied when the data stream is next rolled over.", + "docId": "indices-put-data-stream-settings", + "docTag": "data stream", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-settings", "name": "indices.put_data_stream_settings", - "request": null, + "privileges": { + "index": [ + "manage" + ] + }, + "request": { + "name": "Request", + "namespace": "indices.put_data_stream_settings" + }, "requestBodyRequired": true, - "response": null, + "response": { + "name": "Response", + "namespace": "indices.put_data_stream_settings" + }, "responseMediaType": [ "application/json" ], @@ -134685,6 +134717,18 @@ } } }, + { + "description": "The settings specific to this data stream that will take precedence over the settings in the matching index\ntemplate.", + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexSettings", + "namespace": "indices._types" + } + } + }, { "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", @@ -134752,7 +134796,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L53-L139" + "specLocation": "indices/_types/DataStream.ts#L54-L145" }, { "kind": "interface", @@ -134930,7 +134974,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L148-L173" + "specLocation": "indices/_types/DataStream.ts#L154-L179" }, { "kind": "interface", @@ -135231,7 +135275,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L141-L146" + "specLocation": "indices/_types/DataStream.ts#L147-L152" }, { "kind": "interface", @@ -135263,7 +135307,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L175-L178" + "specLocation": "indices/_types/DataStream.ts#L181-L184" }, { "kind": "interface", @@ -135365,7 +135409,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L47-L51" + "specLocation": "indices/_types/DataStream.ts#L48-L52" }, { "kind": "interface", @@ -135534,7 +135578,7 @@ "name": "IndexMode", "namespace": "indices._types" }, - "specLocation": "indices/_types/DataStream.ts#L40-L45" + "specLocation": "indices/_types/DataStream.ts#L41-L46" }, { "kind": "interface", @@ -137659,7 +137703,7 @@ "name": "ManagedBy", "namespace": "indices._types" }, - "specLocation": "indices/_types/DataStream.ts#L32-L37" + "specLocation": "indices/_types/DataStream.ts#L33-L38" }, { "kind": "interface", @@ -144622,6 +144666,136 @@ }, "specLocation": "indices/get_data_stream_options/IndicesGetDataStreamOptionsResponse.ts#L23-L25" }, + { + "kind": "interface", + "name": { + "name": "DataStreamSettings", + "namespace": "indices.get_data_stream_settings" + }, + "properties": [ + { + "description": "The name of the data stream.", + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The settings specific to this data stream", + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexSettings", + "namespace": "indices._types" + } + } + }, + { + "description": "The settings specific to this data stream merged with the settings from its template. These `effective_settings`\nare the settings that will be used when a new index is created for this data stream.", + "name": "effective_settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexSettings", + "namespace": "indices._types" + } + } + } + ], + "specLocation": "indices/get_data_stream_settings/IndicesGetDataStreamSettingsResponse.ts#L29-L39" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Get data stream settings.\n\nGet setting information for one or more data streams.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "indices.get_data_stream_settings" + }, + "path": [ + { + "description": "A comma-separated list of data streams or data stream patterns. Supports wildcards (`*`).", + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Indices", + "namespace": "_types" + } + } + } + ], + "query": [ + { + "description": "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "indices/get_data_stream_settings/IndicesGetDataStreamSettingsRequest.ts#L24-L57" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "data_streams", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "DataStreamSettings", + "namespace": "indices.get_data_stream_settings" + } + } + } + } + ] + }, + "examples": { + "IndicesGetDataStreamSettingsResponseExample1": { + "description": "This is a response to `GET /_data_stream/my-data-stream/_settings` where my-data-stream that has two settings set. The `effective_settings` field shows additional settings that are pulled from its template.\n", + "summary": "Get data stream settings on a data stream", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n }\n }\n ]\n}" + } + }, + "name": { + "name": "Response", + "namespace": "indices.get_data_stream_settings" + }, + "specLocation": "indices/get_data_stream_settings/IndicesGetDataStreamSettingsResponse.ts#L22-L27" + }, { "kind": "request", "attachedBehaviors": [ @@ -146638,6 +146812,310 @@ }, "specLocation": "indices/put_data_stream_options/IndicesPutDataStreamOptionsResponse.ts#L22-L25" }, + { + "kind": "interface", + "name": { + "name": "DataStreamSettingsError", + "namespace": "indices.put_data_stream_settings" + }, + "properties": [ + { + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + }, + { + "description": "A message explaining why the settings could not be applied to specific indices.", + "name": "error", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts#L71-L77" + }, + { + "kind": "interface", + "name": { + "name": "IndexSettingResults", + "namespace": "indices.put_data_stream_settings" + }, + "properties": [ + { + "description": "The list of settings that were applied to the data stream but not to backing indices. These will be applied to\nthe write index the next time the data stream is rolled over.", + "name": "applied_to_data_stream_only", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "The list of settings that were applied to the data stream and to all of its backing indices. These settings will\nalso be applied to the write index the next time the data stream is rolled over.", + "name": "applied_to_data_stream_and_backing_indices", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "name": "errors", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "DataStreamSettingsError", + "namespace": "indices.put_data_stream_settings" + } + } + } + } + ], + "specLocation": "indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts#L57-L69" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "value", + "codegenName": "settings", + "value": { + "kind": "instance_of", + "type": { + "name": "IndexSettings", + "namespace": "indices._types" + } + } + }, + "description": "Update data stream settings.\n\nThis API can be used to override settings on specific data streams. These overrides will take precedence over what\nis specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state,\nonly certain settings are allowed. If possible, the setting change is applied to all\nbacking indices. Otherwise, it will be applied when the data stream is next rolled over.", + "examples": { + "IndicesPutDataStreamSettingsRequestExample1": { + "description": "This is a request to change two settings on a data stream.\n", + "summary": "Change a data stream setting", + "value": "{\n \"index.lifecycle.name\" : \"new-test-policy\",\n \"index.number_of_shards\": 11\n}" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "indices.put_data_stream_settings" + }, + "path": [ + { + "description": "A comma-separated list of data streams or data stream patterns.", + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Indices", + "namespace": "_types" + } + } + } + ], + "query": [ + { + "description": "If `true`, the request does not actually change the settings on any data streams or indices. Instead, it\nsimulates changing the settings and reports back to the user what would have happened had these settings\nactually been applied.", + "name": "dry_run", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "The period to wait for a response. If no response is received before the\n timeout expires, the request fails and returns an error.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts#L25-L77" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "data_streams", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "UpdatedDataStreamSettings", + "namespace": "indices.put_data_stream_settings" + } + } + } + } + ] + }, + "examples": { + "IndicesPutDataStreamSettingsResponseExample1": { + "description": "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when two settings are successfully updated on the data stream. In this case, `index.number_of_shards` is only applied to the data stream -- it will be applied to the write index on rollover. The setting `index.lifecycle.name` is applied to the data stream and all backing indices.\n", + "summary": "Change data stream settings on a data stream", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": true,\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n },\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [\n \"index.number_of_shards\"\n ],\n \"applied_to_data_stream_and_backing_indices\": [\n \"index.lifecycle.name\"\n ]\n }\n }\n ]\n}" + }, + "IndicesPutDataStreamSettingsResponseExample2": { + "description": "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a setting is successfully applied to the data stream, but one of the backing indices, `.ds-my-data-stream-2025.05.28-000001`, has a write block. The response reports that the setting was not successfully applied to that index.\n", + "summary": "Change data stream settings on a data stream that has an index with a metadata block", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": true,\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n },\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [\n \"index.number_of_shards\"\n ],\n \"applied_to_data_stream_and_backing_indices\": [\n \"index.lifecycle.name\"\n ],\n \"errors\": [\n {\n \"index\": \".ds-my-data-stream-2025.05.28-000001\",\n \"error\": \"index [.ds-my-data-stream-2025.05.28-000001] blocked by: [FORBIDDEN/9/index metadata (api)];\"\n }\n ]\n }\n }\n ]\n}" + }, + "IndicesPutDataStreamSettingsResponseExample3": { + "description": "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a user attempts to set a setting that is not allowed on a data stream. As a result, no change was applied to the data stream.\n", + "summary": "Attempt to change a data stream setting that is not allowed", + "value": "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": false,\n \"error\": \"Cannot set the following settings on a data stream: [index.number_of_replicas]\",\n \"settings\": {},\n \"effective_settings\": {},\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [],\n \"applied_to_data_stream_and_backing_indices\": []\n }\n }\n ]\n}" + } + }, + "name": { + "name": "Response", + "namespace": "indices.put_data_stream_settings" + }, + "specLocation": "indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts#L23-L28" + }, + { + "kind": "interface", + "name": { + "name": "UpdatedDataStreamSettings", + "namespace": "indices.put_data_stream_settings" + }, + "properties": [ + { + "description": "The data stream name.", + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + }, + { + "description": "If the settings were successfully applied to the data stream (or would have been, if running in `dry_run`\nmode), it is `true`. If an error occurred, it is `false`.", + "name": "applied_to_data_stream", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "A message explaining why the settings could not be applied to the data stream.", + "name": "error", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The settings that are specfic to this data stream that will override any settings from the matching index template.", + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexSettings", + "namespace": "indices._types" + } + } + }, + { + "description": "The settings that are effective on this data stream, taking into account the settings from the matching index\ntemplate and the settings specific to this data stream.", + "name": "effective_settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexSettings", + "namespace": "indices._types" + } + } + }, + { + "description": "Information about whether and where each setting was applied.", + "name": "index_settings_results", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexSettingResults", + "namespace": "indices.put_data_stream_settings" + } + } + } + ], + "specLocation": "indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts#L30-L55" + }, { "kind": "interface", "name": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 1f9546ef15..8f98612b1e 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11436,6 +11436,7 @@ export interface IndicesDataStream { name: DataStreamName replicated?: boolean rollover_on_write: boolean + settings: IndicesIndexSettings status: HealthStatus system?: boolean template: Name @@ -12469,6 +12470,21 @@ export interface IndicesGetDataStreamOptionsResponse { data_streams: IndicesGetDataStreamOptionsDataStreamWithOptions[] } +export interface IndicesGetDataStreamSettingsDataStreamSettings { + name: string + settings: IndicesIndexSettings + effective_settings: IndicesIndexSettings +} + +export interface IndicesGetDataStreamSettingsRequest extends RequestBase { + name: Indices + master_timeout?: Duration +} + +export interface IndicesGetDataStreamSettingsResponse { + data_streams: IndicesGetDataStreamSettingsDataStreamSettings[] +} + export interface IndicesGetFieldMappingRequest extends RequestBase { fields: Fields index?: Indices @@ -12675,6 +12691,38 @@ export interface IndicesPutDataStreamOptionsRequest extends RequestBase { export type IndicesPutDataStreamOptionsResponse = AcknowledgedResponseBase +export interface IndicesPutDataStreamSettingsDataStreamSettingsError { + index: IndexName + error: string +} + +export interface IndicesPutDataStreamSettingsIndexSettingResults { + applied_to_data_stream_only: string[] + applied_to_data_stream_and_backing_indices: string[] + errors?: IndicesPutDataStreamSettingsDataStreamSettingsError[] +} + +export interface IndicesPutDataStreamSettingsRequest extends RequestBase { + name: Indices + dry_run?: boolean + master_timeout?: Duration + timeout?: Duration + body?: IndicesIndexSettings +} + +export interface IndicesPutDataStreamSettingsResponse { + data_streams: IndicesPutDataStreamSettingsUpdatedDataStreamSettings[] +} + +export interface IndicesPutDataStreamSettingsUpdatedDataStreamSettings { + name: IndexName + applied_to_data_stream: boolean + error?: string + settings: IndicesIndexSettings + effective_settings: IndicesIndexSettings + index_settings_results: IndicesPutDataStreamSettingsIndexSettingResults +} + export interface IndicesPutIndexTemplateIndexTemplateMapping { aliases?: Record mappings?: MappingTypeMapping diff --git a/package-lock.json b/package-lock.json index be9f51713e..29b3d8da90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,9 +42,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.4.tgz", - "integrity": "sha512-t3yaEOuGu9NlIZ+hIeGbBjFtZT7j2cb2tg0fuaJKeGotchRjjLfrBA9Kwf8quhpP1EUuxModQg04q/mBwyg8uA==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", + "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -1199,9 +1199,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.15.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.29.tgz", - "integrity": "sha512-LNdjOkUDlU1RZb8e1kOIUpN1qQUlzGkEtbVNo53vbrwDg5om6oduhm4SiUaPW5ASTXhAiP0jInWG8Qx9fVlOeQ==", + "version": "22.15.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.30.tgz", + "integrity": "sha512-6Q7lr06bEHdlfplU6YRbgG1SFBdlsfNC4/lX+SkhiTs0cpJkOElmWls8PxDFv4yY/xKb8Y6SO0OmSX4wgqTZbA==", "license": "MIT", "dependencies": { "undici-types": "~6.21.0" @@ -2291,14 +2291,15 @@ "license": "MIT" }, "node_modules/form-data": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", + "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 8855539414..d190c3013d 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -306,6 +306,7 @@ indices-exists,https://www.elastic.co/docs/api/doc/elasticsearch/operation/opera indices-flush,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-flush indices-forcemerge,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-forcemerge indices-get-alias,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-alias +indices-get-data-stream-settings,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-settings indices-get-field-mapping,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping indices-get-index,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get indices-get-mapping,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping @@ -313,6 +314,7 @@ indices-get-settings,https://www.elastic.co/docs/api/doc/elasticsearch/operation indices-get-template,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-index-template indices-get-template-v1,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-template indices-open-close,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-open +indices-put-data-stream-settings,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-settings indices-put-mapping,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-mapping indices-recovery,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-recovery indices-refresh,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-refresh diff --git a/specification/_json_spec/indices.get_data_stream_settings.json b/specification/_json_spec/indices.get_data_stream_settings.json index 856a2a2aca..c71529e785 100644 --- a/specification/_json_spec/indices.get_data_stream_settings.json +++ b/specification/_json_spec/indices.get_data_stream_settings.json @@ -5,8 +5,7 @@ "description": "Gets a data stream's settings" }, "stability": "stable", - "visibility": "feature_flag", - "feature_flag": "logs_stream", + "visibility": "public", "headers": { "accept": ["application/json"] }, @@ -18,20 +17,17 @@ "parts": { "name": { "type": "string", - "description": "The name of the data stream or data stream pattern" + "description": "Comma-separated list of data streams or data stream patterns" } } } ] }, "params": { - "timeout": { - "type": "time", - "description": "Specify timeout for acknowledging the cluster state update" - }, "master_timeout": { "type": "time", - "description": "Specify timeout for connection to master" + "description": "Period to wait for a connection to the master node", + "default": "30s" } } } diff --git a/specification/_json_spec/indices.put_data_stream_settings.json b/specification/_json_spec/indices.put_data_stream_settings.json index 2300efb18f..67207e0e5d 100644 --- a/specification/_json_spec/indices.put_data_stream_settings.json +++ b/specification/_json_spec/indices.put_data_stream_settings.json @@ -5,8 +5,7 @@ "description": "Updates a data stream's settings" }, "stability": "stable", - "visibility": "feature_flag", - "feature_flag": "logs_stream", + "visibility": "public", "headers": { "accept": ["application/json"] }, @@ -18,7 +17,7 @@ "parts": { "name": { "type": "string", - "description": "The name of the data stream or data stream pattern" + "description": "Comma-separated list of data streams or data stream patterns" } } } @@ -27,16 +26,18 @@ "params": { "dry_run": { "type": "boolean", - "description": "Perform a dry run but do not actually change any settings", + "description": "Whether this request should only be a dry run rather than actually applying settings", "default": false }, "timeout": { "type": "time", - "description": "Specify timeout for acknowledging the cluster state update" + "description": "Period to wait for a response", + "default": "30s" }, "master_timeout": { "type": "time", - "description": "Specify timeout for connection to master" + "description": "Period to wait for a connection to the master node", + "default": "30s" } }, "body": { diff --git a/specification/indices/_types/DataStream.ts b/specification/indices/_types/DataStream.ts index d054e3714a..76528276c8 100644 --- a/specification/indices/_types/DataStream.ts +++ b/specification/indices/_types/DataStream.ts @@ -28,6 +28,7 @@ import { } from '@_types/common' import { integer } from '@_types/Numeric' import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle' +import { IndexSettings } from '@indices/_types/IndexSettings' enum ManagedBy { ilm = 'Index Lifecycle Management', @@ -112,6 +113,11 @@ export class DataStream { * If `true`, the next write to this data stream will trigger a rollover first and the document will be indexed in the new backing index. If the rollover fails the indexing request will fail too. */ rollover_on_write: boolean + /** + * The settings specific to this data stream that will take precedence over the settings in the matching index + * template. + */ + settings: IndexSettings /** * 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. diff --git a/specification/indices/get_data_stream_settings/IndicesGetDataStreamSettingsRequest.ts b/specification/indices/get_data_stream_settings/IndicesGetDataStreamSettingsRequest.ts new file mode 100644 index 0000000000..ed09b3bd04 --- /dev/null +++ b/specification/indices/get_data_stream_settings/IndicesGetDataStreamSettingsRequest.ts @@ -0,0 +1,57 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { RequestBase } from '@_types/Base' +import { Indices } from '@_types/common' +import { Duration } from '@_types/Time' + +/** + * Get data stream settings. + * + * Get setting information for one or more data streams. + * @rest_spec_name indices.get_data_stream_settings + * @availability stack stability=stable visibility=public + * @availability serverless stability=stable visibility=public + * @index_privileges view_index_metadata + * @doc_id indices-get-data-stream-settings + * @doc_tag data stream + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_data_stream/{name}/_settings' + methods: ['GET'] + } + ] + path_parts: { + /** + * A comma-separated list of data streams or data stream patterns. Supports wildcards (`*`). + */ + name: Indices + } + query_parameters: { + /** + * The period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an + * error. + * @server_default 30s + */ + master_timeout?: Duration + } +} diff --git a/specification/indices/get_data_stream_settings/IndicesGetDataStreamSettingsResponse.ts b/specification/indices/get_data_stream_settings/IndicesGetDataStreamSettingsResponse.ts new file mode 100644 index 0000000000..76febd1458 --- /dev/null +++ b/specification/indices/get_data_stream_settings/IndicesGetDataStreamSettingsResponse.ts @@ -0,0 +1,39 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { IndexSettings } from '@indices/_types/IndexSettings' + +export class Response { + /** @codegen_name data_stream_settings */ + body: { + data_streams: Array + } +} + +export class DataStreamSettings { + /** The name of the data stream. */ + name: string + /** The settings specific to this data stream */ + settings: IndexSettings + /** + * The settings specific to this data stream merged with the settings from its template. These `effective_settings` + * are the settings that will be used when a new index is created for this data stream. + */ + effective_settings: IndexSettings +} diff --git a/specification/indices/get_data_stream_settings/examples/200_response/IndicesGetDataStreamSettingsResponseExample1.yaml b/specification/indices/get_data_stream_settings/examples/200_response/IndicesGetDataStreamSettingsResponseExample1.yaml new file mode 100644 index 0000000000..242ca1c231 --- /dev/null +++ b/specification/indices/get_data_stream_settings/examples/200_response/IndicesGetDataStreamSettingsResponseExample1.yaml @@ -0,0 +1,32 @@ +summary: Get data stream settings on a data stream +description: > + This is a response to `GET /_data_stream/my-data-stream/_settings` where my-data-stream that has two settings set. The + `effective_settings` field shows additional settings that are pulled from its template. +# type: response +# response_code: 200 +value: |- + { + "data_streams": [ + { + "name": "my-data-stream", + "settings": { + "index": { + "lifecycle": { + "name": "new-test-policy" + }, + "number_of_shards": "11" + } + }, + "effective_settings": { + "index": { + "lifecycle": { + "name": "new-test-policy" + }, + "mode": "standard", + "number_of_shards": "11", + "number_of_replicas": "0" + } + } + } + ] + } diff --git a/specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts b/specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts new file mode 100644 index 0000000000..3eb1e02b06 --- /dev/null +++ b/specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts @@ -0,0 +1,77 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { RequestBase } from '@_types/Base' +import { Indices } from '@_types/common' +import { Duration } from '@_types/Time' +import { IndexSettings } from '@indices/_types/IndexSettings' + +/** + * Update data stream settings. + * + * This API can be used to override settings on specific data streams. These overrides will take precedence over what + * is specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state, + * only certain settings are allowed. If possible, the setting change is applied to all + * backing indices. Otherwise, it will be applied when the data stream is next rolled over. + * @rest_spec_name indices.put_data_stream_settings + * @availability stack stability=stable visibility=public + * @availability serverless stability=stable visibility=public + * @index_privileges manage + * @doc_id indices-put-data-stream-settings + * @doc_tag data stream + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_data_stream/{name}/_settings' + methods: ['PUT'] + } + ] + path_parts: { + /** + * A comma-separated list of data streams or data stream patterns. + */ + name: Indices + } + query_parameters: { + /** + * If `true`, the request does not actually change the settings on any data streams or indices. Instead, it + * simulates changing the settings and reports back to the user what would have happened had these settings + * actually been applied. + * @server_default false + */ + dry_run?: boolean + /** + * The period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an + * error. + * @server_default 30s + */ + master_timeout?: Duration + /** + * The period to wait for a response. If no response is received before the + * timeout expires, the request fails and returns an error. + * @server_default 30s + */ + timeout?: Duration + } + /** Settings to be applied to the data stream. + * @codegen_name settings */ + body: IndexSettings +} diff --git a/specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts b/specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts new file mode 100644 index 0000000000..d6fe12480f --- /dev/null +++ b/specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts @@ -0,0 +1,77 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { IndexName } from '@_types/common' +import { IndexSettings } from '@indices/_types/IndexSettings' + +export class Response { + /** @codegen_name data_stream_settings_results */ + body: { + data_streams: Array + } +} + +export class UpdatedDataStreamSettings { + /** The data stream name. */ + name: IndexName + /** + * If the settings were successfully applied to the data stream (or would have been, if running in `dry_run` + * mode), it is `true`. If an error occurred, it is `false`. + */ + applied_to_data_stream: boolean + /** + * A message explaining why the settings could not be applied to the data stream. + */ + error?: string + /** + * The settings that are specfic to this data stream that will override any settings from the matching index template. + */ + settings: IndexSettings + /** + * The settings that are effective on this data stream, taking into account the settings from the matching index + * template and the settings specific to this data stream. + */ + effective_settings: IndexSettings + /** + * Information about whether and where each setting was applied. + */ + index_settings_results: IndexSettingResults +} + +export class IndexSettingResults { + /** + * The list of settings that were applied to the data stream but not to backing indices. These will be applied to + * the write index the next time the data stream is rolled over. + */ + applied_to_data_stream_only: Array + /** + * The list of settings that were applied to the data stream and to all of its backing indices. These settings will + * also be applied to the write index the next time the data stream is rolled over. + */ + applied_to_data_stream_and_backing_indices: Array + errors?: Array +} + +export class DataStreamSettingsError { + index: IndexName + /** + * A message explaining why the settings could not be applied to specific indices. + */ + error: string +} diff --git a/specification/indices/put_data_stream_settings/examples/200_response/IndicesPutDataStreamSettingsResponseExample1.yaml b/specification/indices/put_data_stream_settings/examples/200_response/IndicesPutDataStreamSettingsResponseExample1.yaml new file mode 100644 index 0000000000..5a64c1bc15 --- /dev/null +++ b/specification/indices/put_data_stream_settings/examples/200_response/IndicesPutDataStreamSettingsResponseExample1.yaml @@ -0,0 +1,42 @@ +summary: Change data stream settings on a data stream +description: > + This shows a response to `PUT /_data_stream/my-data-stream/_settings` when two settings are successfully updated on + the data stream. In this case, `index.number_of_shards` is only applied to the data stream -- it will be applied to + the write index on rollover. The setting `index.lifecycle.name` is applied to the data stream and all backing indices. +# type: response +# response_code: 200 +value: |- + { + "data_streams": [ + { + "name": "my-data-stream", + "applied_to_data_stream": true, + "settings": { + "index": { + "lifecycle": { + "name": "new-test-policy" + }, + "number_of_shards": "11" + } + }, + "effective_settings": { + "index": { + "lifecycle": { + "name": "new-test-policy" + }, + "mode": "standard", + "number_of_shards": "11", + "number_of_replicas": "0" + } + }, + "index_settings_results": { + "applied_to_data_stream_only": [ + "index.number_of_shards" + ], + "applied_to_data_stream_and_backing_indices": [ + "index.lifecycle.name" + ] + } + } + ] + } diff --git a/specification/indices/put_data_stream_settings/examples/200_response/IndicesPutDataStreamSettingsResponseExample2.yaml b/specification/indices/put_data_stream_settings/examples/200_response/IndicesPutDataStreamSettingsResponseExample2.yaml new file mode 100644 index 0000000000..e2f3a5408e --- /dev/null +++ b/specification/indices/put_data_stream_settings/examples/200_response/IndicesPutDataStreamSettingsResponseExample2.yaml @@ -0,0 +1,48 @@ +summary: Change data stream settings on a data stream that has an index with a metadata block +description: > + This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a setting is successfully applied to the + data stream, but one of the backing indices, `.ds-my-data-stream-2025.05.28-000001`, has a write block. The response + reports that the setting was not successfully applied to that index. +# type: response +# response_code: 200 +value: |- + { + "data_streams": [ + { + "name": "my-data-stream", + "applied_to_data_stream": true, + "settings": { + "index": { + "lifecycle": { + "name": "new-test-policy" + }, + "number_of_shards": "11" + } + }, + "effective_settings": { + "index": { + "lifecycle": { + "name": "new-test-policy" + }, + "mode": "standard", + "number_of_shards": "11", + "number_of_replicas": "0" + } + }, + "index_settings_results": { + "applied_to_data_stream_only": [ + "index.number_of_shards" + ], + "applied_to_data_stream_and_backing_indices": [ + "index.lifecycle.name" + ], + "errors": [ + { + "index": ".ds-my-data-stream-2025.05.28-000001", + "error": "index [.ds-my-data-stream-2025.05.28-000001] blocked by: [FORBIDDEN/9/index metadata (api)];" + } + ] + } + } + ] + } diff --git a/specification/indices/put_data_stream_settings/examples/200_response/IndicesPutDataStreamSettingsResponseExample3.yaml b/specification/indices/put_data_stream_settings/examples/200_response/IndicesPutDataStreamSettingsResponseExample3.yaml new file mode 100644 index 0000000000..aa84c40da1 --- /dev/null +++ b/specification/indices/put_data_stream_settings/examples/200_response/IndicesPutDataStreamSettingsResponseExample3.yaml @@ -0,0 +1,22 @@ +summary: Attempt to change a data stream setting that is not allowed +description: > + This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a user attempts to set a setting that is + not allowed on a data stream. As a result, no change was applied to the data stream. +# type: response +# response_code: 200 +value: |- + { + "data_streams": [ + { + "name": "my-data-stream", + "applied_to_data_stream": false, + "error": "Cannot set the following settings on a data stream: [index.number_of_replicas]", + "settings": {}, + "effective_settings": {}, + "index_settings_results": { + "applied_to_data_stream_only": [], + "applied_to_data_stream_and_backing_indices": [] + } + } + ] + } diff --git a/specification/indices/put_data_stream_settings/examples/request/IndicesPutDataStreamSettingsRequestExample1.yaml b/specification/indices/put_data_stream_settings/examples/request/IndicesPutDataStreamSettingsRequestExample1.yaml new file mode 100644 index 0000000000..15331dc534 --- /dev/null +++ b/specification/indices/put_data_stream_settings/examples/request/IndicesPutDataStreamSettingsRequestExample1.yaml @@ -0,0 +1,10 @@ +summary: Change a data stream setting +# method_request: PUT /_data_stream/my-data-stream/_settings +description: > + This is a request to change two settings on a data stream. +# type: request +value: |- + { + "index.lifecycle.name" : "new-test-policy", + "index.number_of_shards": 11 + }