Skip to content

Commit

Permalink
Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl committed Apr 29, 2022
1 parent 6a532c6 commit 5904095
Show file tree
Hide file tree
Showing 9 changed files with 2,415 additions and 877 deletions.
1,701 changes: 1,215 additions & 486 deletions x-pack/plugins/cases/common/openapi/bundled.json

Large diffs are not rendered by default.

1,263 changes: 942 additions & 321 deletions x-pack/plugins/cases/common/openapi/bundled.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
summary: Create a security case that uses a Jira connector.
value:
{
"description": "James Bond clicked on a highly suspicious email banner advertising cheap holidays for underpaid civil servants.",
"title": "This case will self-destruct in 5 seconds",
"tags": [ "phishing","social engineering"],
"connector": {
"id": "131d4448-abe0-4789-939d-8ef60680b498",
"name": "My connector",
"type": ".jira",
"fields": {
"issueType": "10006",
"priority": "High",
"parent": null
}
},
"settings": {
"syncAlerts": true
},
"owner": "securitySolution"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
summary: The create case API returns a JSON object that includes the user who created the case and the case identifier, version, and creation time.
value:
{
"id": "66b9aa00-94fa-11ea-9f74-e7e108796192",
"version": "WzUzMiwxXQ==",
"comments": [],
"totalComment": 0,
"totalAlerts": 0,
"title": "This case will self-destruct in 5 seconds",
"tags": [
"phishing",
"social engineering",
"bubblegum"
],
"settings": {
"syncAlerts": true
},
"owner": "securitySolution",
"description": "James Bond clicked on a highly suspicious email banner advertising cheap holidays for underpaid civil servants. Operation bubblegum is active. Repeat - operation bubblegum is now active",
"closed_at": null,
"closed_by": null,
"created_at": "2022-05-13T09:16:17.416Z",
"created_by": {
"email": "ahunley@imf.usa.gov",
"full_name": "Alan Hunley",
"username": "ahunley"
},
"status": "open",
"updated_at": null,
"updated_by": null,
"connector": {
"id": "131d4448-abe0-4789-939d-8ef60680b498",
"name": "My connector",
"type": ".jira",
"fields": {
"issueType": "10006",
"parent": null,
"priority": "High"
}
},
"external_service": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
summary: Update the description, tags, and connector of case ID `a18b38a0-71b0-11ea-a0b2-c51ea50a58e2``.
value:
{
"cases": [
{
"id": "a18b38a0-71b0-11ea-a0b2-c51ea50a58e2",
"version": "WzIzLDFd",
"connector": {
"id": "131d4448-abe0-4789-939d-8ef60680b498",
"name": "My connector",
"type": ".jira",
"fields": {
"issueType": "10006",
"priority": null,
"parent": null
}
},
"description": "James Bond clicked on a highly suspicious email banner advertising cheap holidays for underpaid civil servants. Operation bubblegum is active. Repeat - operation bubblegum is now active!",
"tags": [
"phishing",
"social engineering",
"bubblegum"
],
"settings": {
"syncAlerts": true
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
summary: This is an example response when the description, tags, and connector were updated for case ID `a18b38a0-71b0-11ea-a0b2-c51ea50a58e2`.
value:
[
{
"id": "66b9aa00-94fa-11ea-9f74-e7e108796192",
"version": "WzU0OCwxXQ==",
"comments": [],
"totalComment": 0,
"totalAlerts": 0,
"title": "This case will self-destruct in 5 seconds",
"tags": [
"phishing",
"social engineering",
"bubblegum"
],
"settings": {
"syncAlerts": true
},
"owner": "securitySolution",
"description": "James Bond clicked on a highly suspicious email banner advertising cheap holidays for underpaid civil servants. Operation bubblegum is active. Repeat - operation bubblegum is now active!",
"closed_at": null,
"closed_by": null,
"created_at": "2022-05-13T09:16:17.416Z",
"created_by": {
"email": "ahunley@imf.usa.gov",
"full_name": "Alan Hunley",
"username": "ahunley"
},
"status": "open",
"updated_at": "2022-05-13T09:48:33.043Z",
"updated_by": {
"email": "classified@hms.oo.gov.uk",
"full_name": "Classified",
"username": "M"
},
"connector": {
"id": "131d4448-abe0-4789-939d-8ef60680b498",
"name": "My connector",
"type": ".jira",
"fields": {
"issueType": "10006",
"parent": null,
"priority": null,
}
},
"external_service": {
"external_title": "IS-4",
"pushed_by": {
"full_name": "Classified",
"email": "classified@hms.oo.gov.uk",
"username": "M"
},
"external_url": "https://hms.atlassian.net/browse/IS-4",
"pushed_at": "2022-05-13T09:20:40.672Z",
"connector_id": "05da469f-1fde-4058-99a3-91e4807e2de8",
"external_id": "10003",
"connector_name": "Jira"
}
}
]
88 changes: 53 additions & 35 deletions x-pack/plugins/cases/common/openapi/paths/api@cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ post:
- settings
- tags
- title
examples:
createCaseRequest:
$ref: '../components/examples/create_case_request.yaml'
responses:
'200':
description: Indicates a successful call.
Expand All @@ -50,7 +53,10 @@ post:
schema:
type: object
properties:
$ref: '../components/schemas/case_properties.yaml'
$ref: '../components/schemas/case_response_properties.yaml'
examples:
createCaseResponse:
$ref: '../components/examples/create_case_response.yaml'
servers:
- url: https://localhost:5601

Expand Down Expand Up @@ -85,48 +91,60 @@ patch:
schema:
type: object
properties:
connector:
description: An object that contains the connector configuration.
type: object
properties:
$ref: '../components/schemas/connector_properties.yaml'
description:
description: The description for the case.
type: string
id:
description: The identifier for the case.
type: string
settings:
description: An object that contains the case settings.
type: object
properties:
syncAlerts:
description: Turns alert syncing on or off.
type: boolean
status:
$ref: '../components/schemas/status.yaml'
tags:
description: The words and phrases that help categorize cases.
cases:
type: array
items:
type: string
title:
description: A title for the case.
type: string
version:
description: The current version of the case.
type: string
required:
- id
- version
type: object
properties:
connector:
description: An object that contains the connector configuration.
type: object
properties:
$ref: '../components/schemas/connector_properties.yaml'
description:
description: The description for the case.
type: string
id:
description: The identifier for the case.
type: string
settings:
description: An object that contains the case settings.
type: object
properties:
syncAlerts:
description: Turns alert syncing on or off.
type: boolean
status:
$ref: '../components/schemas/status.yaml'
tags:
description: The words and phrases that help categorize cases.
type: array
items:
type: string
title:
description: A title for the case.
type: string
version:
description: The current version of the case.
type: string
required:
- id
- version
examples:
updateCaseRequest:
$ref: '../components/examples/update_case_request.yaml'
responses:
'200':
description: Indicates a successful call.
content:
application/json; charset=utf-8:
schema:
type: string
examples: {}
type: object
properties:
$ref: '../components/schemas/case_response_properties.yaml'
examples:
updateCaseResponse:
$ref: '../components/examples/update_case_response.yaml'
servers:
- url: https://localhost:5601

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ post:
- settings
- tags
- title
examples:
createCaseRequest:
$ref: '../components/examples/create_case_request.yaml'
responses:
'200':
description: Indicates a successful call.
Expand All @@ -51,7 +54,10 @@ post:
schema:
type: object
properties:
$ref: '../components/schemas/case_properties.yaml'
$ref: '../components/schemas/case_response_properties.yaml'
examples:
createCaseResponse:
$ref: '../components/examples/create_case_response.yaml'
servers:
- url: https://localhost:5601

Expand Down Expand Up @@ -88,48 +94,60 @@ patch:
schema:
type: object
properties:
connector:
description: An object that contains the connector configuration.
type: object
properties:
$ref: '../components/schemas/connector_properties.yaml'
description:
description: The description for the case.
type: string
id:
description: The identifier for the case.
type: string
settings:
description: An object that contains the case settings.
type: object
properties:
syncAlerts:
description: Turns alert syncing on or off.
type: boolean
status:
$ref: '../components/schemas/status.yaml'
tags:
description: The words and phrases that help categorize cases.
cases:
type: array
items:
type: string
title:
description: A title for the case.
type: string
version:
description: The current version of the case.
type: string
required:
- id
- version
type: object
properties:
connector:
description: An object that contains the connector configuration.
type: object
properties:
$ref: '../components/schemas/connector_properties.yaml'
description:
description: The description for the case.
type: string
id:
description: The identifier for the case.
type: string
settings:
description: An object that contains the case settings.
type: object
properties:
syncAlerts:
description: Turns alert syncing on or off.
type: boolean
status:
$ref: '../components/schemas/status.yaml'
tags:
description: The words and phrases that help categorize cases.
type: array
items:
type: string
title:
description: A title for the case.
type: string
version:
description: The current version of the case.
type: string
required:
- id
- version
examples:
updateCaseRequest:
$ref: '../components/examples/update_case_request.yaml'
responses:
'200':
description: Indicates a successful call.
content:
application/json; charset=utf-8:
schema:
type: string
examples: {}
type: object
properties:
$ref: '../components/schemas/case_response_properties.yaml'
examples:
updateCaseResponse:
$ref: '../components/examples/update_case_response.yaml'
servers:
- url: https://localhost:5601

Expand Down

0 comments on commit 5904095

Please sign in to comment.