-
Notifications
You must be signed in to change notification settings - Fork 109
Add spec and docs for new logs streams endpoints #5258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lukewhiting
wants to merge
8
commits into
main
Choose a base branch
from
streams-logs-endpoints
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
266f534
Add spec and docs for new logs streams endpoints
lukewhiting e72eaab
Add @codegen name to Acked responses
lukewhiting cfc80e2
Linting fix
lukewhiting 9b2fab6
Update specification/streams/status/examples/200_response/GetStreamsS…
lukewhiting bf05570
Correct feature flag
lukewhiting 9e8a27b
Add doc-ids
lukewhiting 97a6514
Fix doc-ids
lukewhiting 2c2f8a6
Update specification/_doc_ids/table.csv
lukewhiting File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
specification/streams/logs_disable/StreamsLogsDisableRequest.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* 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 | ||
*/ | ||
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. | ||
*/ | ||
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. | ||
*/ | ||
timeout?: Duration | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
specification/streams/logs_disable/StreamsLogsDisableResponse.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* 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 { | ||
body: AcknowledgedResponseBase | ||
} |
6 changes: 6 additions & 0 deletions
6
...on/streams/logs_disable/examples/200_response/PostStreamsLogsDisableResponseExample1.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
summary: Disable logs streams | ||
description: > | ||
A successful response from `POST _streams/logs/_disable` endpoint | ||
# type: response | ||
value: | ||
acknowledged: true |
3 changes: 3 additions & 0 deletions
3
specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
summary: "Disable the logs streams on this cluster" | ||
method_request: POST _streams/logs/_disable | ||
# type: request |
55 changes: 55 additions & 0 deletions
55
specification/streams/logs_enable/StreamsLogsEnableRequest.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
|
||
/** | ||
* 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 | ||
*/ | ||
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. | ||
*/ | ||
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. | ||
*/ | ||
timeout?: Duration | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
specification/streams/logs_enable/StreamsLogsEnableResponse.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* 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 { | ||
body: AcknowledgedResponseBase | ||
} |
6 changes: 6 additions & 0 deletions
6
...tion/streams/logs_enable/examples/200_response/PostStreamsLogsEnableResponseExample1.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
summary: Enable logs streams | ||
description: > | ||
A successful response from `POST _streams/logs/_enable` endpoint | ||
# type: response | ||
value: | ||
acknowledged: true |
19 changes: 19 additions & 0 deletions
19
...tion/streams/logs_enable/examples/409_response/PostStreamsLogsEnableResponseExample2.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
3 changes: 3 additions & 0 deletions
3
specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
summary: "Enable the logs streams on this cluster" | ||
method_request: POST _streams/logs/_enable | ||
# type: request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* 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 | ||
*/ | ||
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 | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
10 changes: 10 additions & 0 deletions
10
specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
summary: Get Streams Status | ||
description: > | ||
A successful response from `GET _streams/status` that outlines the current state of all wired streams in the cluster, | ||
lukewhiting marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# type: response | ||
value: |- | ||
{ | ||
"logs": { | ||
"enabled": true | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
summary: "Get the current status of streams" | ||
method_request: GET _streams/status | ||
# type: request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.