Skip to content

Commit

Permalink
[8.11] [OAS] Fix cases API data types for comments (#170698) (#170878)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.11`:
- [[OAS] Fix cases API data types for comments
(#170698)](#170698)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-08T15:12:54Z","message":"[OAS]
Fix cases API data types for comments
(#170698)","sha":"bb15bb14482ad2ebad232a53678f7be64c1eb7eb","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","docs","Feature:Cases","backport:prev-minor","v8.12.0","v8.11.1"],"number":170698,"url":"https://github.com/elastic/kibana/pull/170698","mergeCommit":{"message":"[OAS]
Fix cases API data types for comments
(#170698)","sha":"bb15bb14482ad2ebad232a53678f7be64c1eb7eb"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170698","number":170698,"mergeCommit":{"message":"[OAS]
Fix cases API data types for comments
(#170698)","sha":"bb15bb14482ad2ebad232a53678f7be64c1eb7eb"}},{"branch":"8.11","label":"v8.11.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Lisa Cawley <[email protected]>
  • Loading branch information
kibanamachine and lcawl authored Nov 8, 2023
1 parent 761fd71 commit 208e02f
Show file tree
Hide file tree
Showing 7 changed files with 328 additions and 21 deletions.
126 changes: 119 additions & 7 deletions x-pack/plugins/cases/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -1206,8 +1206,11 @@
"$ref": "#/components/schemas/case_response_properties"
},
"examples": {
"getCaseResponse": {
"getDefaultCaseResponse": {
"$ref": "#/components/examples/get_case_response"
},
"getDefaultObservabilityCaseReponse": {
"$ref": "#/components/examples/get_case_observability_response"
}
}
}
Expand Down Expand Up @@ -3078,6 +3081,9 @@
"examples": {
"getCaseResponse": {
"$ref": "#/components/examples/get_case_response"
},
"getObservabilityCaseReponse": {
"$ref": "#/components/examples/get_case_observability_response"
}
}
}
Expand Down Expand Up @@ -4614,13 +4620,16 @@
],
"properties": {
"alertId": {
"type": "string",
"example": "6b24c4dc44bc720cfc92797f3d61fff952f2b2627db1fb4f8cc49f4530c4ff42"
"type": "array",
"items": {
"type": "string",
"example": "a6e12ac4-7bce-457b-84f6-d7ce8deb8446"
}
},
"created_at": {
"type": "string",
"format": "date-time",
"example": "2022-03-24T02:31:03.210Z"
"example": "2023-11-06T19:29:38.424Z"
},
"created_by": {
"type": "object",
Expand Down Expand Up @@ -4656,8 +4665,11 @@
"example": "73362370-ab1a-11ec-985f-97e55adae8b9"
},
"index": {
"type": "string",
"example": ".internal.alerts-security.alerts-default-000001"
"type": "array",
"items": {
"type": "string",
"example": ".internal.alerts-security.alerts-default-000001"
}
},
"owner": {
"$ref": "#/components/schemas/owners"
Expand Down Expand Up @@ -4723,10 +4735,11 @@
"updated_at": {
"type": "string",
"format": "date-time",
"example": null
"nullable": true
},
"updated_by": {
"type": "object",
"nullable": true,
"required": [
"email",
"full_name",
Expand Down Expand Up @@ -6971,6 +6984,7 @@
"syncAlerts": true
},
"owner": "cases",
"category": null,
"customFields": [
{
"type": "text",
Expand Down Expand Up @@ -7017,6 +7031,104 @@
"external_service": null
}
},
"get_case_observability_response": {
"summary": "Retrieves information about an Observability case including its alerts and comments.",
"value": {
"description": "An Observability case description.",
"owner": "observability",
"settings": {
"syncAlerts": false
},
"tags": [
"observability",
"tag 1"
],
"title": "Observability case title 1",
"category": null,
"customFields": [],
"assignees": [
{
"uid": "u_0wpfV1MqYDaXzLtRVY-gLMrddKDEmfz51Fszhj7hWC8_0"
}
],
"connector": {
"id": "none",
"type": ".none",
"fields": null,
"name": "none"
},
"severity": "low",
"status": "in-progress",
"duration": null,
"closed_at": null,
"closed_by": null,
"created_at": "2023-11-06T19:29:04.086Z",
"created_by": {
"username": "elastic",
"full_name": null,
"email": null
},
"updated_at": "2023-11-06T19:47:55.662Z",
"updated_by": {
"username": "elastic",
"full_name": null,
"email": null,
"profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
},
"external_service": null,
"id": "c3ff7550-def1-4e90-b6bc-c9969a4a09b1",
"version": "WzI0NywyXQ==",
"totalComment": 1,
"totalAlerts": 1,
"comments": [
{
"alertId": [
"a6e12ac4-7bce-457b-84f6-d7ce8deb8446"
],
"index": [
".internal.alerts-observability.logs.alerts-default-000001"
],
"type": "alert",
"rule": {
"id": "03e4eb87-62ca-4e5d-9570-3d7625e9669d",
"name": "Observability rule"
},
"owner": "observability",
"created_at": "2023-11-06T19:29:38.424Z",
"created_by": {
"email": null,
"full_name": null,
"username": "elastic",
"profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
},
"pushed_at": null,
"pushed_by": null,
"updated_at": null,
"updated_by": null,
"id": "59d438d0-79a9-4864-8d4b-e63adacebf6e",
"version": "WzY3LDJd"
},
{
"comment": "The first comment.",
"type": "user",
"owner": "observability",
"created_at": "2023-11-06T19:29:57.812Z",
"created_by": {
"email": null,
"full_name": null,
"username": "elastic",
"profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
},
"pushed_at": null,
"pushed_by": null,
"updated_at": null,
"updated_by": null,
"id": "d99342d3-3aa3-4b80-90ec-a702607604f5",
"version": "WzcyLDJd"
}
]
}
},
"get_case_alerts_response": {
"summary": "Retrieves all alerts attached to a case",
"value": [
Expand Down
102 changes: 95 additions & 7 deletions x-pack/plugins/cases/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,10 @@ paths:
schema:
$ref: '#/components/schemas/case_response_properties'
examples:
getCaseResponse:
getDefaultCaseResponse:
$ref: '#/components/examples/get_case_response'
getDefaultObservabilityCaseReponse:
$ref: '#/components/examples/get_case_observability_response'
'401':
description: Authorization information is missing or invalid.
content:
Expand Down Expand Up @@ -2017,6 +2019,8 @@ paths:
examples:
getCaseResponse:
$ref: '#/components/examples/get_case_response'
getObservabilityCaseReponse:
$ref: '#/components/examples/get_case_observability_response'
'401':
description: Authorization information is missing or invalid.
content:
Expand Down Expand Up @@ -3068,12 +3072,14 @@ components:
- type
properties:
alertId:
type: string
example: 6b24c4dc44bc720cfc92797f3d61fff952f2b2627db1fb4f8cc49f4530c4ff42
type: array
items:
type: string
example: a6e12ac4-7bce-457b-84f6-d7ce8deb8446
created_at:
type: string
format: date-time
example: '2022-03-24T02:31:03.210Z'
example: '2023-11-06T19:29:38.424Z'
created_by:
type: object
required:
Expand All @@ -3100,8 +3106,10 @@ components:
type: string
example: 73362370-ab1a-11ec-985f-97e55adae8b9
index:
type: string
example: .internal.alerts-security.alerts-default-000001
type: array
items:
type: string
example: .internal.alerts-security.alerts-default-000001
owner:
$ref: '#/components/schemas/owners'
pushed_at:
Expand Down Expand Up @@ -3151,9 +3159,10 @@ components:
updated_at:
type: string
format: date-time
example: null
nullable: true
updated_by:
type: object
nullable: true
required:
- email
- full_name
Expand Down Expand Up @@ -4769,6 +4778,7 @@ components:
settings:
syncAlerts: true
owner: cases
category: null
customFields:
- type: text
key: d312efda-ec2b-42ec-9e2c-84981795c581
Expand Down Expand Up @@ -4802,6 +4812,84 @@ components:
type: .none
fields: null
external_service: null
get_case_observability_response:
summary: Retrieves information about an Observability case including its alerts and comments.
value:
description: An Observability case description.
owner: observability
settings:
syncAlerts: false
tags:
- observability
- tag 1
title: Observability case title 1
category: null
customFields: []
assignees:
- uid: u_0wpfV1MqYDaXzLtRVY-gLMrddKDEmfz51Fszhj7hWC8_0
connector:
id: none
type: .none
fields: null
name: none
severity: low
status: in-progress
duration: null
closed_at: null
closed_by: null
created_at: '2023-11-06T19:29:04.086Z'
created_by:
username: elastic
full_name: null
email: null
updated_at: '2023-11-06T19:47:55.662Z'
updated_by:
username: elastic
full_name: null
email: null
profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0
external_service: null
id: c3ff7550-def1-4e90-b6bc-c9969a4a09b1
version: WzI0NywyXQ==
totalComment: 1
totalAlerts: 1
comments:
- alertId:
- a6e12ac4-7bce-457b-84f6-d7ce8deb8446
index:
- .internal.alerts-observability.logs.alerts-default-000001
type: alert
rule:
id: 03e4eb87-62ca-4e5d-9570-3d7625e9669d
name: Observability rule
owner: observability
created_at: '2023-11-06T19:29:38.424Z'
created_by:
email: null
full_name: null
username: elastic
profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0
pushed_at: null
pushed_by: null
updated_at: null
updated_by: null
id: 59d438d0-79a9-4864-8d4b-e63adacebf6e
version: WzY3LDJd
- comment: The first comment.
type: user
owner: observability
created_at: '2023-11-06T19:29:57.812Z'
created_by:
email: null
full_name: null
username: elastic
profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0
pushed_at: null
pushed_by: null
updated_at: null
updated_by: null
id: d99342d3-3aa3-4b80-90ec-a702607604f5
version: WzcyLDJd
get_case_alerts_response:
summary: Retrieves all alerts attached to a case
value:
Expand Down
Loading

0 comments on commit 208e02f

Please sign in to comment.