Skip to content

Commit 2a5e9e1

Browse files
lukewhitingCopilotpquentin
authored andcommitted
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 <[email protected]> * Correct feature flag * Add doc-ids * Fix doc-ids * Update specification/_doc_ids/table.csv Co-authored-by: Quentin Pradet <[email protected]> * Update specification/_doc_ids/table.csv Co-authored-by: Quentin Pradet <[email protected]> * Add default timeouts --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Quentin Pradet <[email protected]> (cherry picked from commit 995d686)
1 parent 3d439b1 commit 2a5e9e1

15 files changed

+292
-0
lines changed

specification/_doc_ids/table.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,9 @@ stop-dfanalytics,https://www.elastic.co/docs/api/doc/elasticsearch/operation/ope
888888
stop-trained-model-deployment,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-trained-model-deployment,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/stop-trained-model-deployment.html,
889889
stop-transform,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/stop-transform.html,
890890
stored-fields,https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrieve-selected-fields#stored-fields,,
891+
streams-status,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,,
892+
streams-logs-enable,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,,
893+
streams-logs-disable,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,,
891894
synonym-api-examples,https://www.elastic.co/docs/solutions/search/full-text/create-update-synonyms-api-example,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-synonyms-set.html,
892895
synonym-rule-create,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-put-synonym-rule,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-synonym-rule.html,
893896
synonym-rule-delete,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-delete-synonym-rule,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-synonym-rule.html,
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { RequestBase } from '@_types/Base'
21+
import { Duration } from '@_types/Time'
22+
23+
/**
24+
* Disable logs stream
25+
*
26+
* This disables the logs stream feature for this cluster.
27+
* @rest_spec_name streams.logs_disable
28+
* @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream
29+
* @cluster_privileges manage
30+
* @doc_id streams-logs-disable
31+
*/
32+
export interface Request extends RequestBase {
33+
urls: [
34+
{
35+
path: '/_streams/logs/_disable'
36+
methods: ['POST']
37+
}
38+
]
39+
query_parameters: {
40+
/**
41+
* The period to wait for a connection to the master node.
42+
* If no response is received before the timeout expires, the request fails and returns an error.
43+
*
44+
* @server_default 30s
45+
*/
46+
master_timeout?: Duration
47+
/**
48+
* The period to wait for a response.
49+
* If no response is received before the timeout expires, the request fails and returns an error.
50+
*
51+
* @server_default 30s
52+
*/
53+
timeout?: Duration
54+
}
55+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { AcknowledgedResponseBase } from '@_types/Base'
21+
22+
export class Response {
23+
/** @codegen_name result */
24+
body: AcknowledgedResponseBase
25+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
summary: Disable logs streams
2+
description: >
3+
A successful response from `POST _streams/logs/_disable` endpoint
4+
# type: response
5+
value:
6+
acknowledged: true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
summary: 'Disable the logs streams on this cluster'
2+
method_request: POST _streams/logs/_disable
3+
# type: request
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { RequestBase } from '@_types/Base'
21+
import { Duration } from '@_types/Time'
22+
23+
/**
24+
* Enable logs stream
25+
*
26+
* This enables the logs stream feature for this cluster.
27+
*
28+
* Note: To protect existing data, this feature can only be enabled on a cluster if
29+
* it does not have existing indices or data streams matching the pattern `logs|logs.*`.
30+
* If this is the case, a `409 - Conflict` response and error will be returned.
31+
* @rest_spec_name streams.logs_enable
32+
* @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream
33+
* @cluster_privileges manage
34+
* @doc_id streams-logs-enable
35+
*/
36+
export interface Request extends RequestBase {
37+
urls: [
38+
{
39+
path: '/_streams/logs/_enable'
40+
methods: ['POST']
41+
}
42+
]
43+
query_parameters: {
44+
/**
45+
* The period to wait for a connection to the master node.
46+
* If no response is received before the timeout expires, the request fails and returns an error.
47+
*
48+
* @server_default 30s
49+
*/
50+
master_timeout?: Duration
51+
/**
52+
* The period to wait for a response.
53+
* If no response is received before the timeout expires, the request fails and returns an error.
54+
*
55+
* @server_default 30s
56+
*/
57+
timeout?: Duration
58+
}
59+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { AcknowledgedResponseBase } from '@_types/Base'
21+
22+
export class Response {
23+
/** @codegen_name result */
24+
body: AcknowledgedResponseBase
25+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
summary: Enable logs streams
2+
description: >
3+
A successful response from `POST _streams/logs/_enable` endpoint
4+
# type: response
5+
value:
6+
acknowledged: true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
summary: Enable logs streams - Failure due to conflicting index
2+
description: >
3+
An error response from the `POST _streams/logs/_enable` endpoint caused by attempting to enable logs streams
4+
when an existing index with the name `logs` already exists
5+
# type: response
6+
value: |-
7+
{
8+
"error": {
9+
"root_cause": [
10+
{
11+
"type": "status_exception",
12+
"reason": "Cannot enable logs streams: indices named 'logs' or starting with 'logs.' already exist."
13+
}
14+
],
15+
"type": "status_exception",
16+
"reason": "Cannot enable logs streams: indices named 'logs' or starting with 'logs.' already exist."
17+
},
18+
"status": 409
19+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
summary: 'Enable the logs streams on this cluster'
2+
method_request: POST _streams/logs/_enable
3+
# type: request

0 commit comments

Comments
 (0)