-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds openAPI spec for get alerts endpoint (#137332)
(cherry picked from commit e19714a)
- Loading branch information
Showing
8 changed files
with
292 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
10 changes: 10 additions & 0 deletions
10
x-pack/plugins/cases/docs/openapi/components/examples/get_case_alerts_response.yaml
This file contains 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: Retrieves all alerts attached to a case | ||
value: | ||
[ | ||
{ | ||
"id": "f6a7d0c3-d52d-432c-b2e6-447cd7fce04d", | ||
"index": ".alerts-observability.logs.alerts-default", | ||
"attached_at": "2022-07-25T20:09:40.963Z" | ||
} | ||
] | ||
|
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/cases/docs/openapi/components/schemas/alert_response_properties.yaml
This file contains 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,11 @@ | ||
type: object | ||
properties: | ||
attached_at: | ||
type: string | ||
format: date-time | ||
id: | ||
description: The alert identifier. | ||
type: string | ||
index: | ||
description: The alert index. | ||
type: string |
This file contains 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 |
---|---|---|
|
@@ -37,8 +37,8 @@ paths: | |
$ref: 'paths/api@[email protected]' | ||
'/api/cases/{caseId}': | ||
$ref: 'paths/api@cases@{caseid}.yaml' | ||
# '/api/cases/{caseId}/alerts': | ||
# $ref: 'paths/api@cases@{caseid}@alerts.yaml' | ||
'/api/cases/{caseId}/alerts': | ||
$ref: 'paths/api@cases@{caseid}@alerts.yaml' | ||
'/api/cases/{caseId}/comments': | ||
$ref: 'paths/api@cases@{caseid}@comments.yaml' | ||
'/api/cases/{caseId}/comments/{commentId}': | ||
|
@@ -68,8 +68,8 @@ paths: | |
$ref: 'paths/s@{spaceid}@api@[email protected]' | ||
'/s/{spaceId}/api/cases/{caseId}': | ||
$ref: 'paths/s@{spaceid}@api@cases@{caseid}.yaml' | ||
# '/s/{spaceId}/api/cases/{caseId}/alerts': | ||
# $ref: 'paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml' | ||
'/s/{spaceId}/api/cases/{caseId}/alerts': | ||
$ref: 'paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml' | ||
'/s/{spaceId}/api/cases/{caseId}/comments': | ||
$ref: 'paths/s@{spaceid}@api@cases@{caseid}@comments.yaml' | ||
'/s/{spaceId}/api/cases/{caseId}/comments/{commentId}': | ||
|
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@alerts.yaml
This file contains 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,29 @@ | ||
get: | ||
summary: Gets all alerts attached to a case in the default space. | ||
description: > | ||
You must have `read` privileges for the **Cases** feature in the | ||
**Management**, **Observability**, or **Security** section of the Kibana | ||
feature privileges, depending on the owner of the cases you're seeking. | ||
operationId: getCaseAlertsDefaultSpace | ||
tags: | ||
- cases | ||
- kibana | ||
x-technical-preview: true | ||
parameters: | ||
- $ref: ../components/parameters/case_id.yaml | ||
responses: | ||
'200': | ||
description: Indicates a successful call. | ||
content: | ||
application/json; charset=utf-8: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '../components/schemas/alert_response_properties.yaml' | ||
examples: | ||
createCaseCommentResponse: | ||
$ref: '../components/examples/get_case_alerts_response.yaml' | ||
servers: | ||
- url: https://localhost:5601 | ||
servers: | ||
- url: https://localhost:5601 |
30 changes: 30 additions & 0 deletions
30
x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml
This file contains 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,30 @@ | ||
get: | ||
summary: Gets all alerts attached to a case. | ||
description: > | ||
You must have `read` privileges for the **Cases** feature in the | ||
**Management**, **Observability**, or **Security** section of the Kibana | ||
feature privileges, depending on the owner of the cases you're seeking. | ||
x-technical-preview: true | ||
operationId: getCaseAlerts | ||
tags: | ||
- cases | ||
- kibana | ||
parameters: | ||
- $ref: ../components/parameters/case_id.yaml | ||
- $ref: '../components/parameters/space_id.yaml' | ||
responses: | ||
'200': | ||
description: Indicates a successful call. | ||
content: | ||
application/json; charset=utf-8: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '../components/schemas/alert_response_properties.yaml' | ||
examples: | ||
createCaseCommentResponse: | ||
$ref: '../components/examples/get_case_alerts_response.yaml' | ||
servers: | ||
- url: https://localhost:5601 | ||
servers: | ||
- url: https://localhost:5601 |