From 59c2a9c0967c3b27ef9f175c49cffe9501294955 Mon Sep 17 00:00:00 2001 From: Luke Whiting Date: Wed, 17 Sep 2025 08:02:19 +0100 Subject: [PATCH 1/3] Add spec and docs for new logs streams endpoints (#5258) * Add spec and docs for new logs streams endpoints * Add @codegen name to Acked responses * Linting fix * Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Correct feature flag * Add doc-ids * Fix doc-ids * Update specification/_doc_ids/table.csv Co-authored-by: Quentin Pradet * Update specification/_doc_ids/table.csv Co-authored-by: Quentin Pradet * Add default timeouts --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Quentin Pradet (cherry picked from commit 995d6861198f6e1b3633ad63348a55ff572734d2) # Conflicts: # specification/_doc_ids/table.csv --- output/schema/schema.json | 325 +++++++++++++++++- output/schema/validation-errors.json | 9 +- output/typescript/types.ts | 26 ++ specification/_doc_ids/table.csv | 3 + .../logs_disable/StreamsLogsDisableRequest.ts | 55 +++ .../StreamsLogsDisableResponse.ts | 25 ++ ...ostStreamsLogsDisableResponseExample1.yaml | 6 + .../PostStreamsDisableRequestExample1.yaml | 3 + .../logs_enable/StreamsLogsEnableRequest.ts | 59 ++++ .../logs_enable/StreamsLogsEnableResponse.ts | 25 ++ ...PostStreamsLogsEnableResponseExample1.yaml | 6 + ...PostStreamsLogsEnableResponseExample2.yaml | 19 + .../PostStreamsEnableRequestExample1.yaml | 3 + .../streams/status/StreamsStatusRequest.ts | 47 +++ .../streams/status/StreamsStatusResponse.ts | 28 ++ .../GetStreamsStatusResponseExample1.yaml | 9 + .../GetStreamsStatusRequestExample1.yaml | 3 + specification/tsconfig.json | 1 + 18 files changed, 636 insertions(+), 16 deletions(-) create mode 100644 specification/streams/logs_disable/StreamsLogsDisableRequest.ts create mode 100644 specification/streams/logs_disable/StreamsLogsDisableResponse.ts create mode 100644 specification/streams/logs_disable/examples/200_response/PostStreamsLogsDisableResponseExample1.yaml create mode 100644 specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml create mode 100644 specification/streams/logs_enable/StreamsLogsEnableRequest.ts create mode 100644 specification/streams/logs_enable/StreamsLogsEnableResponse.ts create mode 100644 specification/streams/logs_enable/examples/200_response/PostStreamsLogsEnableResponseExample1.yaml create mode 100644 specification/streams/logs_enable/examples/409_response/PostStreamsLogsEnableResponseExample2.yaml create mode 100644 specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml create mode 100644 specification/streams/status/StreamsStatusRequest.ts create mode 100644 specification/streams/status/StreamsStatusResponse.ts create mode 100644 specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml create mode 100644 specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml diff --git a/output/schema/schema.json b/output/schema/schema.json index fafadf7984..43d019ae8c 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -21811,16 +21811,29 @@ "availability": { "stack": { "featureFlag": "logs_stream", - "stability": "stable", + "since": "9.1.0", + "stability": "experimental", "visibility": "feature_flag" } }, - "description": "Disable the Logs Streams feature for this cluster", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-disable.html", + "description": "Disable logs stream\n\nThis disables the logs stream feature for this cluster.", + "docId": "streams-logs-disable", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.logs_disable", - "request": null, + "privileges": { + "cluster": [ + "manage" + ] + }, + "request": { + "name": "Request", + "namespace": "streams.logs_disable" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "streams.logs_disable" + }, "responseMediaType": [ "application/json", "text/plain" @@ -21838,16 +21851,29 @@ "availability": { "stack": { "featureFlag": "logs_stream", - "stability": "stable", + "since": "9.1.0", + "stability": "experimental", "visibility": "feature_flag" } }, - "description": "Enable the Logs Streams feature for this cluster", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-enable.html", + "description": "Enable logs stream\n\nThis enables the logs stream feature for this cluster.\n\nNote: To protect existing data, this feature can only be enabled on a cluster if\nit does not have existing indices or data streams matching the pattern `logs|logs.*`.\nIf this is the case, a `409 - Conflict` response and error will be returned.", + "docId": "streams-logs-enable", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.logs_enable", - "request": null, + "privileges": { + "cluster": [ + "manage" + ] + }, + "request": { + "name": "Request", + "namespace": "streams.logs_enable" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "streams.logs_enable" + }, "responseMediaType": [ "application/json", "text/plain" @@ -21865,16 +21891,29 @@ "availability": { "stack": { "featureFlag": "logs_stream", - "stability": "stable", + "since": "9.1.0", + "stability": "experimental", "visibility": "feature_flag" } }, - "description": "Return the current status of the streams feature for each streams type", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-status.html", + "description": "Get the status of streams\n\nGets the current status of all stream types", + "docId": "streams-status", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.status", - "request": null, + "privileges": { + "cluster": [ + "monitor" + ] + }, + "request": { + "name": "Request", + "namespace": "streams.status" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "streams.status" + }, "responseMediaType": [ "application/json" ], @@ -254013,6 +254052,262 @@ }, "specLocation": "ssl/certificates/GetCertificatesResponse.ts#L22-L24" }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Disable logs stream\n\nThis disables the logs stream feature for this cluster.", + "examples": { + "PostStreamsDisableRequestExample1": { + "method_request": "POST _streams/logs/_disable", + "summary": "Disable the logs streams on this cluster" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "streams.logs_disable" + }, + "path": [], + "query": [ + { + "description": "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "The period to wait for a response.\nIf no response is received before the 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": "streams/logs_disable/StreamsLogsDisableRequest.ts#L23-L55" + }, + { + "kind": "response", + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } + }, + "examples": { + "PostStreamsLogsDisableResponseExample1": { + "description": "A successful response from `POST _streams/logs/_disable` endpoint\n", + "summary": "Disable logs streams", + "value": "{\n \"acknowledged\": true\n}" + } + }, + "name": { + "name": "Response", + "namespace": "streams.logs_disable" + }, + "specLocation": "streams/logs_disable/StreamsLogsDisableResponse.ts#L22-L25" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Enable logs stream\n\nThis enables the logs stream feature for this cluster.\n\nNote: To protect existing data, this feature can only be enabled on a cluster if\nit does not have existing indices or data streams matching the pattern `logs|logs.*`.\nIf this is the case, a `409 - Conflict` response and error will be returned.", + "examples": { + "PostStreamsEnableRequestExample1": { + "method_request": "POST _streams/logs/_enable", + "summary": "Enable the logs streams on this cluster" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "streams.logs_enable" + }, + "path": [], + "query": [ + { + "description": "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "The period to wait for a response.\nIf no response is received before the 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": "streams/logs_enable/StreamsLogsEnableRequest.ts#L23-L59" + }, + { + "kind": "response", + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } + }, + "examples": { + "PostStreamsLogsEnableResponseExample1": { + "description": "A successful response from `POST _streams/logs/_enable` endpoint\n", + "summary": "Enable logs streams", + "value": "{\n \"acknowledged\": true\n}" + } + }, + "name": { + "name": "Response", + "namespace": "streams.logs_enable" + }, + "specLocation": "streams/logs_enable/StreamsLogsEnableResponse.ts#L22-L25" + }, + { + "kind": "interface", + "name": { + "name": "LogsStatus", + "namespace": "streams.status" + }, + "properties": [ + { + "name": "enabled", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "streams/status/StreamsStatusResponse.ts#L26-L28" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Get the status of streams\n\nGets the current status of all stream types", + "examples": { + "GetStreamsStatusRequestExample1": { + "method_request": "GET _streams/status", + "summary": "Get the current status of streams" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "streams.status" + }, + "path": [], + "query": [ + { + "description": "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.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "TimeUnit", + "namespace": "_types" + } + } + } + ], + "specLocation": "streams/status/StreamsStatusRequest.ts#L23-L47" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "logs", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "LogsStatus", + "namespace": "streams.status" + } + } + } + ] + }, + "examples": { + "GetStreamsStatusResponseExample1": { + "summary": "Get Streams Status A successful response from `GET _streams/status` that outlines the current state of all wired streams in the cluster.", + "value": "{\n \"logs\": {\n \"enabled\": true\n }\n}" + } + }, + "name": { + "name": "Response", + "namespace": "streams.status" + }, + "specLocation": "streams/status/StreamsStatusResponse.ts#L20-L24" + }, { "kind": "interface", "name": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 9ea4cbbf06..fd55468b1f 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1,5 +1,12 @@ { - "endpointErrors": {}, + "endpointErrors": { + "streams.status": { + "request": [ + "Request: query parameter 'master_timeout' does not exist in the json spec" + ], + "response": [] + } + }, "generalErrors": [ "Dangling type '_global.scripts_painless_execute:PainlessExecutionPosition'", "Dangling type '_global.scripts_painless_execute:PainlessScript'", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 763c335348..934af95006 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -21705,6 +21705,32 @@ export interface SslCertificatesRequest extends RequestBase { export type SslCertificatesResponse = SslCertificatesCertificateInformation[] +export interface StreamsLogsDisableRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration +} + +export type StreamsLogsDisableResponse = AcknowledgedResponseBase + +export interface StreamsLogsEnableRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration +} + +export type StreamsLogsEnableResponse = AcknowledgedResponseBase + +export interface StreamsStatusLogsStatus { + enabled: boolean +} + +export interface StreamsStatusRequest extends RequestBase { + master_timeout?: TimeUnit +} + +export interface StreamsStatusResponse { + logs: StreamsStatusLogsStatus +} + export interface SynonymsSynonymRule { id?: Id synonyms: SynonymsSynonymString diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 134ad5d3a8..fe3dc2040b 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -869,6 +869,9 @@ stop-dfanalytics,https://www.elastic.co/guide/en/elasticsearch/reference/{branch stop-trained-model-deployment,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/stop-trained-model-deployment.html,, stop-transform,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/stop-transform.html,, stored-fields,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-fields.html#stored-fields,, +streams-status,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,, +streams-logs-enable,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,, +streams-logs-disable,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,, synonym-rule-create,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/put-synonym-rule.html,, synonym-rule-delete,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-synonym-rule.html,, synonym-rule-get,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-synonym-rule.html,, diff --git a/specification/streams/logs_disable/StreamsLogsDisableRequest.ts b/specification/streams/logs_disable/StreamsLogsDisableRequest.ts new file mode 100644 index 0000000000..85bf71a197 --- /dev/null +++ b/specification/streams/logs_disable/StreamsLogsDisableRequest.ts @@ -0,0 +1,55 @@ +/* + * 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 { Duration } from '@_types/Time' + +/** + * Disable logs stream + * + * This disables the logs stream feature for this cluster. + * @rest_spec_name streams.logs_disable + * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream + * @cluster_privileges manage + * @doc_id streams-logs-disable + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_streams/logs/_disable' + methods: ['POST'] + } + ] + 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 + /** + * 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 + } +} diff --git a/specification/streams/logs_disable/StreamsLogsDisableResponse.ts b/specification/streams/logs_disable/StreamsLogsDisableResponse.ts new file mode 100644 index 0000000000..9e7bdb91cd --- /dev/null +++ b/specification/streams/logs_disable/StreamsLogsDisableResponse.ts @@ -0,0 +1,25 @@ +/* + * 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 { AcknowledgedResponseBase } from '@_types/Base' + +export class Response { + /** @codegen_name result */ + body: AcknowledgedResponseBase +} diff --git a/specification/streams/logs_disable/examples/200_response/PostStreamsLogsDisableResponseExample1.yaml b/specification/streams/logs_disable/examples/200_response/PostStreamsLogsDisableResponseExample1.yaml new file mode 100644 index 0000000000..3add46c389 --- /dev/null +++ b/specification/streams/logs_disable/examples/200_response/PostStreamsLogsDisableResponseExample1.yaml @@ -0,0 +1,6 @@ +summary: Disable logs streams +description: > + A successful response from `POST _streams/logs/_disable` endpoint +# type: response +value: + acknowledged: true diff --git a/specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml b/specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml new file mode 100644 index 0000000000..b286db3e0e --- /dev/null +++ b/specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml @@ -0,0 +1,3 @@ +summary: 'Disable the logs streams on this cluster' +method_request: POST _streams/logs/_disable +# type: request diff --git a/specification/streams/logs_enable/StreamsLogsEnableRequest.ts b/specification/streams/logs_enable/StreamsLogsEnableRequest.ts new file mode 100644 index 0000000000..43b5948b88 --- /dev/null +++ b/specification/streams/logs_enable/StreamsLogsEnableRequest.ts @@ -0,0 +1,59 @@ +/* + * 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 { Duration } from '@_types/Time' + +/** + * Enable logs stream + * + * This enables the logs stream feature for this cluster. + * + * Note: To protect existing data, this feature can only be enabled on a cluster if + * it does not have existing indices or data streams matching the pattern `logs|logs.*`. + * If this is the case, a `409 - Conflict` response and error will be returned. + * @rest_spec_name streams.logs_enable + * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream + * @cluster_privileges manage + * @doc_id streams-logs-enable + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_streams/logs/_enable' + methods: ['POST'] + } + ] + 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 + /** + * 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 + } +} diff --git a/specification/streams/logs_enable/StreamsLogsEnableResponse.ts b/specification/streams/logs_enable/StreamsLogsEnableResponse.ts new file mode 100644 index 0000000000..9e7bdb91cd --- /dev/null +++ b/specification/streams/logs_enable/StreamsLogsEnableResponse.ts @@ -0,0 +1,25 @@ +/* + * 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 { AcknowledgedResponseBase } from '@_types/Base' + +export class Response { + /** @codegen_name result */ + body: AcknowledgedResponseBase +} diff --git a/specification/streams/logs_enable/examples/200_response/PostStreamsLogsEnableResponseExample1.yaml b/specification/streams/logs_enable/examples/200_response/PostStreamsLogsEnableResponseExample1.yaml new file mode 100644 index 0000000000..bf5af6721a --- /dev/null +++ b/specification/streams/logs_enable/examples/200_response/PostStreamsLogsEnableResponseExample1.yaml @@ -0,0 +1,6 @@ +summary: Enable logs streams +description: > + A successful response from `POST _streams/logs/_enable` endpoint +# type: response +value: + acknowledged: true diff --git a/specification/streams/logs_enable/examples/409_response/PostStreamsLogsEnableResponseExample2.yaml b/specification/streams/logs_enable/examples/409_response/PostStreamsLogsEnableResponseExample2.yaml new file mode 100644 index 0000000000..5f20637ff6 --- /dev/null +++ b/specification/streams/logs_enable/examples/409_response/PostStreamsLogsEnableResponseExample2.yaml @@ -0,0 +1,19 @@ +summary: Enable logs streams - Failure due to conflicting index +description: > + An error response from the `POST _streams/logs/_enable` endpoint caused by attempting to enable logs streams + when an existing index with the name `logs` already exists +# type: response +value: |- + { + "error": { + "root_cause": [ + { + "type": "status_exception", + "reason": "Cannot enable logs streams: indices named 'logs' or starting with 'logs.' already exist." + } + ], + "type": "status_exception", + "reason": "Cannot enable logs streams: indices named 'logs' or starting with 'logs.' already exist." + }, + "status": 409 + } diff --git a/specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml b/specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml new file mode 100644 index 0000000000..246312fc54 --- /dev/null +++ b/specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml @@ -0,0 +1,3 @@ +summary: 'Enable the logs streams on this cluster' +method_request: POST _streams/logs/_enable +# type: request diff --git a/specification/streams/status/StreamsStatusRequest.ts b/specification/streams/status/StreamsStatusRequest.ts new file mode 100644 index 0000000000..db6883d95b --- /dev/null +++ b/specification/streams/status/StreamsStatusRequest.ts @@ -0,0 +1,47 @@ +/* + * 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 { TimeUnit } from '@_types/Time' + +/** + * Get the status of streams + * + * Gets the current status of all stream types + * @rest_spec_name streams.status + * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream + * @cluster_privileges monitor + * @doc_id streams-status + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_streams/status' + methods: ['GET'] + } + ] + query_parameters: { + /** + * 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?: TimeUnit + } +} diff --git a/specification/streams/status/StreamsStatusResponse.ts b/specification/streams/status/StreamsStatusResponse.ts new file mode 100644 index 0000000000..c5eb318485 --- /dev/null +++ b/specification/streams/status/StreamsStatusResponse.ts @@ -0,0 +1,28 @@ +/* + * 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. + */ + +export class Response { + body: { + logs: LogsStatus + } +} + +export class LogsStatus { + enabled: boolean +} diff --git a/specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml b/specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml new file mode 100644 index 0000000000..be7f745dcf --- /dev/null +++ b/specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml @@ -0,0 +1,9 @@ +summary: Get Streams Status + A successful response from `GET _streams/status` that outlines the current state of all wired streams in the cluster. +# type: response +value: |- + { + "logs": { + "enabled": true + } + } diff --git a/specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml b/specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml new file mode 100644 index 0000000000..920ce2cc90 --- /dev/null +++ b/specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml @@ -0,0 +1,3 @@ +summary: 'Get the current status of streams' +method_request: GET _streams/status +# type: request diff --git a/specification/tsconfig.json b/specification/tsconfig.json index e920f83fce..867d8f0655 100644 --- a/specification/tsconfig.json +++ b/specification/tsconfig.json @@ -50,6 +50,7 @@ "@shutdown/*": ["shutdown/*"], "@slm/*": ["slm/*"], "@snapshot/*": ["snapshot/*"], + "@streams/*": ["streams/*"], "@sql/*": ["sql/*"], "@ssl/*": ["ssl/*"], "@synonyms/*": ["synonyms/*"], From 62b7680898a5619d079413541996c980cfbd6c82 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 17 Sep 2025 09:24:51 -0700 Subject: [PATCH 2/3] Edit logs streams endpoints --- .../streams/logs_disable/StreamsLogsDisableRequest.ts | 4 ++-- .../streams/logs_enable/StreamsLogsEnableRequest.ts | 10 +++++----- specification/streams/status/StreamsStatusRequest.ts | 4 ++-- specification/streams/status/StreamsStatusResponse.ts | 3 +++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/specification/streams/logs_disable/StreamsLogsDisableRequest.ts b/specification/streams/logs_disable/StreamsLogsDisableRequest.ts index 85bf71a197..c44e6060cb 100644 --- a/specification/streams/logs_disable/StreamsLogsDisableRequest.ts +++ b/specification/streams/logs_disable/StreamsLogsDisableRequest.ts @@ -21,9 +21,9 @@ import { RequestBase } from '@_types/Base' import { Duration } from '@_types/Time' /** - * Disable logs stream + * Disable logs stream. * - * This disables the logs stream feature for this cluster. + * Turn off the logs stream feature for this cluster. * @rest_spec_name streams.logs_disable * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream * @cluster_privileges manage diff --git a/specification/streams/logs_enable/StreamsLogsEnableRequest.ts b/specification/streams/logs_enable/StreamsLogsEnableRequest.ts index 43b5948b88..71915b4446 100644 --- a/specification/streams/logs_enable/StreamsLogsEnableRequest.ts +++ b/specification/streams/logs_enable/StreamsLogsEnableRequest.ts @@ -21,13 +21,13 @@ import { RequestBase } from '@_types/Base' import { Duration } from '@_types/Time' /** - * Enable logs stream + * Enable logs stream. * - * This enables the logs stream feature for this cluster. + * Turn on the logs stream feature for this cluster. * - * Note: To protect existing data, this feature can only be enabled on a cluster if - * it does not have existing indices or data streams matching the pattern `logs|logs.*`. - * If this is the case, a `409 - Conflict` response and error will be returned. + * NOTE: To protect existing data, this feature can be turned on only if the + * cluster does not have existing indices or data streams that match the pattern `logs|logs.*`. + * If those indices or data streams exist, a `409 - Conflict` response and error is returned. * @rest_spec_name streams.logs_enable * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream * @cluster_privileges manage diff --git a/specification/streams/status/StreamsStatusRequest.ts b/specification/streams/status/StreamsStatusRequest.ts index db6883d95b..e3877e030c 100644 --- a/specification/streams/status/StreamsStatusRequest.ts +++ b/specification/streams/status/StreamsStatusRequest.ts @@ -21,9 +21,9 @@ import { RequestBase } from '@_types/Base' import { TimeUnit } from '@_types/Time' /** - * Get the status of streams + * Get the status of streams. * - * Gets the current status of all stream types + * Get the current status for all types of streams. * @rest_spec_name streams.status * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream * @cluster_privileges monitor diff --git a/specification/streams/status/StreamsStatusResponse.ts b/specification/streams/status/StreamsStatusResponse.ts index c5eb318485..ccc7f8d957 100644 --- a/specification/streams/status/StreamsStatusResponse.ts +++ b/specification/streams/status/StreamsStatusResponse.ts @@ -24,5 +24,8 @@ export class Response { } export class LogsStatus { + /** + * If true, the logs stream feature is enabled. + */ enabled: boolean } From 558fac835d9b70663c96658a86f860e02f712b87 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 17 Sep 2025 09:57:21 -0700 Subject: [PATCH 3/3] Regenerate output --- output/schema/schema.json | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 3e843d32fb..78d5ee6b7d 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -21816,7 +21816,7 @@ "visibility": "feature_flag" } }, - "description": "Disable logs stream\n\nThis disables the logs stream feature for this cluster.", + "description": "Disable logs stream.\n\nTurn off the logs stream feature for this cluster.", "docId": "streams-logs-disable", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.logs_disable", @@ -21856,7 +21856,7 @@ "visibility": "feature_flag" } }, - "description": "Enable logs stream\n\nThis enables the logs stream feature for this cluster.\n\nNote: To protect existing data, this feature can only be enabled on a cluster if\nit does not have existing indices or data streams matching the pattern `logs|logs.*`.\nIf this is the case, a `409 - Conflict` response and error will be returned.", + "description": "Enable logs stream.\n\nTurn on the logs stream feature for this cluster.\n\nNOTE: To protect existing data, this feature can be turned on only if the\ncluster does not have existing indices or data streams that match the pattern `logs|logs.*`.\nIf those indices or data streams exist, a `409 - Conflict` response and error is returned.", "docId": "streams-logs-enable", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.logs_enable", @@ -21896,7 +21896,7 @@ "visibility": "feature_flag" } }, - "description": "Get the status of streams\n\nGets the current status of all stream types", + "description": "Get the status of streams.\n\nGet the current status for all types of streams.", "docId": "streams-status", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.status", @@ -253772,7 +253772,7 @@ "body": { "kind": "no_body" }, - "description": "Disable logs stream\n\nThis disables the logs stream feature for this cluster.", + "description": "Disable logs stream.\n\nTurn off the logs stream feature for this cluster.", "examples": { "PostStreamsDisableRequestExample1": { "method_request": "POST _streams/logs/_disable", @@ -253853,7 +253853,7 @@ "body": { "kind": "no_body" }, - "description": "Enable logs stream\n\nThis enables the logs stream feature for this cluster.\n\nNote: To protect existing data, this feature can only be enabled on a cluster if\nit does not have existing indices or data streams matching the pattern `logs|logs.*`.\nIf this is the case, a `409 - Conflict` response and error will be returned.", + "description": "Enable logs stream.\n\nTurn on the logs stream feature for this cluster.\n\nNOTE: To protect existing data, this feature can be turned on only if the\ncluster does not have existing indices or data streams that match the pattern `logs|logs.*`.\nIf those indices or data streams exist, a `409 - Conflict` response and error is returned.", "examples": { "PostStreamsEnableRequestExample1": { "method_request": "POST _streams/logs/_enable", @@ -253934,6 +253934,7 @@ }, "properties": [ { + "description": "If true, the logs stream feature is enabled.", "name": "enabled", "required": true, "type": { @@ -253945,7 +253946,7 @@ } } ], - "specLocation": "streams/status/StreamsStatusResponse.ts#L26-L28" + "specLocation": "streams/status/StreamsStatusResponse.ts#L26-L31" }, { "kind": "request", @@ -253955,7 +253956,7 @@ "body": { "kind": "no_body" }, - "description": "Get the status of streams\n\nGets the current status of all stream types", + "description": "Get the status of streams.\n\nGet the current status for all types of streams.", "examples": { "GetStreamsStatusRequestExample1": { "method_request": "GET _streams/status",