Skip to content

Commit

Permalink
[8.5] [DOCS] Automate docs for create/update/delete case APIs (#142929)…
Browse files Browse the repository at this point in the history
… (#143806)
  • Loading branch information
lcawl authored Oct 21, 2022
1 parent eb2030c commit 4bab938
Show file tree
Hide file tree
Showing 18 changed files with 1,996 additions and 457 deletions.
1,116 changes: 929 additions & 187 deletions x-pack/plugins/cases/docs/openapi/bundled-min.json

Large diffs are not rendered by default.

740 changes: 625 additions & 115 deletions x-pack/plugins/cases/docs/openapi/bundled-min.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
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.
summary: The create case API returns a JSON object that contains details about the case.
value:
{
"id": "66b9aa00-94fa-11ea-9f74-e7e108796192",
"version": "WzUzMiwxXQ==",
"comments": [],
"totalComment": 0,
"totalAlerts": 0,
"title": "Case title 1",
"tags": [ "tag-1" ],
"settings": {
"syncAlerts": true
},
"owner": "cases",
"description": "A case description.",
"duration": null,
"severity": "low",
"closed_at": null,
"closed_by": null,
"created_at": "2022-05-13T09:16:17.416Z",
"created_by": {
"email": null,
"full_name": null,
"username": "elastic"
},
"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
}
comments: []
totalAlerts: 0
id: 66b9aa00-94fa-11ea-9f74-e7e108796192
version: WzUzMiwxXQ==
totalComment: 1
title: Case title 1
tags:
- tag 1
description: A case description.
settings:
syncAlerts: false
owner: cases
duration: null
severity: low
closed_at: null
closed_by: null
created_at: '2022-03-24T00:37:03.906Z'
created_by:
username: elastic
full_name: null
email: null
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
Expand Up @@ -10,8 +10,9 @@ properties:
description: The category of the incident for ServiceNow ITSM and ServiceNow SecOps connectors.
type: string
destIp:
description: A comma-separated list of destination IPs for ServiceNow SecOps connectors.
type: string
description: Indicates whether cases will send a comma-separated list of destination IPs for ServiceNow SecOps connectors.
type: boolean
nullable: true
impact:
description: The effect an incident had on business for ServiceNow ITSM connectors.
type: string
Expand All @@ -22,13 +23,15 @@ properties:
description: The type of incident for IBM Resilient connectors.
type: array
items:
type: number
type: string
malwareHash:
description: A comma-separated list of malware hashes for ServiceNow SecOps connectors.
type: string
description: Indicates whether cases will send a comma-separated list of malware hashes for ServiceNow SecOps connectors.
type: boolean
nullable: true
malwareUrl:
description: A comma-separated list of malware URLs for ServiceNow SecOps connectors.
type: string
description: Indicates whether cases will send a comma-separated list of malware URLs for ServiceNow SecOps connectors.
type: boolean
nullable: true
parent:
description: The key of the parent issue, when the issue type is sub-task for Jira connectors.
type: string
Expand All @@ -40,10 +43,10 @@ properties:
type: string
severityCode:
description: The severity code of the incident for IBM Resilient connectors.
type: number
sourceIp:
description: A comma-separated list of source IPs for ServiceNow SecOps connectors.
type: string
sourceIp:
description: Indicates whether cases will send a comma-separated list of source IPs for ServiceNow SecOps connectors.
type: boolean
subcategory:
description: The subcategory of the incident for ServiceNow ITSM connectors.
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,16 @@ properties:
- $ref: 'user_comment_response_properties.yaml'
connector:
title: Case response properties for connectors
type: object
properties:
fields:
$ref: 'case_response_connector_field_properties.yaml'
id:
description: The identifier for the connector. To create a case without a connector, use `none`.
type: string
example: none
name:
description: The name of the connector. To create a case without a connector, use `none`.
type: string
example: none
type:
$ref: 'connector_types.yaml'
discriminator:
propertyName: type
oneOf:
- $ref: 'connector_properties_none.yaml'
- $ref: 'connector_properties_cases_webhook.yaml'
- $ref: 'connector_properties_jira.yaml'
- $ref: 'connector_properties_resilient.yaml'
- $ref: 'connector_properties_servicenow.yaml'
- $ref: 'connector_properties_servicenow_sir.yaml'
- $ref: 'connector_properties_swimlane.yaml'
created_at:
type: string
format: date-time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ fields:
description: The category of the incident for ServiceNow ITSM and ServiceNow SecOps connectors.
type: string
destIp:
description: A comma-separated list of destination IPs for ServiceNow SecOps connectors.
type: string
description: Indicates whether cases will send a comma-separated list of destination IPs for ServiceNow SecOps connectors.
type: boolean
nullable: true
impact:
description: The effect an incident had on business for ServiceNow ITSM connectors.
type: string
Expand All @@ -22,13 +23,15 @@ fields:
description: The type of incident for IBM Resilient connectors.
type: array
items:
type: number
type: string
malwareHash:
description: A comma-separated list of malware hashes for ServiceNow SecOps connectors.
type: string
description: Indicates whether cases will send a comma-separated list of malware hashes for ServiceNow SecOps connectors.
type: boolean
nullable: true
malwareUrl:
description: A comma-separated list of malware URLs for ServiceNow SecOps connectors.
type: string
description: Indicates whether cases will send a comma-separated list of malware URLs for ServiceNow SecOps connectors.
type: boolean
nullable: true
parent:
description: The key of the parent issue, when the issue type is sub-task for Jira connectors.
type: string
Expand All @@ -40,10 +43,11 @@ fields:
type: string
severityCode:
description: The severity code of the incident for IBM Resilient connectors.
type: number
sourceIp:
description: A comma-separated list of source IPs for ServiceNow SecOps connectors.
type: string
sourceIp:
description: Indicates whether cases will send a comma-separated list of source IPs for ServiceNow SecOps connectors.
type: boolean
nullable: true
subcategory:
description: The subcategory of the incident for ServiceNow ITSM connectors.
type: string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
title: Create or upate case request properties for Cases Webhook connector
required:
- fields
- id
- name
- type
description: Defines properties for connectors when type is `.cases-webhook`.
type: object
properties:
fields:
type: string
nullable: true
example: null
id:
description: The identifier for the connector. To retrieve connector IDs, use the find connectors API.
type: string
name:
description: The name of the connector.
type: string
type:
description: The type of connector.
type: string
example: .cases-webhook
enum:
- .cases-webhook
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
title: Create or update case request properties for a Jira connector
required:
- fields
- id
- name
- type
description: Defines properties for connectors when type is `.jira`.
type: object
properties:
fields:
description: An object containing the connector fields. If you want to omit any individual field, specify null as its value.
type: object
required:
- issueType
- parent
- priority
properties:
issueType:
description: The type of issue.
type: string
nullable: true
parent:
description: The key of the parent issue, when the issue type is sub-task.
type: string
nullable: true
priority:
description: The priority of the issue.
type: string
nullable: true
id:
description: The identifier for the connector. To retrieve connector IDs, use the find connectors API.
type: string
name:
description: The name of the connector.
type: string
type:
description: The type of connector.
type: string
example: .jira
enum:
- .jira
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
title: Create or update case request properties for no connector
required:
- fields
- id
- name
- type
description: Defines properties for connectors when type is `.none`.
type: object
properties:
fields:
description: An object containing the connector fields. To create a case without a connector, specify null. To update a case to remove the connector, specify null.
nullable: true
type: string
example: null
id:
description: The identifier for the connector. To create a case without a connector, use `none`. To update a case to remove the connector, specify `none`.
type: string
example: none
name:
description: The name of the connector. To create a case without a connector, use `none`. To update a case to remove the connector, specify `none`.
type: string
example: none
type:
description: The type of connector. To create a case without a connector, use `.none`. To update a case to remove the connector, specify `.none`.
type: string
example: .none
enum:
- .none
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
title: Create case request properties for a IBM Resilient connector
required:
- fields
- id
- name
- type
description: Defines properties for connectors when type is `.resilient`.
type: object
properties:
fields:
description: An object containing the connector fields. If you want to omit any individual field, specify null as its value.
type: object
nullable: true
required:
- issueTypes
- severityCode
properties:
issueTypes:
description: The type of incident.
type: array
items:
type: string
severityCode:
description: The severity code of the incident.
type: string
id:
description: The identifier for the connector.
type: string
name:
description: The name of the connector.
type: string
type:
description: The type of connector.
type: string
example: .resilient
enum:
- .resilient
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
title: Create case request properties for a ServiceNow ITSM connector
required:
- fields
- id
- name
- type
description: Defines properties for connectors when type is `.servicenow`.
type: object
properties:
fields:
description: An object containing the connector fields. If you want to omit any individual field, specify null as its value.
type: object
required:
- category
- impact
- severity
- subcategory
- urgency
properties:
category:
description: The category of the incident.
type: string
nullable: true
impact:
description: The effect an incident had on business.
type: string
nullable: true
severity:
description: The severity of the incident.
type: string
nullable: true
subcategory:
description: The subcategory of the incident.
type: string
nullable: true
urgency:
description: The extent to which the incident resolution can be delayed.
type: string
nullable: true
id:
description: The identifier for the connector. To retrieve connector IDs, use the find connectors API.
type: string
name:
description: The name of the connector.
type: string
type:
description: The type of connector.
type: string
example: .servicenow
enum:
- .servicenow
Loading

0 comments on commit 4bab938

Please sign in to comment.