From 37f7e0702b2ceb4f3da5f7e169e9a22bbc72a967 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 6 Apr 2022 19:42:53 -0700 Subject: [PATCH 1/9] Add openAPI specifications for find case --- x-pack/plugins/cases/common/openapi/README.md | 29 ++ .../plugins/cases/common/openapi/bundled.json | 391 ++++++++++++++++++ .../plugins/cases/common/openapi/bundled.yaml | 238 +++++++++++ .../cases/common/openapi/components/README.md | 5 + .../openapi/components/headers/kbn_xsrf.yaml | 5 + .../components/parameters/case_id.yaml | 6 + .../parameters/default_search_operator.yaml | 7 + .../openapi/components/parameters/fields.yaml | 7 + .../openapi/components/parameters/from.yaml | 6 + .../openapi/components/parameters/owner.yaml | 10 + .../openapi/components/parameters/page.yaml | 7 + .../components/parameters/per_page.yaml | 7 + .../components/parameters/reporters.yaml | 10 + .../openapi/components/parameters/search.yaml | 6 + .../components/parameters/search_fields.yaml | 9 + .../components/parameters/sort_field.yaml | 10 + .../components/parameters/sort_order.yaml | 10 + .../components/parameters/space_id.yaml | 6 + .../openapi/components/parameters/status.yaml | 10 + .../openapi/components/parameters/tags.yaml | 10 + .../openapi/components/parameters/to.yaml | 6 + .../openapi/components/schemas/owners.yaml | 6 + .../cases/common/openapi/entrypoint.yaml | 61 +++ .../cases/common/openapi/paths/README.md | 4 + .../common/openapi/paths/api@cases@_find.yaml | 29 ++ .../paths/s@{spaceid}@api@cases@_find.yaml | 30 ++ .../common/openapi/validate_docs.test.ts | 27 ++ 27 files changed, 952 insertions(+) create mode 100644 x-pack/plugins/cases/common/openapi/README.md create mode 100644 x-pack/plugins/cases/common/openapi/bundled.json create mode 100644 x-pack/plugins/cases/common/openapi/bundled.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/README.md create mode 100644 x-pack/plugins/cases/common/openapi/components/headers/kbn_xsrf.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/case_id.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/default_search_operator.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/fields.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/from.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/owner.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/page.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/per_page.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/reporters.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/search.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/search_fields.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/sort_field.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/sort_order.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/space_id.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/status.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/tags.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/to.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/schemas/owners.yaml create mode 100644 x-pack/plugins/cases/common/openapi/entrypoint.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/README.md create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml create mode 100644 x-pack/plugins/cases/common/openapi/validate_docs.test.ts diff --git a/x-pack/plugins/cases/common/openapi/README.md b/x-pack/plugins/cases/common/openapi/README.md new file mode 100644 index 0000000000000..67a3c92d532bb --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/README.md @@ -0,0 +1,29 @@ +# OpenAPI (Experimental) + +The current self-contained spec file is [as JSON](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/cases/common/openapi/bundled.json) or [as YAML](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/cases/common/openapi/bundled.yaml) and can be used for online tools like those found at https://openapi.tools/. +This spec is experimental and may be incomplete or change later. + +A guide about the openApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/). + +## The `openapi` folder + +* `entrypoint.yaml` is the overview file which pulls together all the paths and components. +* [Paths](paths/README.md): this defines each endpoint. A path can have one operation per http method. +* [Components](components/README.md): Reusable components + +## Tools + +It is possible to validate the docs before bundling them with the following +command in the `x-pack/plugins/cases/common/openapi/` folder: + + ``` + npx swagger-cli validate x-pack/plugins/cases/common/openapi/entrypoint.yaml + ``` + +Then you can generate the `bundled` files by running the following commands: + + ``` + npx @redocly/openapi-cli bundle --ext yaml --output bundled.yaml entrypoint.yaml + npx @redocly/openapi-cli bundle --ext json --output bundled.json entrypoint.yaml + ``` + diff --git a/x-pack/plugins/cases/common/openapi/bundled.json b/x-pack/plugins/cases/common/openapi/bundled.json new file mode 100644 index 0000000000000..51165f14e93af --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/bundled.json @@ -0,0 +1,391 @@ +{ + "openapi": "3.0.1", + "tags": [], + "info": { + "title": "Cases", + "description": "OpenAPI schema for Cases endpoints", + "version": "0.1", + "contact": { + "name": "Cases Team" + }, + "license": { + "name": "Elastic License 2.0", + "url": "https://www.elastic.co/licensing/elastic-license" + } + }, + "servers": [ + { + "url": "http://localhost:5601", + "description": "local" + } + ], + "paths": { + "/api/cases/_find": { + "get": { + "description": "Retrieves a paginated subset of cases.", + "parameters": [ + { + "$ref": "#/components/parameters/default_search_operator" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/from" + }, + { + "$ref": "#/components/parameters/owner" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/reporters" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/search_fields" + }, + { + "$ref": "#/components/parameters/sort_field" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/tags" + }, + { + "$ref": "#/components/parameters/to" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/_find": { + "get": { + "description": "Retrieves a paginated subset of cases.", + "parameters": [ + { + "$ref": "#/components/parameters/space_id" + }, + { + "$ref": "#/components/parameters/default_search_operator" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/from" + }, + { + "$ref": "#/components/parameters/owner" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/reporters" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/search_fields" + }, + { + "$ref": "#/components/parameters/sort_field" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/tags" + }, + { + "$ref": "#/components/parameters/to" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + } + }, + "components": { + "securitySchemes": { + "basicAuth": { + "type": "http", + "scheme": "basics" + } + }, + "parameters": { + "default_search_operator": { + "in": "query", + "name": "defaultSearchOperator", + "description": "The default operator to use for the simple_query_string.", + "schema": { + "type": "string", + "default": "OR" + }, + "example": "OR" + }, + "fields": { + "in": "query", + "name": "fields", + "description": "The fields in the entity to return in the response.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "from": { + "in": "query", + "name": "from", + "description": "Returns only cases that were created after a specific date. The date must be specified as a KQL data range or date match expression.", + "schema": { + "type": "string" + }, + "example": "now-1d" + }, + "owner": { + "in": "query", + "name": "owner", + "description": "A filter to limit the retrieved cases to a specific set of applications. Valid values are:cases, observability, and securitySolution. If this parameter is omitted, the response contains all cases that the user has access to read.", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/owners" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/owners" + } + } + ] + }, + "example": "cases" + }, + "page": { + "in": "query", + "name": "page", + "description": "The page number to return.", + "schema": { + "type": "integer", + "default": 1 + }, + "example": 1 + }, + "per_page": { + "in": "query", + "name": "perPage", + "description": "The number of rules to return per page.", + "schema": { + "type": "integer", + "default": 20 + }, + "example": 20 + }, + "reporters": { + "in": "query", + "name": "reporters", + "description": "Filters the returned cases by the user name of the reporter.", + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "example": "elastic" + }, + "search": { + "in": "query", + "name": "search", + "description": "An Elasticsearch simple_query_string query that filters the objects in the response.", + "schema": { + "type": "string" + }, + "example": "%2A" + }, + "search_fields": { + "in": "query", + "name": "searchFields", + "description": "The fields to perform the simple_query_string parsed query against.", + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "sort_field": { + "in": "query", + "name": "sortField", + "description": "Determines which field is used to sort the results.", + "schema": { + "type": "string", + "enum": [ + "createdAt", + "updatedAt" + ], + "default": "createdAt" + }, + "example": "updatedAt" + }, + "sort_order": { + "in": "query", + "name": "sortOrder", + "description": "Determines the sort order.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "desc" + }, + "example": "asc" + }, + "status": { + "in": "query", + "name": "status", + "description": "Filters the returned cases by state.", + "schema": { + "type": "string", + "enum": [ + "closed", + "in-progress", + "open" + ] + }, + "example": "open" + }, + "tags": { + "in": "query", + "name": "tags", + "description": "Filters the returned cases by tags.", + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "example": "phishing" + }, + "to": { + "in": "query", + "name": "to", + "description": "Returns only cases that were created before a specific date. The date must be specified as a KQL data range or date match expression.", + "schema": { + "type": "string" + }, + "example": "now%2B1d" + }, + "space_id": { + "in": "path", + "name": "spaceId", + "description": "An identifier for the space.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "schemas": { + "owners": { + "type": "string", + "title": "Owner apps", + "enum": [ + "cases", + "observability", + "securitySolution" + ] + } + } + }, + "security": [ + { + "basicAuth": [] + } + ] +} \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/bundled.yaml b/x-pack/plugins/cases/common/openapi/bundled.yaml new file mode 100644 index 0000000000000..6b12e1ee4811b --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/bundled.yaml @@ -0,0 +1,238 @@ +openapi: 3.0.1 +tags: [] +info: + title: Cases + description: OpenAPI schema for Cases endpoints + version: '0.1' + contact: + name: Cases Team + license: + name: Elastic License 2.0 + url: https://www.elastic.co/licensing/elastic-license +servers: + - url: http://localhost:5601 + description: local +paths: + /api/cases/_find: + get: + description: Retrieves a paginated subset of cases. + parameters: + - $ref: '#/components/parameters/default_search_operator' + - $ref: '#/components/parameters/fields' + - $ref: '#/components/parameters/from' + - $ref: '#/components/parameters/owner' + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/per_page' + - $ref: '#/components/parameters/reporters' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/search_fields' + - $ref: '#/components/parameters/sort_field' + - $ref: '#/components/parameters/sort_order' + - $ref: '#/components/parameters/status' + - $ref: '#/components/parameters/tags' + - $ref: '#/components/parameters/to' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases/_find: + get: + description: Retrieves a paginated subset of cases. + parameters: + - $ref: '#/components/parameters/space_id' + - $ref: '#/components/parameters/default_search_operator' + - $ref: '#/components/parameters/fields' + - $ref: '#/components/parameters/from' + - $ref: '#/components/parameters/owner' + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/per_page' + - $ref: '#/components/parameters/reporters' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/search_fields' + - $ref: '#/components/parameters/sort_field' + - $ref: '#/components/parameters/sort_order' + - $ref: '#/components/parameters/status' + - $ref: '#/components/parameters/tags' + - $ref: '#/components/parameters/to' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 +components: + securitySchemes: + basicAuth: + type: http + scheme: basics + parameters: + default_search_operator: + in: query + name: defaultSearchOperator + description: The default operator to use for the simple_query_string. + schema: + type: string + default: OR + example: OR + fields: + in: query + name: fields + description: The fields in the entity to return in the response. + schema: + type: array + items: + type: string + from: + in: query + name: from + description: >- + Returns only cases that were created after a specific date. The date + must be specified as a KQL data range or date match expression. + schema: + type: string + example: now-1d + owner: + in: query + name: owner + description: >- + A filter to limit the retrieved cases to a specific set of applications. + Valid values are:cases, observability, and securitySolution. If this + parameter is omitted, the response contains all cases that the user has + access to read. + schema: + oneOf: + - $ref: '#/components/schemas/owners' + - type: array + items: + $ref: '#/components/schemas/owners' + example: cases + page: + in: query + name: page + description: The page number to return. + schema: + type: integer + default: 1 + example: 1 + per_page: + in: query + name: perPage + description: The number of rules to return per page. + schema: + type: integer + default: 20 + example: 20 + reporters: + in: query + name: reporters + description: Filters the returned cases by the user name of the reporter. + schema: + oneOf: + - type: string + - type: array + items: + type: string + example: elastic + search: + in: query + name: search + description: >- + An Elasticsearch simple_query_string query that filters the objects in + the response. + schema: + type: string + example: '%2A' + search_fields: + in: query + name: searchFields + description: The fields to perform the simple_query_string parsed query against. + schema: + oneOf: + - type: string + - type: array + items: + type: string + sort_field: + in: query + name: sortField + description: Determines which field is used to sort the results. + schema: + type: string + enum: + - createdAt + - updatedAt + default: createdAt + example: updatedAt + sort_order: + in: query + name: sortOrder + description: Determines the sort order. + schema: + type: string + enum: + - asc + - desc + default: desc + example: asc + status: + in: query + name: status + description: Filters the returned cases by state. + schema: + type: string + enum: + - closed + - in-progress + - open + example: open + tags: + in: query + name: tags + description: Filters the returned cases by tags. + schema: + oneOf: + - type: string + - type: array + items: + type: string + example: phishing + to: + in: query + name: to + description: >- + Returns only cases that were created before a specific date. The date + must be specified as a KQL data range or date match expression. + schema: + type: string + example: now%2B1d + space_id: + in: path + name: spaceId + description: An identifier for the space. + required: true + schema: + type: string + schemas: + owners: + type: string + title: Owner apps + enum: + - cases + - observability + - securitySolution +security: + - basicAuth: [] diff --git a/x-pack/plugins/cases/common/openapi/components/README.md b/x-pack/plugins/cases/common/openapi/components/README.md new file mode 100644 index 0000000000000..a0f4490e52ea1 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/README.md @@ -0,0 +1,5 @@ +Reusable components +=========== + + - `headers` - reusable [Header Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#headerObject) + - `parameters` - reusable [Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject) diff --git a/x-pack/plugins/cases/common/openapi/components/headers/kbn_xsrf.yaml b/x-pack/plugins/cases/common/openapi/components/headers/kbn_xsrf.yaml new file mode 100644 index 0000000000000..3d8dfae634e68 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/headers/kbn_xsrf.yaml @@ -0,0 +1,5 @@ +schema: + type: string +in: header +name: kbn-xsrf +required: true diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/case_id.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/case_id.yaml new file mode 100644 index 0000000000000..53ce5a93f7122 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/case_id.yaml @@ -0,0 +1,6 @@ +in: path +name: caseId +description: An identifier for the case. +required: true +schema: + type: string \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/default_search_operator.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/default_search_operator.yaml new file mode 100644 index 0000000000000..22c957e93bb54 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/default_search_operator.yaml @@ -0,0 +1,7 @@ +in: query +name: defaultSearchOperator +description: The default operator to use for the simple_query_string. +schema: + type: string + default: OR +example: OR \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/fields.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/fields.yaml new file mode 100644 index 0000000000000..65269955f8c76 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/fields.yaml @@ -0,0 +1,7 @@ +in: query +name: fields +description: The fields in the entity to return in the response. +schema: + type: array + items: + type: string \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/from.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/from.yaml new file mode 100644 index 0000000000000..1c662dfb20c9d --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/from.yaml @@ -0,0 +1,6 @@ +in: query +name: from +description: Returns only cases that were created after a specific date. The date must be specified as a KQL data range or date match expression. +schema: + type: string +example: now-1d diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/owner.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/owner.yaml new file mode 100644 index 0000000000000..ac490e67e37e0 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/owner.yaml @@ -0,0 +1,10 @@ +in: query +name: owner +description: A filter to limit the retrieved cases to a specific set of applications. Valid values are:cases, observability, and securitySolution. If this parameter is omitted, the response contains all cases that the user has access to read. +schema: + oneOf: + - $ref: '../schemas/owners.yaml' + - type: array + items: + $ref: '../schemas/owners.yaml' +example: cases \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/page.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/page.yaml new file mode 100644 index 0000000000000..c222bff951c47 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/page.yaml @@ -0,0 +1,7 @@ +in: query +name: page +description: The page number to return. +schema: + type: integer + default: 1 +example: 1 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/per_page.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/per_page.yaml new file mode 100644 index 0000000000000..07b9f596399c1 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/per_page.yaml @@ -0,0 +1,7 @@ +in: query +name: perPage +description: The number of rules to return per page. +schema: + type: integer + default: 20 +example: 20 diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/reporters.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/reporters.yaml new file mode 100644 index 0000000000000..6fefa32f011dd --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/reporters.yaml @@ -0,0 +1,10 @@ +in: query +name: reporters +description: Filters the returned cases by the user name of the reporter. +schema: + oneOf: + - type: string + - type: array + items: + type: string +example: elastic \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/search.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/search.yaml new file mode 100644 index 0000000000000..b85a3604b3a66 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/search.yaml @@ -0,0 +1,6 @@ +in: query +name: search +description: An Elasticsearch simple_query_string query that filters the objects in the response. +schema: + type: string +example: '%2A' \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/search_fields.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/search_fields.yaml new file mode 100644 index 0000000000000..adf134536382c --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/search_fields.yaml @@ -0,0 +1,9 @@ +in: query +name: searchFields +description: The fields to perform the simple_query_string parsed query against. +schema: + oneOf: + - type: string + - type: array + items: + type: string \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/sort_field.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/sort_field.yaml new file mode 100644 index 0000000000000..c0b732f905c56 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/sort_field.yaml @@ -0,0 +1,10 @@ +in: query +name: sortField +description: Determines which field is used to sort the results. +schema: + type: string + enum: + - createdAt + - updatedAt + default: createdAt +example: updatedAt \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/sort_order.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/sort_order.yaml new file mode 100644 index 0000000000000..9aa4bb92c0ff3 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/sort_order.yaml @@ -0,0 +1,10 @@ +in: query +name: sortOrder +description: Determines the sort order. +schema: + type: string + enum: + - asc + - desc + default: desc +example: asc \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/space_id.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/space_id.yaml new file mode 100644 index 0000000000000..71b6588c35e29 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/space_id.yaml @@ -0,0 +1,6 @@ +in: path +name: spaceId +description: An identifier for the space. +required: true +schema: + type: string diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/status.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/status.yaml new file mode 100644 index 0000000000000..0517e7516a87f --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/status.yaml @@ -0,0 +1,10 @@ +in: query +name: status +description: Filters the returned cases by state. +schema: + type: string + enum: + - closed + - in-progress + - open +example: open \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/tags.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/tags.yaml new file mode 100644 index 0000000000000..04e9b9f306ab8 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/tags.yaml @@ -0,0 +1,10 @@ +in: query +name: tags +description: Filters the returned cases by tags. +schema: + oneOf: + - type: string + - type: array + items: + type: string +example: phishing \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/to.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/to.yaml new file mode 100644 index 0000000000000..abc030506f2b5 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/to.yaml @@ -0,0 +1,6 @@ +in: query +name: to +description: Returns only cases that were created before a specific date. The date must be specified as a KQL data range or date match expression. +schema: + type: string +example: now%2B1d \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/schemas/owners.yaml b/x-pack/plugins/cases/common/openapi/components/schemas/owners.yaml new file mode 100644 index 0000000000000..a68bd6ce5e2eb --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/schemas/owners.yaml @@ -0,0 +1,6 @@ +type: string +title: Owner apps +enum: + - cases + - observability + - securitySolution \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/entrypoint.yaml b/x-pack/plugins/cases/common/openapi/entrypoint.yaml new file mode 100644 index 0000000000000..4575bc01cc622 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/entrypoint.yaml @@ -0,0 +1,61 @@ +openapi: 3.0.1 +tags: [] +info: + title: Cases + description: OpenAPI schema for Cases endpoints + version: '0.1' + contact: + name: Cases Team + license: + name: Elastic License 2.0 + url: https://www.elastic.co/licensing/elastic-license +servers: + - url: 'http://localhost:5601' + description: local +paths: + /api/cases/_find: + $ref: paths/api@cases@_find.yaml + '/s/{spaceId}/api/cases/_find': + $ref: 'paths/s@{spaceid}@api@cases@_find.yaml' +# '/api/cases/{caseId}': +# $ref: paths/get-cases.yaml +# '/s/{spaceId}/api/cases/{caseId}': +# #$ref: 'paths/epm@packages@{pkgkey}_deprecated.yaml' +# $ref: paths/get-cases.yaml +# '/api/cases/{caseId}/user_actions': +# $ref: paths/get-cases.yaml +# '/s/{spaceId}/api/cases/{caseId}/user_actions': +# # $ref: 'paths/epm@packages@{pkg_name}@{pkg_version}.yaml' +# $ref: paths/get-cases.yaml +# /api/cases/status: +# $ref: paths/get-cases.yaml +# '/s/{spaceId}/api/cases/status': +# $ref: paths/get-cases.yaml +# /api/cases/configure/connectors/_find: +# $ref: paths/get-cases.yaml +# '/s/{spaceId}/api/cases/configure/connectors/_find': +# $ref: paths/get-cases.yaml +# '/api/cases/{caseId}/comments': +# $ref: paths/get-cases.yaml +# '/s/{spaceId}/api/cases/{caseId}/comments': +# $ref: paths/get-cases.yaml +# # also in put-cases.yaml +# /api/cases/tags: +# $ref: paths/get-cases.yaml +# '/s/{spaceId}/api/cases/tags': +# $ref: paths/get-cases.yaml +# '/api/cases/{caseId}/comments/{commentId}': +# $ref: paths/get-cases.yaml +# '/s/{spaceId}/api/cases/{caseId}/comments/{commentId}': +# $ref: paths/get-cases.yaml +# /api/cases/configure: +# $ref: paths/get-cases.yaml +# '/s/{spaceId}/api/cases/configure': +# $ref: paths/get-cases.yaml +components: + securitySchemes: + basicAuth: + type: http + scheme: basics +security: + - basicAuth: [] diff --git a/x-pack/plugins/cases/common/openapi/paths/README.md b/x-pack/plugins/cases/common/openapi/paths/README.md new file mode 100644 index 0000000000000..7acd06a6b7db6 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/README.md @@ -0,0 +1,4 @@ +Paths +===== + +Each path definition for which there is a specification exists within this folder. \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml new file mode 100644 index 0000000000000..b305d9636a4fd --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml @@ -0,0 +1,29 @@ +get: + description: Retrieves a paginated subset of cases. + parameters: + - $ref: '../components/parameters/default_search_operator.yaml' + - $ref: '../components/parameters/fields.yaml' + - $ref: '../components/parameters/from.yaml' + - $ref: '../components/parameters/owner.yaml' + - $ref: '../components/parameters/page.yaml' + - $ref: '../components/parameters/per_page.yaml' + - $ref: '../components/parameters/reporters.yaml' + - $ref: '../components/parameters/search.yaml' + - $ref: '../components/parameters/search_fields.yaml' + - $ref: '../components/parameters/sort_field.yaml' + - $ref: '../components/parameters/sort_order.yaml' + - $ref: '../components/parameters/status.yaml' + - $ref: '../components/parameters/tags.yaml' + - $ref: '../components/parameters/to.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml new file mode 100644 index 0000000000000..1ece0b8e89d7d --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml @@ -0,0 +1,30 @@ +get: + description: Retrieves a paginated subset of cases. + parameters: + - $ref: '../components/parameters/space_id.yaml' + - $ref: '../components/parameters/default_search_operator.yaml' + - $ref: '../components/parameters/fields.yaml' + - $ref: '../components/parameters/from.yaml' + - $ref: '../components/parameters/owner.yaml' + - $ref: '../components/parameters/page.yaml' + - $ref: '../components/parameters/per_page.yaml' + - $ref: '../components/parameters/reporters.yaml' + - $ref: '../components/parameters/search.yaml' + - $ref: '../components/parameters/search_fields.yaml' + - $ref: '../components/parameters/sort_field.yaml' + - $ref: '../components/parameters/sort_order.yaml' + - $ref: '../components/parameters/status.yaml' + - $ref: '../components/parameters/tags.yaml' + - $ref: '../components/parameters/to.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/validate_docs.test.ts b/x-pack/plugins/cases/common/openapi/validate_docs.test.ts new file mode 100644 index 0000000000000..2a003c9507537 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/validate_docs.test.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import SwaggerParser from '@apidevtools/swagger-parser'; + +// Validate the entrypoint.yaml file, sothe generated bundle will be correct. +// https://github.com/APIDevTools/swagger-parser + +const validateDocs = async (entrypointFile: string) => { + try { + await SwaggerParser.validate(entrypointFile); + return 'Entrypoint is valid'; + } catch (err) { + return err; + } +}; + +describe('openApi', () => { + it('Checks that entrypoint.yaml is valid', async () => { + expect(await validateDocs('x-pack/plugins/cases/common/openapi/entrypoint.yaml')).toEqual( + 'Entrypoint is valid' + ); + }); +}); From 4b8ead2f649315c29e9b60b40720533d5798427b Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 11 Apr 2022 16:44:39 -0700 Subject: [PATCH 2/9] Add more case API specs --- .../components/parameters/case_id.yaml | 3 +- .../components/parameters/comment_id.yaml | 7 + .../components/parameters/space_id.yaml | 1 + .../components/schemas/comment_types.yaml | 5 + .../schemas/connector_properties.yaml | 65 +++++++ .../components/schemas/connector_types.yaml | 9 + .../openapi/components/schemas/owners.yaml | 2 +- .../openapi/components/schemas/status.yaml | 6 + .../cases/common/openapi/entrypoint.yaml | 72 ++++---- .../cases/common/openapi/paths/api@cases.yaml | 126 +++++++++++++ .../common/openapi/paths/api@cases@_find.yaml | 28 +-- .../api@cases@configure@connectors@_find.yaml | 14 ++ .../openapi/paths/api@cases@status.yaml | 25 +++ .../common/openapi/paths/api@cases@tags.yaml | 24 +++ .../openapi/paths/api@cases@{caseid}.yaml | 23 +++ .../paths/api@cases@{caseid}@comments.yaml | 164 +++++++++++++++++ ...i@cases@{caseid}@comments@{commentid}.yaml | 30 ++++ .../api@cases@{caseid}@user_actions.yaml | 17 ++ .../openapi/paths/s@{spaceid}@api@cases.yaml | 129 ++++++++++++++ .../paths/s@{spaceid}@api@cases@_find.yaml | 30 ++-- ...@api@cases@configure@connectors@_find.yaml | 16 ++ .../paths/s@{spaceid}@api@cases@status.yaml | 26 +++ .../paths/s@{spaceid}@api@cases@tags.yaml | 25 +++ .../paths/s@{spaceid}@api@cases@{caseid}.yaml | 24 +++ ...{spaceid}@api@cases@{caseid}@comments.yaml | 168 ++++++++++++++++++ ...i@cases@{caseid}@comments@{commentid}.yaml | 32 ++++ ...ceid}@api@cases@{caseid}@user_actions.yaml | 18 ++ 27 files changed, 1021 insertions(+), 68 deletions(-) create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/comment_id.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/schemas/comment_types.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/schemas/connector_properties.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/schemas/connector_types.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/schemas/status.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@configure@connectors@_find.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@status.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@tags.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@user_actions.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@status.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@tags.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/case_id.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/case_id.yaml index 53ce5a93f7122..8942deb2a42b4 100644 --- a/x-pack/plugins/cases/common/openapi/components/parameters/case_id.yaml +++ b/x-pack/plugins/cases/common/openapi/components/parameters/case_id.yaml @@ -3,4 +3,5 @@ name: caseId description: An identifier for the case. required: true schema: - type: string \ No newline at end of file + type: string + example: a18b38a0-71b0-11ea-a0b2-c51ea50a58e2 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/comment_id.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/comment_id.yaml new file mode 100644 index 0000000000000..51636b3dc5ed6 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/comment_id.yaml @@ -0,0 +1,7 @@ +in: path +name: commentId +description: An identifier for the comment. +required: true +schema: + type: string + example: 71ec1870-725b-11ea-a0b2-c51ea50a58e2 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/space_id.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/space_id.yaml index 71b6588c35e29..0ff325b08a082 100644 --- a/x-pack/plugins/cases/common/openapi/components/parameters/space_id.yaml +++ b/x-pack/plugins/cases/common/openapi/components/parameters/space_id.yaml @@ -4,3 +4,4 @@ description: An identifier for the space. required: true schema: type: string + example: default diff --git a/x-pack/plugins/cases/common/openapi/components/schemas/comment_types.yaml b/x-pack/plugins/cases/common/openapi/components/schemas/comment_types.yaml new file mode 100644 index 0000000000000..a6a86ae163b20 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/schemas/comment_types.yaml @@ -0,0 +1,5 @@ +type: string +description: The type of comment. +enum: + - alert + - user \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/schemas/connector_properties.yaml b/x-pack/plugins/cases/common/openapi/components/schemas/connector_properties.yaml new file mode 100644 index 0000000000000..c2bc2ab7c887a --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/schemas/connector_properties.yaml @@ -0,0 +1,65 @@ +fields: + description: An object containing the connector fields. To create a case without a connector, specify null. If you want to omit any individual field, specify null as its value. + nullable: true + type: object + properties: + caseId: + description: The case identifier for Swimlane connectors. + type: string + category: + 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 + impact: + description: The effect an incident had on business for ServiceNow ITSM connectors. + type: string + issueType: + description: The type of issue for Jira connectors. + type: string + issueTypes: + description: The type of incident for IBM Resilient connectors. + type: array + items: + type: number + malwareHash: + description: A comma-separated list of malware hashes for ServiceNow SecOps connectors. + type: string + malwareUrl: + description: A comma-separated list of malware URLs for ServiceNow SecOps connectors. + type: string + parent: + description: The key of the parent issue, when the issue type is sub-task for Jira connectors. + type: string + priority: + description: The priority of the issue for Jira and ServiceNow SecOps connectors. + type: string + severity: + description: The severity of the incident for ServiceNow ITSM connectors. + 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 + subcategory: + description: The subcategory of the incident for ServiceNow ITSM connectors. + type: string + urgency: + description: The extent to which the incident resolution can be delayed for ServiceNow ITSM connectors. + type: string + required: + - fields + - id + - name + - type +id: + description: The identifier for the connector. To create a case without a connector, use `none`. + type: string +name: + description: The name of the connector. To create a case without a connector, use `none`. + type: string +type: + $ref: 'connector_types.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/schemas/connector_types.yaml b/x-pack/plugins/cases/common/openapi/components/schemas/connector_types.yaml new file mode 100644 index 0000000000000..24c1ec5880828 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/schemas/connector_types.yaml @@ -0,0 +1,9 @@ +type: string +description: The type of connector. +enum: + - .jira + - .none + - .resilient + - .servicenow + - .servicenow-sir + - .swimlane \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/schemas/owners.yaml b/x-pack/plugins/cases/common/openapi/components/schemas/owners.yaml index a68bd6ce5e2eb..f39324a36e702 100644 --- a/x-pack/plugins/cases/common/openapi/components/schemas/owners.yaml +++ b/x-pack/plugins/cases/common/openapi/components/schemas/owners.yaml @@ -1,5 +1,5 @@ type: string -title: Owner apps +description: Owner apps enum: - cases - observability diff --git a/x-pack/plugins/cases/common/openapi/components/schemas/status.yaml b/x-pack/plugins/cases/common/openapi/components/schemas/status.yaml new file mode 100644 index 0000000000000..1fe2e342dd776 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/schemas/status.yaml @@ -0,0 +1,6 @@ +type: string +description: The status of the case. +enum: + - closed + - in-progress + - open \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/entrypoint.yaml b/x-pack/plugins/cases/common/openapi/entrypoint.yaml index 4575bc01cc622..87a3d7c4ed84f 100644 --- a/x-pack/plugins/cases/common/openapi/entrypoint.yaml +++ b/x-pack/plugins/cases/common/openapi/entrypoint.yaml @@ -13,49 +13,47 @@ servers: - url: 'http://localhost:5601' description: local paths: + /api/cases: + $ref: paths/api@cases.yaml /api/cases/_find: - $ref: paths/api@cases@_find.yaml + $ref: paths/api@cases@_find.yaml + '/api/cases/configure/connectors/_find': + $ref: paths/api@cases@configure@connectors@_find.yaml + '/api/cases/status': + $ref: 'paths/api@cases@status.yaml' + '/api/cases/tags': + $ref: 'paths/api@cases@tags.yaml' + '/api/cases/{caseId}': + $ref: 'paths/api@cases@{caseid}.yaml' + '/api/cases/{caseId}/comments': + $ref: 'paths/api@cases@{caseid}@comments.yaml' + /api/cases/{caseId}/comments/{commentId}: + $ref: 'paths/api@cases@{caseid}@comments@{commentid}.yaml' + '/api/cases/{caseId}/user_actions': + $ref: 'paths/api@cases@{caseid}@user_actions.yaml' + + '/s/{spaceId}/api/cases': + $ref: 'paths/s@{spaceid}@api@cases.yaml' '/s/{spaceId}/api/cases/_find': $ref: 'paths/s@{spaceid}@api@cases@_find.yaml' -# '/api/cases/{caseId}': -# $ref: paths/get-cases.yaml -# '/s/{spaceId}/api/cases/{caseId}': -# #$ref: 'paths/epm@packages@{pkgkey}_deprecated.yaml' -# $ref: paths/get-cases.yaml -# '/api/cases/{caseId}/user_actions': -# $ref: paths/get-cases.yaml -# '/s/{spaceId}/api/cases/{caseId}/user_actions': -# # $ref: 'paths/epm@packages@{pkg_name}@{pkg_version}.yaml' -# $ref: paths/get-cases.yaml -# /api/cases/status: -# $ref: paths/get-cases.yaml -# '/s/{spaceId}/api/cases/status': -# $ref: paths/get-cases.yaml -# /api/cases/configure/connectors/_find: -# $ref: paths/get-cases.yaml -# '/s/{spaceId}/api/cases/configure/connectors/_find': -# $ref: paths/get-cases.yaml -# '/api/cases/{caseId}/comments': -# $ref: paths/get-cases.yaml -# '/s/{spaceId}/api/cases/{caseId}/comments': -# $ref: paths/get-cases.yaml -# # also in put-cases.yaml -# /api/cases/tags: -# $ref: paths/get-cases.yaml -# '/s/{spaceId}/api/cases/tags': -# $ref: paths/get-cases.yaml -# '/api/cases/{caseId}/comments/{commentId}': -# $ref: paths/get-cases.yaml -# '/s/{spaceId}/api/cases/{caseId}/comments/{commentId}': -# $ref: paths/get-cases.yaml -# /api/cases/configure: -# $ref: paths/get-cases.yaml -# '/s/{spaceId}/api/cases/configure': -# $ref: paths/get-cases.yaml + '/s/{spaceId}/api/cases/configure/connectors/_find': + $ref: paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml + '/s/{spaceId}/api/cases/status': + $ref: 'paths/s@{spaceid}@api@cases@status.yaml' + '/s/{spaceId}/api/cases/tags': + $ref: 'paths/s@{spaceid}@api@cases@tags.yaml' + '/s/{spaceId}/api/cases/{caseId}': + $ref: 'paths/s@{spaceid}@api@cases@{caseid}.yaml' + '/s/{spaceId}/api/cases/{caseId}/comments': + $ref: 'paths/s@{spaceid}@api@cases@{caseid}@comments.yaml' + '/s/{spaceId}/api/cases/{caseId}/comments/{commentId}': + $ref: 'paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml' + '/s/{spaceId}/api/cases/{caseId}/user_actions': + $ref: 'paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml' components: securitySchemes: basicAuth: type: http - scheme: basics + scheme: basic security: - basicAuth: [] diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml new file mode 100644 index 0000000000000..174d5ca9c6197 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml @@ -0,0 +1,126 @@ +post: + description: Creates a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + content: + application/json: + 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 + owner: + $ref: '../components/schemas/owners.yaml' + settings: + description: An object that contains the case settings. + type: object + properties: + syncAlerts: + description: Turns alert syncing on or off. + type: boolean + tags: + description: The words and phrases that help categorize cases. It can be an empty array. + type: array + items: + type: string + title: + description: A title for the case. + type: string + required: + - connector + - description + - owner + - settings + - tags + - title + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +delete: + description: Deletes one or more cases. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - name: ids + description: The cases that you want to removed. All non-ASCII characters must be URL encoded. + in: query + schema: + type: string + example: '%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + +patch: + description: Updates one or more cases. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + content: + application/json: + 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. + 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 + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml index b305d9636a4fd..bf91693d41635 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml @@ -1,20 +1,20 @@ get: description: Retrieves a paginated subset of cases. parameters: - - $ref: '../components/parameters/default_search_operator.yaml' - - $ref: '../components/parameters/fields.yaml' - - $ref: '../components/parameters/from.yaml' - - $ref: '../components/parameters/owner.yaml' - - $ref: '../components/parameters/page.yaml' - - $ref: '../components/parameters/per_page.yaml' - - $ref: '../components/parameters/reporters.yaml' - - $ref: '../components/parameters/search.yaml' - - $ref: '../components/parameters/search_fields.yaml' - - $ref: '../components/parameters/sort_field.yaml' - - $ref: '../components/parameters/sort_order.yaml' - - $ref: '../components/parameters/status.yaml' - - $ref: '../components/parameters/tags.yaml' - - $ref: '../components/parameters/to.yaml' + - $ref: '../components/parameters/default_search_operator.yaml' + - $ref: '../components/parameters/fields.yaml' + - $ref: '../components/parameters/from.yaml' + - $ref: '../components/parameters/owner.yaml' + - $ref: '../components/parameters/page.yaml' + - $ref: '../components/parameters/per_page.yaml' + - $ref: '../components/parameters/reporters.yaml' + - $ref: '../components/parameters/search.yaml' + - $ref: '../components/parameters/search_fields.yaml' + - $ref: '../components/parameters/sort_field.yaml' + - $ref: '../components/parameters/sort_order.yaml' + - $ref: '../components/parameters/status.yaml' + - $ref: '../components/parameters/tags.yaml' + - $ref: '../components/parameters/to.yaml' responses: '200': description: Indicates a successful call. diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@connectors@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@connectors@_find.yaml new file mode 100644 index 0000000000000..7ace969718a0d --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@connectors@_find.yaml @@ -0,0 +1,14 @@ +get: + description: Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned. + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@status.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@status.yaml new file mode 100644 index 0000000000000..76620c0732b92 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@status.yaml @@ -0,0 +1,25 @@ +get: + description: Returns the number of cases that are open, closed, and in progress. + deprecated: true + parameters: + - in: query + name: owner + description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read. + schema: + oneOf: + - $ref: '../components/schemas/owners.yaml' + - type: array + items: + $ref: '../components/schemas/owners.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@tags.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@tags.yaml new file mode 100644 index 0000000000000..b5e7b3bebfa80 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@tags.yaml @@ -0,0 +1,24 @@ +get: + description: Aggregates and returns a list of case tags. + parameters: + - in: query + name: owner + description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains tags from all cases that the user has access to read. + schema: + oneOf: + - $ref: '../components/schemas/owners.yaml' + - type: array + items: + $ref: '../components/schemas/owners.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}.yaml new file mode 100644 index 0000000000000..1f4d179dd63bd --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}.yaml @@ -0,0 +1,23 @@ +get: + description: Retrieves a specified case. + parameters: + - $ref: ../components/parameters/case_id.yaml + - in: query + name: includeComments + description: Determines whether case comments are returned. + deprecated: true + schema: + type: boolean + default: true + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml new file mode 100644 index 0000000000000..9baefd92f8580 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml @@ -0,0 +1,164 @@ +post: + description: Adds a comment to a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/case_id.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: + alertId: + description: The alert identifier. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: string + comment: + description: The new comment. It is required only when `type` is `user`. + type: string + index: + description: The alert index. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: string + owner: + $ref: '../components/schemas/owners.yaml' + rule: + description: The rule that is associated with the alert. It is required only when type is alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: object + properties: + id: + description: The rule identifier. + type: string + name: + description: The rule name. + type: string + type: + $ref: '../components/schemas/comment_types.yaml' + required: + - owner + - type + examples: + '0': + value: > + { + + "type": "user", + + "owner": "cases", + + "comment": "That is nothing - Ethan Hunt answered a targeted + social media campaign promoting phishy pension schemes to IMF + operatives." + + } + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +patch: + description: Updates a comment in a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/case_id.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: + alertId: + description: The alert identifier. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: string + comment: + description: The new comment. It is required only when `type` is `user`. + type: string + id: + description: The identifier for the comment. + type: string + index: + description: The alert index. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: string + owner: + $ref: '../components/schemas/owners.yaml' + rule: + description: The rule that is associated with the alert. It is required only when type is alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: object + properties: + id: + description: The rule identifier. + type: string + name: + description: The rule name. + type: string + type: + $ref: '../components/schemas/comment_types.yaml' + version: + description: The current version of the comment. + type: string + required: + - id + - owner + - type + - version + examples: + '0': + value: |- + { + "id": "c7740680-b5e9-11ec-b141-0fdb20a7f9a9", + "version": "WzI2NiwzXQ==", + "type": "user", + "comment": "Updated comment", + "owner": "cases" + } + '1': + value: | + { + "type": "user", + "owner": "cases", + "comment": "no2." + } + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +delete: + description: Deletes all comments from a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/case_id.yaml + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + +get: + description: Retrieves all the comments from a case. + deprecated: true + parameters: + - $ref: ../components/parameters/case_id.yaml + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml new file mode 100644 index 0000000000000..059510445de92 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml @@ -0,0 +1,30 @@ +delete: + description: Deletes a comment from a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/case_id.yaml + - $ref: '../components/parameters/comment_id.yaml' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + +get: + description: Retrieves a comment from a case. + parameters: + - $ref: '../components/parameters/case_id.yaml' + - $ref: '../components/parameters/comment_id.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@user_actions.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@user_actions.yaml new file mode 100644 index 0000000000000..9e866b046dd4b --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@user_actions.yaml @@ -0,0 +1,17 @@ +get: + description: Returns all user activity for the specified case. + deprecated: true + parameters: + - $ref: '../components/parameters/case_id.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml new file mode 100644 index 0000000000000..909aa39ba5c83 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml @@ -0,0 +1,129 @@ +post: + description: Creates a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: '../components/parameters/space_id.yaml' + requestBody: + content: + application/json: + 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 + owner: + $ref: '../components/schemas/owners.yaml' + settings: + description: An object that contains the case settings. + type: object + properties: + syncAlerts: + description: Turns alert syncing on or off. + type: boolean + tags: + description: The words and phrases that help categorize cases. It can be an empty array. + type: array + items: + type: string + title: + description: A title for the case. + type: string + required: + - connector + - description + - owner + - settings + - tags + - title + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +delete: + description: Deletes one or more cases. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: '../components/parameters/space_id.yaml' + - name: ids + description: The cases that you want to removed. All non-ASCII characters must be URL encoded. + in: query + schema: + type: string + example: '%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + +patch: + description: Updates one or more cases. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: '../components/parameters/space_id.yaml' + requestBody: + content: + application/json: + 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. + 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 + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml index 1ece0b8e89d7d..7bc9f727e98d3 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml @@ -1,21 +1,21 @@ get: description: Retrieves a paginated subset of cases. parameters: - - $ref: '../components/parameters/space_id.yaml' - - $ref: '../components/parameters/default_search_operator.yaml' - - $ref: '../components/parameters/fields.yaml' - - $ref: '../components/parameters/from.yaml' - - $ref: '../components/parameters/owner.yaml' - - $ref: '../components/parameters/page.yaml' - - $ref: '../components/parameters/per_page.yaml' - - $ref: '../components/parameters/reporters.yaml' - - $ref: '../components/parameters/search.yaml' - - $ref: '../components/parameters/search_fields.yaml' - - $ref: '../components/parameters/sort_field.yaml' - - $ref: '../components/parameters/sort_order.yaml' - - $ref: '../components/parameters/status.yaml' - - $ref: '../components/parameters/tags.yaml' - - $ref: '../components/parameters/to.yaml' + - $ref: '../components/parameters/space_id.yaml' + - $ref: '../components/parameters/default_search_operator.yaml' + - $ref: '../components/parameters/fields.yaml' + - $ref: '../components/parameters/from.yaml' + - $ref: '../components/parameters/owner.yaml' + - $ref: '../components/parameters/page.yaml' + - $ref: '../components/parameters/per_page.yaml' + - $ref: '../components/parameters/reporters.yaml' + - $ref: '../components/parameters/search.yaml' + - $ref: '../components/parameters/search_fields.yaml' + - $ref: '../components/parameters/sort_field.yaml' + - $ref: '../components/parameters/sort_order.yaml' + - $ref: '../components/parameters/status.yaml' + - $ref: '../components/parameters/tags.yaml' + - $ref: '../components/parameters/to.yaml' responses: '200': description: Indicates a successful call. diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml new file mode 100644 index 0000000000000..ea405146dd2af --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml @@ -0,0 +1,16 @@ +get: + description: Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned. + parameters: + - $ref: '../components/parameters/space_id.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@status.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@status.yaml new file mode 100644 index 0000000000000..36984e56e7048 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@status.yaml @@ -0,0 +1,26 @@ +get: + description: Returns the number of cases that are open, closed, and in progress. + deprecated: true + parameters: + - $ref: '../components/parameters/space_id.yaml' + - in: query + name: owner + description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read. + schema: + oneOf: + - $ref: '../components/schemas/owners.yaml' + - type: array + items: + $ref: '../components/schemas/owners.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@tags.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@tags.yaml new file mode 100644 index 0000000000000..ba78d5a04ac37 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@tags.yaml @@ -0,0 +1,25 @@ +get: + description: Aggregates and returns a list of case tags. + parameters: + - $ref: '../components/parameters/space_id.yaml' + - in: query + name: owner + description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains tags from all cases that the user has access to read. + schema: + oneOf: + - $ref: '../components/schemas/owners.yaml' + - type: array + items: + $ref: '../components/schemas/owners.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml new file mode 100644 index 0000000000000..f3e409fe743a0 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml @@ -0,0 +1,24 @@ +get: + description: Retrieves a specified case. + parameters: + - $ref: ../components/parameters/case_id.yaml + - $ref: '../components/parameters/space_id.yaml' + - in: query + name: includeComments + description: Determines whether case comments are returned. + deprecated: true + schema: + type: boolean + default: true + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml new file mode 100644 index 0000000000000..d8160317a754c --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml @@ -0,0 +1,168 @@ +post: + description: Adds a comment to a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/case_id.yaml + - $ref: '../components/parameters/space_id.yaml' + requestBody: + content: + application/json: + schema: + type: object + properties: + alertId: + description: The alert identifier. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: string + comment: + description: The new comment. It is required only when `type` is `user`. + type: string + index: + description: The alert index. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: string + owner: + $ref: '../components/schemas/owners.yaml' + rule: + description: The rule that is associated with the alert. It is required only when type is alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: object + properties: + id: + description: The rule identifier. + type: string + name: + description: The rule name. + type: string + type: + $ref: '../components/schemas/comment_types.yaml' + required: + - owner + - type + examples: + '0': + value: > + { + + "type": "user", + + "owner": "cases", + + "comment": "That is nothing - Ethan Hunt answered a targeted + social media campaign promoting phishy pension schemes to IMF + operatives." + + } + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +patch: + description: Updates a comment in a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/case_id.yaml + - $ref: '../components/parameters/space_id.yaml' + requestBody: + content: + application/json: + schema: + type: object + properties: + alertId: + description: The alert identifier. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: string + comment: + description: The new comment. It is required only when `type` is `user`. + type: string + id: + description: The identifier for the comment. + type: string + index: + description: The alert index. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: string + owner: + $ref: '../components/schemas/owners.yaml' + rule: + description: The rule that is associated with the alert. It is required only when type is alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + type: object + properties: + id: + description: The rule identifier. + type: string + name: + description: The rule name. + type: string + type: + $ref: '../components/schemas/comment_types.yaml' + version: + description: The current version of the comment. + type: string + required: + - id + - owner + - type + - version + examples: + '0': + value: |- + { + "id": "c7740680-b5e9-11ec-b141-0fdb20a7f9a9", + "version": "WzI2NiwzXQ==", + "type": "user", + "comment": "Updated comment", + "owner": "cases" + } + '1': + value: | + { + "type": "user", + "owner": "cases", + "comment": "no2." + } + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +delete: + description: Deletes all comments from a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/case_id.yaml + - $ref: '../components/parameters/space_id.yaml' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + +get: + description: Retrieves all the comments from a case. + deprecated: true + 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: string + examples: {} + servers: + - url: https://localhost:5601 + +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml new file mode 100644 index 0000000000000..330283ac6c830 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml @@ -0,0 +1,32 @@ +delete: + description: Deletes a comment from a case. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: '../components/parameters/space_id.yaml' + - $ref: ../components/parameters/case_id.yaml + - $ref: '../components/parameters/comment_id.yaml' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + +get: + description: Retrieves a comment from a case. + parameters: + - $ref: '../components/parameters/case_id.yaml' + - $ref: '../components/parameters/comment_id.yaml' + - $ref: '../components/parameters/space_id.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml new file mode 100644 index 0000000000000..7c72c149e3570 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml @@ -0,0 +1,18 @@ +get: + description: Returns all user activity for the specified case. + deprecated: true + 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: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 From b0fd944e1c7d94044f814ef2dcc11febed7c3ae5 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 11 Apr 2022 16:51:52 -0700 Subject: [PATCH 3/9] Generate bundles --- .../plugins/cases/common/openapi/bundled.json | 1930 ++++++++++++++++- .../plugins/cases/common/openapi/bundled.yaml | 1385 +++++++++++- .../cases/common/openapi/paths/README.md | 8 +- 3 files changed, 3265 insertions(+), 58 deletions(-) diff --git a/x-pack/plugins/cases/common/openapi/bundled.json b/x-pack/plugins/cases/common/openapi/bundled.json index 51165f14e93af..8a56449d536c7 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.json +++ b/x-pack/plugins/cases/common/openapi/bundled.json @@ -20,51 +20,1785 @@ } ], "paths": { + "/api/cases": { + "post": { + "description": "Creates a case.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "connector": { + "description": "An object that contains the connector configuration.", + "type": "object", + "properties": { + "fields": { + "description": "An object containing the connector fields. To create a case without a connector, specify null. If you want to omit any individual field, specify null as its value.", + "nullable": true, + "type": "object", + "properties": { + "caseId": { + "description": "The case identifier for Swimlane connectors.", + "type": "string" + }, + "category": { + "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" + }, + "impact": { + "description": "The effect an incident had on business for ServiceNow ITSM connectors.", + "type": "string" + }, + "issueType": { + "description": "The type of issue for Jira connectors.", + "type": "string" + }, + "issueTypes": { + "description": "The type of incident for IBM Resilient connectors.", + "type": "array", + "items": { + "type": "number" + } + }, + "malwareHash": { + "description": "A comma-separated list of malware hashes for ServiceNow SecOps connectors.", + "type": "string" + }, + "malwareUrl": { + "description": "A comma-separated list of malware URLs for ServiceNow SecOps connectors.", + "type": "string" + }, + "parent": { + "description": "The key of the parent issue, when the issue type is sub-task for Jira connectors.", + "type": "string" + }, + "priority": { + "description": "The priority of the issue for Jira and ServiceNow SecOps connectors.", + "type": "string" + }, + "severity": { + "description": "The severity of the incident for ServiceNow ITSM connectors.", + "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" + }, + "subcategory": { + "description": "The subcategory of the incident for ServiceNow ITSM connectors.", + "type": "string" + }, + "urgency": { + "description": "The extent to which the incident resolution can be delayed for ServiceNow ITSM connectors.", + "type": "string" + } + }, + "required": [ + "fields", + "id", + "name", + "type" + ] + }, + "id": { + "description": "The identifier for the connector. To create a case without a connector, use `none`.", + "type": "string" + }, + "name": { + "description": "The name of the connector. To create a case without a connector, use `none`.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + } + }, + "description": { + "description": "The description for the case.", + "type": "string" + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "settings": { + "description": "An object that contains the case settings.", + "type": "object", + "properties": { + "syncAlerts": { + "description": "Turns alert syncing on or off.", + "type": "boolean" + } + } + }, + "tags": { + "description": "The words and phrases that help categorize cases. It can be an empty array.", + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "description": "A title for the case.", + "type": "string" + } + }, + "required": [ + "connector", + "description", + "owner", + "settings", + "tags", + "title" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "delete": { + "description": "Deletes one or more cases.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "name": "ids", + "description": "The cases that you want to removed. All non-ASCII characters must be URL encoded.", + "in": "query", + "schema": { + "type": "string" + }, + "example": "%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D" + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "patch": { + "description": "Updates one or more cases.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "connector": { + "description": "An object that contains the connector configuration.", + "type": "object", + "properties": { + "fields": { + "description": "An object containing the connector fields. To create a case without a connector, specify null. If you want to omit any individual field, specify null as its value.", + "nullable": true, + "type": "object", + "properties": { + "caseId": { + "description": "The case identifier for Swimlane connectors.", + "type": "string" + }, + "category": { + "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" + }, + "impact": { + "description": "The effect an incident had on business for ServiceNow ITSM connectors.", + "type": "string" + }, + "issueType": { + "description": "The type of issue for Jira connectors.", + "type": "string" + }, + "issueTypes": { + "description": "The type of incident for IBM Resilient connectors.", + "type": "array", + "items": { + "type": "number" + } + }, + "malwareHash": { + "description": "A comma-separated list of malware hashes for ServiceNow SecOps connectors.", + "type": "string" + }, + "malwareUrl": { + "description": "A comma-separated list of malware URLs for ServiceNow SecOps connectors.", + "type": "string" + }, + "parent": { + "description": "The key of the parent issue, when the issue type is sub-task for Jira connectors.", + "type": "string" + }, + "priority": { + "description": "The priority of the issue for Jira and ServiceNow SecOps connectors.", + "type": "string" + }, + "severity": { + "description": "The severity of the incident for ServiceNow ITSM connectors.", + "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" + }, + "subcategory": { + "description": "The subcategory of the incident for ServiceNow ITSM connectors.", + "type": "string" + }, + "urgency": { + "description": "The extent to which the incident resolution can be delayed for ServiceNow ITSM connectors.", + "type": "string" + } + }, + "required": [ + "fields", + "id", + "name", + "type" + ] + }, + "id": { + "description": "The identifier for the connector. To create a case without a connector, use `none`.", + "type": "string" + }, + "name": { + "description": "The name of the connector. To create a case without a connector, use `none`.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + } + }, + "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" + }, + "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" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "/api/cases/_find": { "get": { - "description": "Retrieves a paginated subset of cases.", + "description": "Retrieves a paginated subset of cases.", + "parameters": [ + { + "$ref": "#/components/parameters/default_search_operator" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/from" + }, + { + "$ref": "#/components/parameters/owner" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/reporters" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/search_fields" + }, + { + "$ref": "#/components/parameters/sort_field" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/tags" + }, + { + "$ref": "#/components/parameters/to" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/cases/configure/connectors/_find": { + "get": { + "description": "Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned.", + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/cases/status": { + "get": { + "description": "Returns the number of cases that are open, closed, and in progress.", + "deprecated": true, + "parameters": [ + { + "in": "query", + "name": "owner", + "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read.", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/owners" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/owners" + } + } + ] + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/cases/tags": { + "get": { + "description": "Aggregates and returns a list of case tags.", + "parameters": [ + { + "in": "query", + "name": "owner", + "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains tags from all cases that the user has access to read.", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/owners" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/owners" + } + } + ] + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/cases/{caseId}": { + "get": { + "description": "Retrieves a specified case.", + "parameters": [ + { + "$ref": "#/components/parameters/case_id" + }, + { + "in": "query", + "name": "includeComments", + "description": "Determines whether case comments are returned.", + "deprecated": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/cases/{caseId}/comments": { + "post": { + "description": "Adds a comment to a case.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/case_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "alertId": { + "description": "The alert identifier. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "string" + }, + "comment": { + "description": "The new comment. It is required only when `type` is `user`.", + "type": "string" + }, + "index": { + "description": "The alert index. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "string" + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "rule": { + "description": "The rule that is associated with the alert. It is required only when type is alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "object", + "properties": { + "id": { + "description": "The rule identifier.", + "type": "string" + }, + "name": { + "description": "The rule name.", + "type": "string" + } + } + }, + "type": { + "$ref": "#/components/schemas/comment_types" + } + }, + "required": [ + "owner", + "type" + ] + }, + "examples": { + "0": { + "value": "{\n\n \"type\": \"user\",\n\n \"owner\": \"cases\",\n\n \"comment\": \"That is nothing - Ethan Hunt answered a targeted\n social media campaign promoting phishy pension schemes to IMF\n operatives.\"\n\n}\n" + } + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "patch": { + "description": "Updates a comment in a case.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/case_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "alertId": { + "description": "The alert identifier. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "string" + }, + "comment": { + "description": "The new comment. It is required only when `type` is `user`.", + "type": "string" + }, + "id": { + "description": "The identifier for the comment.", + "type": "string" + }, + "index": { + "description": "The alert index. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "string" + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "rule": { + "description": "The rule that is associated with the alert. It is required only when type is alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "object", + "properties": { + "id": { + "description": "The rule identifier.", + "type": "string" + }, + "name": { + "description": "The rule name.", + "type": "string" + } + } + }, + "type": { + "$ref": "#/components/schemas/comment_types" + }, + "version": { + "description": "The current version of the comment.", + "type": "string" + } + }, + "required": [ + "id", + "owner", + "type", + "version" + ] + }, + "examples": { + "0": { + "value": "{\n \"id\": \"c7740680-b5e9-11ec-b141-0fdb20a7f9a9\",\n \"version\": \"WzI2NiwzXQ==\",\n \"type\": \"user\",\n \"comment\": \"Updated comment\",\n \"owner\": \"cases\"\n }\n'1':\n value: |\n {\n \"type\": \"user\",\n \"owner\": \"cases\",\n \"comment\": \"no2.\"\n}" + } + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "delete": { + "description": "Deletes all comments from a case.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/case_id" + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "get": { + "description": "Retrieves all the comments from a case.", + "deprecated": true, + "parameters": [ + { + "$ref": "#/components/parameters/case_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/cases/{caseId}/comments/{commentId}": { + "delete": { + "description": "Deletes a comment from a case.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/case_id" + }, + { + "$ref": "#/components/parameters/comment_id" + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "get": { + "description": "Retrieves a comment from a case.", + "parameters": [ + { + "$ref": "#/components/parameters/case_id" + }, + { + "$ref": "#/components/parameters/comment_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/cases/{caseId}/user_actions": { + "get": { + "description": "Returns all user activity for the specified case.", + "deprecated": true, + "parameters": [ + { + "$ref": "#/components/parameters/case_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases": { + "post": { + "description": "Creates a case.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/space_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "connector": { + "description": "An object that contains the connector configuration.", + "type": "object", + "properties": { + "fields": { + "description": "An object containing the connector fields. To create a case without a connector, specify null. If you want to omit any individual field, specify null as its value.", + "nullable": true, + "type": "object", + "properties": { + "caseId": { + "description": "The case identifier for Swimlane connectors.", + "type": "string" + }, + "category": { + "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" + }, + "impact": { + "description": "The effect an incident had on business for ServiceNow ITSM connectors.", + "type": "string" + }, + "issueType": { + "description": "The type of issue for Jira connectors.", + "type": "string" + }, + "issueTypes": { + "description": "The type of incident for IBM Resilient connectors.", + "type": "array", + "items": { + "type": "number" + } + }, + "malwareHash": { + "description": "A comma-separated list of malware hashes for ServiceNow SecOps connectors.", + "type": "string" + }, + "malwareUrl": { + "description": "A comma-separated list of malware URLs for ServiceNow SecOps connectors.", + "type": "string" + }, + "parent": { + "description": "The key of the parent issue, when the issue type is sub-task for Jira connectors.", + "type": "string" + }, + "priority": { + "description": "The priority of the issue for Jira and ServiceNow SecOps connectors.", + "type": "string" + }, + "severity": { + "description": "The severity of the incident for ServiceNow ITSM connectors.", + "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" + }, + "subcategory": { + "description": "The subcategory of the incident for ServiceNow ITSM connectors.", + "type": "string" + }, + "urgency": { + "description": "The extent to which the incident resolution can be delayed for ServiceNow ITSM connectors.", + "type": "string" + } + }, + "required": [ + "fields", + "id", + "name", + "type" + ] + }, + "id": { + "description": "The identifier for the connector. To create a case without a connector, use `none`.", + "type": "string" + }, + "name": { + "description": "The name of the connector. To create a case without a connector, use `none`.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + } + }, + "description": { + "description": "The description for the case.", + "type": "string" + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "settings": { + "description": "An object that contains the case settings.", + "type": "object", + "properties": { + "syncAlerts": { + "description": "Turns alert syncing on or off.", + "type": "boolean" + } + } + }, + "tags": { + "description": "The words and phrases that help categorize cases. It can be an empty array.", + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "description": "A title for the case.", + "type": "string" + } + }, + "required": [ + "connector", + "description", + "owner", + "settings", + "tags", + "title" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "delete": { + "description": "Deletes one or more cases.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/space_id" + }, + { + "name": "ids", + "description": "The cases that you want to removed. All non-ASCII characters must be URL encoded.", + "in": "query", + "schema": { + "type": "string" + }, + "example": "%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D" + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "patch": { + "description": "Updates one or more cases.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/space_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "connector": { + "description": "An object that contains the connector configuration.", + "type": "object", + "properties": { + "fields": { + "description": "An object containing the connector fields. To create a case without a connector, specify null. If you want to omit any individual field, specify null as its value.", + "nullable": true, + "type": "object", + "properties": { + "caseId": { + "description": "The case identifier for Swimlane connectors.", + "type": "string" + }, + "category": { + "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" + }, + "impact": { + "description": "The effect an incident had on business for ServiceNow ITSM connectors.", + "type": "string" + }, + "issueType": { + "description": "The type of issue for Jira connectors.", + "type": "string" + }, + "issueTypes": { + "description": "The type of incident for IBM Resilient connectors.", + "type": "array", + "items": { + "type": "number" + } + }, + "malwareHash": { + "description": "A comma-separated list of malware hashes for ServiceNow SecOps connectors.", + "type": "string" + }, + "malwareUrl": { + "description": "A comma-separated list of malware URLs for ServiceNow SecOps connectors.", + "type": "string" + }, + "parent": { + "description": "The key of the parent issue, when the issue type is sub-task for Jira connectors.", + "type": "string" + }, + "priority": { + "description": "The priority of the issue for Jira and ServiceNow SecOps connectors.", + "type": "string" + }, + "severity": { + "description": "The severity of the incident for ServiceNow ITSM connectors.", + "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" + }, + "subcategory": { + "description": "The subcategory of the incident for ServiceNow ITSM connectors.", + "type": "string" + }, + "urgency": { + "description": "The extent to which the incident resolution can be delayed for ServiceNow ITSM connectors.", + "type": "string" + } + }, + "required": [ + "fields", + "id", + "name", + "type" + ] + }, + "id": { + "description": "The identifier for the connector. To create a case without a connector, use `none`.", + "type": "string" + }, + "name": { + "description": "The name of the connector. To create a case without a connector, use `none`.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + } + }, + "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" + }, + "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" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/_find": { + "get": { + "description": "Retrieves a paginated subset of cases.", + "parameters": [ + { + "$ref": "#/components/parameters/space_id" + }, + { + "$ref": "#/components/parameters/default_search_operator" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/from" + }, + { + "$ref": "#/components/parameters/owner" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/reporters" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/search_fields" + }, + { + "$ref": "#/components/parameters/sort_field" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/tags" + }, + { + "$ref": "#/components/parameters/to" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/configure/connectors/_find": { + "get": { + "description": "Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned.", + "parameters": [ + { + "$ref": "#/components/parameters/space_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/status": { + "get": { + "description": "Returns the number of cases that are open, closed, and in progress.", + "deprecated": true, + "parameters": [ + { + "$ref": "#/components/parameters/space_id" + }, + { + "in": "query", + "name": "owner", + "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read.", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/owners" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/owners" + } + } + ] + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/tags": { + "get": { + "description": "Aggregates and returns a list of case tags.", + "parameters": [ + { + "$ref": "#/components/parameters/space_id" + }, + { + "in": "query", + "name": "owner", + "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains tags from all cases that the user has access to read.", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/owners" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/owners" + } + } + ] + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/{caseId}": { + "get": { + "description": "Retrieves a specified case.", "parameters": [ { - "$ref": "#/components/parameters/default_search_operator" + "$ref": "#/components/parameters/case_id" }, { - "$ref": "#/components/parameters/fields" + "$ref": "#/components/parameters/space_id" }, { - "$ref": "#/components/parameters/from" - }, + "in": "query", + "name": "includeComments", + "description": "Determines whether case comments are returned.", + "deprecated": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ { - "$ref": "#/components/parameters/owner" - }, + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/{caseId}/comments": { + "post": { + "description": "Adds a comment to a case.", + "parameters": [ { - "$ref": "#/components/parameters/page" + "$ref": "#/components/parameters/kbn_xsrf" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/case_id" }, { - "$ref": "#/components/parameters/reporters" - }, + "$ref": "#/components/parameters/space_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "alertId": { + "description": "The alert identifier. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "string" + }, + "comment": { + "description": "The new comment. It is required only when `type` is `user`.", + "type": "string" + }, + "index": { + "description": "The alert index. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "string" + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "rule": { + "description": "The rule that is associated with the alert. It is required only when type is alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "object", + "properties": { + "id": { + "description": "The rule identifier.", + "type": "string" + }, + "name": { + "description": "The rule name.", + "type": "string" + } + } + }, + "type": { + "$ref": "#/components/schemas/comment_types" + } + }, + "required": [ + "owner", + "type" + ] + }, + "examples": { + "0": { + "value": "{\n\n \"type\": \"user\",\n\n \"owner\": \"cases\",\n\n \"comment\": \"That is nothing - Ethan Hunt answered a targeted\n social media campaign promoting phishy pension schemes to IMF\n operatives.\"\n\n}\n" + } + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ { - "$ref": "#/components/parameters/search" - }, + "url": "https://localhost:5601" + } + ] + }, + "patch": { + "description": "Updates a comment in a case.", + "parameters": [ { - "$ref": "#/components/parameters/search_fields" + "$ref": "#/components/parameters/kbn_xsrf" }, { - "$ref": "#/components/parameters/sort_field" + "$ref": "#/components/parameters/case_id" }, { - "$ref": "#/components/parameters/sort_order" + "$ref": "#/components/parameters/space_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "alertId": { + "description": "The alert identifier. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "string" + }, + "comment": { + "description": "The new comment. It is required only when `type` is `user`.", + "type": "string" + }, + "id": { + "description": "The identifier for the comment.", + "type": "string" + }, + "index": { + "description": "The alert index. It is required only when `type` is `alert`. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "string" + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "rule": { + "description": "The rule that is associated with the alert. It is required only when type is alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", + "type": "object", + "properties": { + "id": { + "description": "The rule identifier.", + "type": "string" + }, + "name": { + "description": "The rule name.", + "type": "string" + } + } + }, + "type": { + "$ref": "#/components/schemas/comment_types" + }, + "version": { + "description": "The current version of the comment.", + "type": "string" + } + }, + "required": [ + "id", + "owner", + "type", + "version" + ] + }, + "examples": { + "0": { + "value": "{\n \"id\": \"c7740680-b5e9-11ec-b141-0fdb20a7f9a9\",\n \"version\": \"WzI2NiwzXQ==\",\n \"type\": \"user\",\n \"comment\": \"Updated comment\",\n \"owner\": \"cases\"\n }\n'1':\n value: |\n {\n \"type\": \"user\",\n \"owner\": \"cases\",\n \"comment\": \"no2.\"\n}" + } + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "delete": { + "description": "Deletes all comments from a case.", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" }, { - "$ref": "#/components/parameters/status" + "$ref": "#/components/parameters/case_id" }, { - "$ref": "#/components/parameters/tags" + "$ref": "#/components/parameters/space_id" + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "get": { + "description": "Retrieves all the comments from a case.", + "deprecated": true, + "parameters": [ + { + "$ref": "#/components/parameters/case_id" }, { - "$ref": "#/components/parameters/to" + "$ref": "#/components/parameters/space_id" } ], "responses": { @@ -92,54 +1826,82 @@ } ] }, - "/s/{spaceId}/api/cases/_find": { - "get": { - "description": "Retrieves a paginated subset of cases.", + "/s/{spaceId}/api/cases/{caseId}/comments/{commentId}": { + "delete": { + "description": "Deletes a comment from a case.", "parameters": [ { - "$ref": "#/components/parameters/space_id" - }, - { - "$ref": "#/components/parameters/default_search_operator" - }, - { - "$ref": "#/components/parameters/fields" - }, - { - "$ref": "#/components/parameters/from" - }, - { - "$ref": "#/components/parameters/owner" + "$ref": "#/components/parameters/kbn_xsrf" }, { - "$ref": "#/components/parameters/page" + "$ref": "#/components/parameters/space_id" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/case_id" }, { - "$ref": "#/components/parameters/reporters" - }, + "$ref": "#/components/parameters/comment_id" + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "servers": [ { - "$ref": "#/components/parameters/search" - }, + "url": "https://localhost:5601" + } + ] + }, + "get": { + "description": "Retrieves a comment from a case.", + "parameters": [ { - "$ref": "#/components/parameters/search_fields" + "$ref": "#/components/parameters/case_id" }, { - "$ref": "#/components/parameters/sort_field" + "$ref": "#/components/parameters/comment_id" }, { - "$ref": "#/components/parameters/sort_order" - }, + "$ref": "#/components/parameters/space_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ { - "$ref": "#/components/parameters/status" - }, + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/{caseId}/user_actions": { + "get": { + "description": "Returns all user activity for the specified case.", + "deprecated": true, + "parameters": [ { - "$ref": "#/components/parameters/tags" + "$ref": "#/components/parameters/case_id" }, { - "$ref": "#/components/parameters/to" + "$ref": "#/components/parameters/space_id" } ], "responses": { @@ -149,9 +1911,9 @@ "application/json; charset=utf-8": { "schema": { "type": "string" - }, - "examples": {} - } + } + }, + "examples": {} } } }, @@ -172,10 +1934,18 @@ "securitySchemes": { "basicAuth": { "type": "http", - "scheme": "basics" + "scheme": "basic" } }, "parameters": { + "kbn_xsrf": { + "schema": { + "type": "string" + }, + "in": "header", + "name": "kbn-xsrf", + "required": true + }, "default_search_operator": { "in": "query", "name": "defaultSearchOperator", @@ -361,25 +2131,75 @@ }, "example": "now%2B1d" }, + "case_id": { + "in": "path", + "name": "caseId", + "description": "An identifier for the case.", + "required": true, + "schema": { + "type": "string", + "example": "a18b38a0-71b0-11ea-a0b2-c51ea50a58e2" + } + }, + "comment_id": { + "in": "path", + "name": "commentId", + "description": "An identifier for the comment.", + "required": true, + "schema": { + "type": "string", + "example": "71ec1870-725b-11ea-a0b2-c51ea50a58e2" + } + }, "space_id": { "in": "path", "name": "spaceId", "description": "An identifier for the space.", "required": true, "schema": { - "type": "string" + "type": "string", + "example": "default" } } }, "schemas": { + "connector_types": { + "type": "string", + "description": "The type of connector.", + "enum": [ + ".jira", + ".none", + ".resilient", + ".servicenow", + ".servicenow-sir", + ".swimlane" + ] + }, "owners": { "type": "string", - "title": "Owner apps", + "description": "Owner apps", "enum": [ "cases", "observability", "securitySolution" ] + }, + "status": { + "type": "string", + "description": "The status of the case.", + "enum": [ + "closed", + "in-progress", + "open" + ] + }, + "comment_types": { + "type": "string", + "description": "The type of comment.", + "enum": [ + "alert", + "user" + ] } } }, diff --git a/x-pack/plugins/cases/common/openapi/bundled.yaml b/x-pack/plugins/cases/common/openapi/bundled.yaml index 6b12e1ee4811b..ee10e5c179038 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.yaml +++ b/x-pack/plugins/cases/common/openapi/bundled.yaml @@ -13,6 +13,324 @@ servers: - url: http://localhost:5601 description: local paths: + /api/cases: + post: + description: Creates a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + content: + application/json: + schema: + type: object + properties: + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: >- + An object containing the connector fields. To create a + case without a connector, specify null. If you want to + omit any individual field, specify null as its value. + nullable: true + type: object + properties: + caseId: + description: The case identifier for Swimlane connectors. + type: string + category: + 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 + impact: + description: >- + The effect an incident had on business for + ServiceNow ITSM connectors. + type: string + issueType: + description: The type of issue for Jira connectors. + type: string + issueTypes: + description: The type of incident for IBM Resilient connectors. + type: array + items: + type: number + malwareHash: + description: >- + A comma-separated list of malware hashes for + ServiceNow SecOps connectors. + type: string + malwareUrl: + description: >- + A comma-separated list of malware URLs for + ServiceNow SecOps connectors. + type: string + parent: + description: >- + The key of the parent issue, when the issue type is + sub-task for Jira connectors. + type: string + priority: + description: >- + The priority of the issue for Jira and ServiceNow + SecOps connectors. + type: string + severity: + description: >- + The severity of the incident for ServiceNow ITSM + connectors. + 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 + subcategory: + description: >- + The subcategory of the incident for ServiceNow ITSM + connectors. + type: string + urgency: + description: >- + The extent to which the incident resolution can be + delayed for ServiceNow ITSM connectors. + type: string + required: + - fields + - id + - name + - type + id: + description: >- + The identifier for the connector. To create a case + without a connector, use `none`. + type: string + name: + description: >- + The name of the connector. To create a case without a + connector, use `none`. + type: string + type: + $ref: '#/components/schemas/connector_types' + description: + description: The description for the case. + type: string + owner: + $ref: '#/components/schemas/owners' + settings: + description: An object that contains the case settings. + type: object + properties: + syncAlerts: + description: Turns alert syncing on or off. + type: boolean + tags: + description: >- + The words and phrases that help categorize cases. It can be + an empty array. + type: array + items: + type: string + title: + description: A title for the case. + type: string + required: + - connector + - description + - owner + - settings + - tags + - title + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + delete: + description: Deletes one or more cases. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - name: ids + description: >- + The cases that you want to removed. All non-ASCII characters must be + URL encoded. + in: query + schema: + type: string + example: '%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + patch: + description: Updates one or more cases. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + content: + application/json: + schema: + type: object + properties: + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: >- + An object containing the connector fields. To create a + case without a connector, specify null. If you want to + omit any individual field, specify null as its value. + nullable: true + type: object + properties: + caseId: + description: The case identifier for Swimlane connectors. + type: string + category: + 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 + impact: + description: >- + The effect an incident had on business for + ServiceNow ITSM connectors. + type: string + issueType: + description: The type of issue for Jira connectors. + type: string + issueTypes: + description: The type of incident for IBM Resilient connectors. + type: array + items: + type: number + malwareHash: + description: >- + A comma-separated list of malware hashes for + ServiceNow SecOps connectors. + type: string + malwareUrl: + description: >- + A comma-separated list of malware URLs for + ServiceNow SecOps connectors. + type: string + parent: + description: >- + The key of the parent issue, when the issue type is + sub-task for Jira connectors. + type: string + priority: + description: >- + The priority of the issue for Jira and ServiceNow + SecOps connectors. + type: string + severity: + description: >- + The severity of the incident for ServiceNow ITSM + connectors. + 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 + subcategory: + description: >- + The subcategory of the incident for ServiceNow ITSM + connectors. + type: string + urgency: + description: >- + The extent to which the incident resolution can be + delayed for ServiceNow ITSM connectors. + type: string + required: + - fields + - id + - name + - type + id: + description: >- + The identifier for the connector. To create a case + without a connector, use `none`. + type: string + name: + description: >- + The name of the connector. To create a case without a + connector, use `none`. + type: string + type: + $ref: '#/components/schemas/connector_types' + 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' + 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 + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /api/cases/_find: get: description: Retrieves a paginated subset of cases. @@ -43,6 +361,669 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /api/cases/configure/connectors/_find: + get: + description: >- + Retrieves information about connectors. In particular, only the + connectors that are supported for use in cases are returned. + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/cases/status: + get: + description: Returns the number of cases that are open, closed, and in progress. + deprecated: true + parameters: + - in: query + name: owner + description: >- + A filter to limit the retrieved case statistics to a specific set of + applications. If this parameter is omitted, the response contains + all cases that the user has access to read. + schema: + oneOf: + - $ref: '#/components/schemas/owners' + - type: array + items: + $ref: '#/components/schemas/owners' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/cases/tags: + get: + description: Aggregates and returns a list of case tags. + parameters: + - in: query + name: owner + description: >- + A filter to limit the retrieved case statistics to a specific set of + applications. If this parameter is omitted, the response contains + tags from all cases that the user has access to read. + schema: + oneOf: + - $ref: '#/components/schemas/owners' + - type: array + items: + $ref: '#/components/schemas/owners' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/cases/{caseId}: + get: + description: Retrieves a specified case. + parameters: + - $ref: '#/components/parameters/case_id' + - in: query + name: includeComments + description: Determines whether case comments are returned. + deprecated: true + schema: + type: boolean + default: true + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/cases/{caseId}/comments: + post: + description: Adds a comment to a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/case_id' + requestBody: + content: + application/json: + schema: + type: object + properties: + alertId: + description: >- + The alert identifier. It is required only when `type` is + `alert`. This functionality is in technical preview and may + be changed or removed in a future release. Elastic will + apply best effort to fix any issues, but features in + technical preview are not subject to the support SLA of + official GA features. + type: string + comment: + description: The new comment. It is required only when `type` is `user`. + type: string + index: + description: >- + The alert index. It is required only when `type` is `alert`. + This functionality is in technical preview and may be + changed or removed in a future release. Elastic will apply + best effort to fix any issues, but features in technical + preview are not subject to the support SLA of official GA + features. + type: string + owner: + $ref: '#/components/schemas/owners' + rule: + description: >- + The rule that is associated with the alert. It is required + only when type is alert. This functionality is in technical + preview and may be changed or removed in a future release. + Elastic will apply best effort to fix any issues, but + features in technical preview are not subject to the support + SLA of official GA features. + type: object + properties: + id: + description: The rule identifier. + type: string + name: + description: The rule name. + type: string + type: + $ref: '#/components/schemas/comment_types' + required: + - owner + - type + examples: + '0': + value: | + { + + "type": "user", + + "owner": "cases", + + "comment": "That is nothing - Ethan Hunt answered a targeted + social media campaign promoting phishy pension schemes to IMF + operatives." + + } + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + patch: + description: Updates a comment in a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/case_id' + requestBody: + content: + application/json: + schema: + type: object + properties: + alertId: + description: >- + The alert identifier. It is required only when `type` is + `alert`. This functionality is in technical preview and may + be changed or removed in a future release. Elastic will + apply best effort to fix any issues, but features in + technical preview are not subject to the support SLA of + official GA features. + type: string + comment: + description: The new comment. It is required only when `type` is `user`. + type: string + id: + description: The identifier for the comment. + type: string + index: + description: >- + The alert index. It is required only when `type` is `alert`. + This functionality is in technical preview and may be + changed or removed in a future release. Elastic will apply + best effort to fix any issues, but features in technical + preview are not subject to the support SLA of official GA + features. + type: string + owner: + $ref: '#/components/schemas/owners' + rule: + description: >- + The rule that is associated with the alert. It is required + only when type is alert. This functionality is in technical + preview and may be changed or removed in a future release. + Elastic will apply best effort to fix any issues, but + features in technical preview are not subject to the support + SLA of official GA features. + type: object + properties: + id: + description: The rule identifier. + type: string + name: + description: The rule name. + type: string + type: + $ref: '#/components/schemas/comment_types' + version: + description: The current version of the comment. + type: string + required: + - id + - owner + - type + - version + examples: + '0': + value: |- + { + "id": "c7740680-b5e9-11ec-b141-0fdb20a7f9a9", + "version": "WzI2NiwzXQ==", + "type": "user", + "comment": "Updated comment", + "owner": "cases" + } + '1': + value: | + { + "type": "user", + "owner": "cases", + "comment": "no2." + } + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + delete: + description: Deletes all comments from a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/case_id' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + get: + description: Retrieves all the comments from a case. + deprecated: true + parameters: + - $ref: '#/components/parameters/case_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/cases/{caseId}/comments/{commentId}: + delete: + description: Deletes a comment from a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/comment_id' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + get: + description: Retrieves a comment from a case. + parameters: + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/comment_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/cases/{caseId}/user_actions: + get: + description: Returns all user activity for the specified case. + deprecated: true + parameters: + - $ref: '#/components/parameters/case_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases: + post: + description: Creates a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' + requestBody: + content: + application/json: + schema: + type: object + properties: + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: >- + An object containing the connector fields. To create a + case without a connector, specify null. If you want to + omit any individual field, specify null as its value. + nullable: true + type: object + properties: + caseId: + description: The case identifier for Swimlane connectors. + type: string + category: + 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 + impact: + description: >- + The effect an incident had on business for + ServiceNow ITSM connectors. + type: string + issueType: + description: The type of issue for Jira connectors. + type: string + issueTypes: + description: The type of incident for IBM Resilient connectors. + type: array + items: + type: number + malwareHash: + description: >- + A comma-separated list of malware hashes for + ServiceNow SecOps connectors. + type: string + malwareUrl: + description: >- + A comma-separated list of malware URLs for + ServiceNow SecOps connectors. + type: string + parent: + description: >- + The key of the parent issue, when the issue type is + sub-task for Jira connectors. + type: string + priority: + description: >- + The priority of the issue for Jira and ServiceNow + SecOps connectors. + type: string + severity: + description: >- + The severity of the incident for ServiceNow ITSM + connectors. + 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 + subcategory: + description: >- + The subcategory of the incident for ServiceNow ITSM + connectors. + type: string + urgency: + description: >- + The extent to which the incident resolution can be + delayed for ServiceNow ITSM connectors. + type: string + required: + - fields + - id + - name + - type + id: + description: >- + The identifier for the connector. To create a case + without a connector, use `none`. + type: string + name: + description: >- + The name of the connector. To create a case without a + connector, use `none`. + type: string + type: + $ref: '#/components/schemas/connector_types' + description: + description: The description for the case. + type: string + owner: + $ref: '#/components/schemas/owners' + settings: + description: An object that contains the case settings. + type: object + properties: + syncAlerts: + description: Turns alert syncing on or off. + type: boolean + tags: + description: >- + The words and phrases that help categorize cases. It can be + an empty array. + type: array + items: + type: string + title: + description: A title for the case. + type: string + required: + - connector + - description + - owner + - settings + - tags + - title + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + delete: + description: Deletes one or more cases. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' + - name: ids + description: >- + The cases that you want to removed. All non-ASCII characters must be + URL encoded. + in: query + schema: + type: string + example: '%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + patch: + description: Updates one or more cases. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' + requestBody: + content: + application/json: + schema: + type: object + properties: + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: >- + An object containing the connector fields. To create a + case without a connector, specify null. If you want to + omit any individual field, specify null as its value. + nullable: true + type: object + properties: + caseId: + description: The case identifier for Swimlane connectors. + type: string + category: + 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 + impact: + description: >- + The effect an incident had on business for + ServiceNow ITSM connectors. + type: string + issueType: + description: The type of issue for Jira connectors. + type: string + issueTypes: + description: The type of incident for IBM Resilient connectors. + type: array + items: + type: number + malwareHash: + description: >- + A comma-separated list of malware hashes for + ServiceNow SecOps connectors. + type: string + malwareUrl: + description: >- + A comma-separated list of malware URLs for + ServiceNow SecOps connectors. + type: string + parent: + description: >- + The key of the parent issue, when the issue type is + sub-task for Jira connectors. + type: string + priority: + description: >- + The priority of the issue for Jira and ServiceNow + SecOps connectors. + type: string + severity: + description: >- + The severity of the incident for ServiceNow ITSM + connectors. + 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 + subcategory: + description: >- + The subcategory of the incident for ServiceNow ITSM + connectors. + type: string + urgency: + description: >- + The extent to which the incident resolution can be + delayed for ServiceNow ITSM connectors. + type: string + required: + - fields + - id + - name + - type + id: + description: >- + The identifier for the connector. To create a case + without a connector, use `none`. + type: string + name: + description: >- + The name of the connector. To create a case without a + connector, use `none`. + type: string + type: + $ref: '#/components/schemas/connector_types' + 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' + 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 + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /s/{spaceId}/api/cases/_find: get: description: Retrieves a paginated subset of cases. @@ -74,12 +1055,372 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /s/{spaceId}/api/cases/configure/connectors/_find: + get: + description: >- + Retrieves information about connectors. In particular, only the + connectors that are supported for use in cases are returned. + parameters: + - $ref: '#/components/parameters/space_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases/status: + get: + description: Returns the number of cases that are open, closed, and in progress. + deprecated: true + parameters: + - $ref: '#/components/parameters/space_id' + - in: query + name: owner + description: >- + A filter to limit the retrieved case statistics to a specific set of + applications. If this parameter is omitted, the response contains + all cases that the user has access to read. + schema: + oneOf: + - $ref: '#/components/schemas/owners' + - type: array + items: + $ref: '#/components/schemas/owners' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases/tags: + get: + description: Aggregates and returns a list of case tags. + parameters: + - $ref: '#/components/parameters/space_id' + - in: query + name: owner + description: >- + A filter to limit the retrieved case statistics to a specific set of + applications. If this parameter is omitted, the response contains + tags from all cases that the user has access to read. + schema: + oneOf: + - $ref: '#/components/schemas/owners' + - type: array + items: + $ref: '#/components/schemas/owners' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases/{caseId}: + get: + description: Retrieves a specified case. + parameters: + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/space_id' + - in: query + name: includeComments + description: Determines whether case comments are returned. + deprecated: true + schema: + type: boolean + default: true + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases/{caseId}/comments: + post: + description: Adds a comment to a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/space_id' + requestBody: + content: + application/json: + schema: + type: object + properties: + alertId: + description: >- + The alert identifier. It is required only when `type` is + `alert`. This functionality is in technical preview and may + be changed or removed in a future release. Elastic will + apply best effort to fix any issues, but features in + technical preview are not subject to the support SLA of + official GA features. + type: string + comment: + description: The new comment. It is required only when `type` is `user`. + type: string + index: + description: >- + The alert index. It is required only when `type` is `alert`. + This functionality is in technical preview and may be + changed or removed in a future release. Elastic will apply + best effort to fix any issues, but features in technical + preview are not subject to the support SLA of official GA + features. + type: string + owner: + $ref: '#/components/schemas/owners' + rule: + description: >- + The rule that is associated with the alert. It is required + only when type is alert. This functionality is in technical + preview and may be changed or removed in a future release. + Elastic will apply best effort to fix any issues, but + features in technical preview are not subject to the support + SLA of official GA features. + type: object + properties: + id: + description: The rule identifier. + type: string + name: + description: The rule name. + type: string + type: + $ref: '#/components/schemas/comment_types' + required: + - owner + - type + examples: + '0': + value: | + { + + "type": "user", + + "owner": "cases", + + "comment": "That is nothing - Ethan Hunt answered a targeted + social media campaign promoting phishy pension schemes to IMF + operatives." + + } + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + patch: + description: Updates a comment in a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/space_id' + requestBody: + content: + application/json: + schema: + type: object + properties: + alertId: + description: >- + The alert identifier. It is required only when `type` is + `alert`. This functionality is in technical preview and may + be changed or removed in a future release. Elastic will + apply best effort to fix any issues, but features in + technical preview are not subject to the support SLA of + official GA features. + type: string + comment: + description: The new comment. It is required only when `type` is `user`. + type: string + id: + description: The identifier for the comment. + type: string + index: + description: >- + The alert index. It is required only when `type` is `alert`. + This functionality is in technical preview and may be + changed or removed in a future release. Elastic will apply + best effort to fix any issues, but features in technical + preview are not subject to the support SLA of official GA + features. + type: string + owner: + $ref: '#/components/schemas/owners' + rule: + description: >- + The rule that is associated with the alert. It is required + only when type is alert. This functionality is in technical + preview and may be changed or removed in a future release. + Elastic will apply best effort to fix any issues, but + features in technical preview are not subject to the support + SLA of official GA features. + type: object + properties: + id: + description: The rule identifier. + type: string + name: + description: The rule name. + type: string + type: + $ref: '#/components/schemas/comment_types' + version: + description: The current version of the comment. + type: string + required: + - id + - owner + - type + - version + examples: + '0': + value: |- + { + "id": "c7740680-b5e9-11ec-b141-0fdb20a7f9a9", + "version": "WzI2NiwzXQ==", + "type": "user", + "comment": "Updated comment", + "owner": "cases" + } + '1': + value: | + { + "type": "user", + "owner": "cases", + "comment": "no2." + } + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + delete: + description: Deletes all comments from a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/space_id' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + get: + description: Retrieves all the comments from a case. + deprecated: true + parameters: + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/space_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases/{caseId}/comments/{commentId}: + delete: + description: Deletes a comment from a case. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/comment_id' + responses: + '204': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + get: + description: Retrieves a comment from a case. + parameters: + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/comment_id' + - $ref: '#/components/parameters/space_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases/{caseId}/user_actions: + get: + description: Returns all user activity for the specified case. + deprecated: true + parameters: + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/space_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 components: securitySchemes: basicAuth: type: http - scheme: basics + scheme: basic parameters: + kbn_xsrf: + schema: + type: string + in: header + name: kbn-xsrf + required: true default_search_operator: in: query name: defaultSearchOperator @@ -219,6 +1560,22 @@ components: schema: type: string example: now%2B1d + case_id: + in: path + name: caseId + description: An identifier for the case. + required: true + schema: + type: string + example: a18b38a0-71b0-11ea-a0b2-c51ea50a58e2 + comment_id: + in: path + name: commentId + description: An identifier for the comment. + required: true + schema: + type: string + example: 71ec1870-725b-11ea-a0b2-c51ea50a58e2 space_id: in: path name: spaceId @@ -226,13 +1583,37 @@ components: required: true schema: type: string + example: default schemas: + connector_types: + type: string + description: The type of connector. + enum: + - .jira + - .none + - .resilient + - .servicenow + - .servicenow-sir + - .swimlane owners: type: string - title: Owner apps + description: Owner apps enum: - cases - observability - securitySolution + status: + type: string + description: The status of the case. + enum: + - closed + - in-progress + - open + comment_types: + type: string + description: The type of comment. + enum: + - alert + - user security: - basicAuth: [] diff --git a/x-pack/plugins/cases/common/openapi/paths/README.md b/x-pack/plugins/cases/common/openapi/paths/README.md index 7acd06a6b7db6..b7818c8474fc8 100644 --- a/x-pack/plugins/cases/common/openapi/paths/README.md +++ b/x-pack/plugins/cases/common/openapi/paths/README.md @@ -1,4 +1,10 @@ Paths ===== -Each path definition for which there is a specification exists within this folder. \ No newline at end of file +Each path definition for which there is a specification exists within this folder. + +These files currently use the following conventions: + +* path separator token (e.g. `@`) is included in the file name +* path parameter (e.g. `{example}`) is included in the file name +* there is one file per path; each file can contain multiple operations From 33bceb168001a695b49431f184eba77beb5b2241 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 27 Apr 2022 18:10:10 -0700 Subject: [PATCH 4/9] Adds specs for case alert and configure APIs --- x-pack/plugins/cases/common/openapi/README.md | 2 +- .../plugins/cases/common/openapi/bundled.json | 283 ++++++++++++++++++ .../plugins/cases/common/openapi/bundled.yaml | 197 ++++++++++++ .../components/parameters/alert_id.yaml | 7 + .../cases/common/openapi/entrypoint.yaml | 12 + .../paths/api@cases@alerts@{alertid}.yaml | 28 ++ .../openapi/paths/api@cases@configure.yaml | 27 ++ .../paths/api@cases@{caseid}@alerts.yaml | 19 ++ ...@{spaceid}@api@cases@alerts@{alertid}.yaml | 29 ++ .../s@{spaceid}@api@cases@configure.yaml | 28 ++ ...s@{spaceid}@api@cases@{caseid}@alerts.yaml | 20 ++ 11 files changed, 651 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/alert_id.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@alerts@{alertid}.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@configure.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@alerts.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml diff --git a/x-pack/plugins/cases/common/openapi/README.md b/x-pack/plugins/cases/common/openapi/README.md index 67a3c92d532bb..44c6025cd0898 100644 --- a/x-pack/plugins/cases/common/openapi/README.md +++ b/x-pack/plugins/cases/common/openapi/README.md @@ -17,7 +17,7 @@ It is possible to validate the docs before bundling them with the following command in the `x-pack/plugins/cases/common/openapi/` folder: ``` - npx swagger-cli validate x-pack/plugins/cases/common/openapi/entrypoint.yaml + npx swagger-cli validate entrypoint.yaml ``` Then you can generate the `bundled` files by running the following commands: diff --git a/x-pack/plugins/cases/common/openapi/bundled.json b/x-pack/plugins/cases/common/openapi/bundled.json index 8a56449d536c7..1a93802977806 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.json +++ b/x-pack/plugins/cases/common/openapi/bundled.json @@ -462,6 +462,105 @@ } ] }, + "/api/cases/alerts/{alertId}": { + "get": { + "description": "Returns the cases associated with a specific alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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.\n", + "parameters": [ + { + "$ref": "#/components/parameters/alert_id" + }, + { + "in": "query", + "name": "owner", + "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read.", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/owners" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/owners" + } + } + ] + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/cases/configure": { + "get": { + "description": "Retrieves external connection details, such as the closure type and default connector for cases. 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 case configuration.\n", + "parameters": [ + { + "in": "query", + "name": "owner", + "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read.", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/owners" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/owners" + } + } + ] + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "/api/cases/configure/connectors/_find": { "get": { "description": "Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned.", @@ -630,6 +729,39 @@ } ] }, + "/api/cases/{caseId}/alerts": { + "get": { + "description": "Gets all alerts attached to a case. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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.\n", + "parameters": [ + { + "$ref": "#/components/parameters/case_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "/api/cases/{caseId}/comments": { "post": { "description": "Adds a comment to a case.", @@ -1405,6 +1537,111 @@ } ] }, + "/s/{spaceId}/api/cases/alerts/{alertId}": { + "get": { + "description": "Returns the cases associated with a specific alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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.\n", + "parameters": [ + { + "$ref": "#/components/parameters/alert_id" + }, + { + "$ref": "#/components/parameters/space_id" + }, + { + "in": "query", + "name": "owner", + "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read.", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/owners" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/owners" + } + } + ] + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/configure": { + "get": { + "description": "Retrieves external connection details, such as the closure type and default connector for cases. 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 case configuration.\n", + "parameters": [ + { + "$ref": "#/components/parameters/space_id" + }, + { + "in": "query", + "name": "owner", + "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read.", + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/owners" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/owners" + } + } + ] + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "/s/{spaceId}/api/cases/configure/connectors/_find": { "get": { "description": "Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned.", @@ -1587,6 +1824,42 @@ } ] }, + "/s/{spaceId}/api/cases/{caseId}/alerts": { + "get": { + "description": "Gets all alerts attached to a case. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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.\n", + "parameters": [ + { + "$ref": "#/components/parameters/case_id" + }, + { + "$ref": "#/components/parameters/space_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "/s/{spaceId}/api/cases/{caseId}/comments": { "post": { "description": "Adds a comment to a case.", @@ -2131,6 +2404,16 @@ }, "example": "now%2B1d" }, + "alert_id": { + "in": "path", + "name": "alertId", + "description": "An identifier for the alert.", + "required": true, + "schema": { + "type": "string", + "example": "09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540" + } + }, "case_id": { "in": "path", "name": "caseId", diff --git a/x-pack/plugins/cases/common/openapi/bundled.yaml b/x-pack/plugins/cases/common/openapi/bundled.yaml index ee10e5c179038..0418c29359fd7 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.yaml +++ b/x-pack/plugins/cases/common/openapi/bundled.yaml @@ -361,6 +361,75 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /api/cases/alerts/{alertId}: + get: + description: > + Returns the cases associated with a specific alert. This functionality + is in technical preview and may be changed or removed in a future + release. Elastic will apply best effort to fix any issues, but features + in technical preview are not subject to the support SLA of official GA + features. 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. + parameters: + - $ref: '#/components/parameters/alert_id' + - in: query + name: owner + description: >- + A filter to limit the retrieved case statistics to a specific set of + applications. If this parameter is omitted, the response contains + all cases that the user has access to read. + schema: + oneOf: + - $ref: '#/components/schemas/owners' + - type: array + items: + $ref: '#/components/schemas/owners' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/cases/configure: + get: + description: > + Retrieves external connection details, such as the closure type and + default connector for cases. 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 case configuration. + parameters: + - in: query + name: owner + description: >- + A filter to limit the retrieved case statistics to a specific set of + applications. If this parameter is omitted, the response contains + all cases that the user has access to read. + schema: + oneOf: + - $ref: '#/components/schemas/owners' + - type: array + items: + $ref: '#/components/schemas/owners' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /api/cases/configure/connectors/_find: get: description: >- @@ -459,6 +528,30 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /api/cases/{caseId}/alerts: + get: + description: > + Gets all alerts attached to a case. This functionality is in technical + preview and may be changed or removed in a future release. Elastic will + apply best effort to fix any issues, but features in technical preview + are not subject to the support SLA of official GA features. 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. + parameters: + - $ref: '#/components/parameters/case_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /api/cases/{caseId}/comments: post: description: Adds a comment to a case. @@ -1055,6 +1148,77 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /s/{spaceId}/api/cases/alerts/{alertId}: + get: + description: > + Returns the cases associated with a specific alert. This functionality + is in technical preview and may be changed or removed in a future + release. Elastic will apply best effort to fix any issues, but features + in technical preview are not subject to the support SLA of official GA + features. 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. + parameters: + - $ref: '#/components/parameters/alert_id' + - $ref: '#/components/parameters/space_id' + - in: query + name: owner + description: >- + A filter to limit the retrieved case statistics to a specific set of + applications. If this parameter is omitted, the response contains + all cases that the user has access to read. + schema: + oneOf: + - $ref: '#/components/schemas/owners' + - type: array + items: + $ref: '#/components/schemas/owners' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases/configure: + get: + description: > + Retrieves external connection details, such as the closure type and + default connector for cases. 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 case configuration. + parameters: + - $ref: '#/components/parameters/space_id' + - in: query + name: owner + description: >- + A filter to limit the retrieved case statistics to a specific set of + applications. If this parameter is omitted, the response contains + all cases that the user has access to read. + schema: + oneOf: + - $ref: '#/components/schemas/owners' + - type: array + items: + $ref: '#/components/schemas/owners' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /s/{spaceId}/api/cases/configure/connectors/_find: get: description: >- @@ -1158,6 +1322,31 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /s/{spaceId}/api/cases/{caseId}/alerts: + get: + description: > + Gets all alerts attached to a case. This functionality is in technical + preview and may be changed or removed in a future release. Elastic will + apply best effort to fix any issues, but features in technical preview + are not subject to the support SLA of official GA features. 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. + parameters: + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/space_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/comments: post: description: Adds a comment to a case. @@ -1560,6 +1749,14 @@ components: schema: type: string example: now%2B1d + alert_id: + in: path + name: alertId + description: An identifier for the alert. + required: true + schema: + type: string + example: 09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540 case_id: in: path name: caseId diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/alert_id.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/alert_id.yaml new file mode 100644 index 0000000000000..8677b327b91be --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/alert_id.yaml @@ -0,0 +1,7 @@ +in: path +name: alertId +description: An identifier for the alert. +required: true +schema: + type: string + example: 09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/entrypoint.yaml b/x-pack/plugins/cases/common/openapi/entrypoint.yaml index 87a3d7c4ed84f..b3187e53c53fa 100644 --- a/x-pack/plugins/cases/common/openapi/entrypoint.yaml +++ b/x-pack/plugins/cases/common/openapi/entrypoint.yaml @@ -17,6 +17,10 @@ paths: $ref: paths/api@cases.yaml /api/cases/_find: $ref: paths/api@cases@_find.yaml + '/api/cases/alerts/{alertId}': + $ref: 'paths/api@cases@alerts@{alertid}.yaml' + '/api/cases/configure': + $ref: paths/api@cases@configure.yaml '/api/cases/configure/connectors/_find': $ref: paths/api@cases@configure@connectors@_find.yaml '/api/cases/status': @@ -25,6 +29,8 @@ paths: $ref: 'paths/api@cases@tags.yaml' '/api/cases/{caseId}': $ref: 'paths/api@cases@{caseid}.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}: @@ -36,6 +42,10 @@ paths: $ref: 'paths/s@{spaceid}@api@cases.yaml' '/s/{spaceId}/api/cases/_find': $ref: 'paths/s@{spaceid}@api@cases@_find.yaml' + '/s/{spaceId}/api/cases/alerts/{alertId}': + $ref: 'paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml' + '/s/{spaceId}/api/cases/configure': + $ref: paths/s@{spaceid}@api@cases@configure.yaml '/s/{spaceId}/api/cases/configure/connectors/_find': $ref: paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml '/s/{spaceId}/api/cases/status': @@ -44,6 +54,8 @@ paths: $ref: 'paths/s@{spaceid}@api@cases@tags.yaml' '/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}/comments': $ref: 'paths/s@{spaceid}@api@cases@{caseid}@comments.yaml' '/s/{spaceId}/api/cases/{caseId}/comments/{commentId}': diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@alerts@{alertid}.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@alerts@{alertid}.yaml new file mode 100644 index 0000000000000..5a82328460edc --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@alerts@{alertid}.yaml @@ -0,0 +1,28 @@ +get: + description: > + Returns the cases associated with a specific alert. + This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + 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. + parameters: + - $ref: ../components/parameters/alert_id.yaml + - in: query + name: owner + description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read. + schema: + oneOf: + - $ref: '../components/schemas/owners.yaml' + - type: array + items: + $ref: '../components/schemas/owners.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@configure.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure.yaml new file mode 100644 index 0000000000000..85440b5f6e4a9 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure.yaml @@ -0,0 +1,27 @@ +get: + description: > + Retrieves external connection details, such as the closure type and default connector for cases. + 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 case configuration. + parameters: + - in: query + name: owner + description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read. + schema: + oneOf: + - $ref: '../components/schemas/owners.yaml' + - type: array + items: + $ref: '../components/schemas/owners.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@alerts.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@alerts.yaml new file mode 100644 index 0000000000000..bb26c63ddc52d --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@alerts.yaml @@ -0,0 +1,19 @@ +get: + description: > + Gets all alerts attached to a case. + This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + 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. + parameters: + - $ref: ../components/parameters/case_id.yaml + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml new file mode 100644 index 0000000000000..5e0491174ab68 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml @@ -0,0 +1,29 @@ +get: + description: > + Returns the cases associated with a specific alert. + This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + 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. + parameters: + - $ref: ../components/parameters/alert_id.yaml + - $ref: '../components/parameters/space_id.yaml' + - in: query + name: owner + description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read. + schema: + oneOf: + - $ref: '../components/schemas/owners.yaml' + - type: array + items: + $ref: '../components/schemas/owners.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure.yaml new file mode 100644 index 0000000000000..064f92998ba2a --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure.yaml @@ -0,0 +1,28 @@ +get: + description: > + Retrieves external connection details, such as the closure type and default connector for cases. + 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 case configuration. + parameters: + - $ref: '../components/parameters/space_id.yaml' + - in: query + name: owner + description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read. + schema: + oneOf: + - $ref: '../components/schemas/owners.yaml' + - type: array + items: + $ref: '../components/schemas/owners.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml new file mode 100644 index 0000000000000..725108cb32590 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml @@ -0,0 +1,20 @@ +get: + description: > + Gets all alerts attached to a case. + This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + 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. + 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: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 \ No newline at end of file From a732d548fa4ecf9f5cd2495dc69a8639710e86ad Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 28 Apr 2022 10:03:38 -0700 Subject: [PATCH 5/9] [DOCS] Adds x-technical-preview property --- .../plugins/cases/common/openapi/bundled.json | 12 +++-- .../plugins/cases/common/openapi/bundled.yaml | 48 ++++++++----------- .../paths/api@cases@alerts@{alertid}.yaml | 2 +- .../paths/api@cases@{caseid}@alerts.yaml | 2 +- ...@{spaceid}@api@cases@alerts@{alertid}.yaml | 2 +- ...s@{spaceid}@api@cases@{caseid}@alerts.yaml | 2 +- 6 files changed, 32 insertions(+), 36 deletions(-) diff --git a/x-pack/plugins/cases/common/openapi/bundled.json b/x-pack/plugins/cases/common/openapi/bundled.json index 1a93802977806..6fb7b567d156d 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.json +++ b/x-pack/plugins/cases/common/openapi/bundled.json @@ -464,7 +464,8 @@ }, "/api/cases/alerts/{alertId}": { "get": { - "description": "Returns the cases associated with a specific alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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.\n", + "description": "Returns the cases associated with a specific alert. 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.\n", + "x-technical-preview": true, "parameters": [ { "$ref": "#/components/parameters/alert_id" @@ -731,7 +732,8 @@ }, "/api/cases/{caseId}/alerts": { "get": { - "description": "Gets all alerts attached to a case. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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.\n", + "description": "Gets all alerts attached to a case. 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.\n", + "x-technical-preview": true, "parameters": [ { "$ref": "#/components/parameters/case_id" @@ -1539,7 +1541,8 @@ }, "/s/{spaceId}/api/cases/alerts/{alertId}": { "get": { - "description": "Returns the cases associated with a specific alert. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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.\n", + "description": "Returns the cases associated with a specific alert. 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.\n", + "x-technical-preview": true, "parameters": [ { "$ref": "#/components/parameters/alert_id" @@ -1826,7 +1829,8 @@ }, "/s/{spaceId}/api/cases/{caseId}/alerts": { "get": { - "description": "Gets all alerts attached to a case. This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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.\n", + "description": "Gets all alerts attached to a case. 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.\n", + "x-technical-preview": true, "parameters": [ { "$ref": "#/components/parameters/case_id" diff --git a/x-pack/plugins/cases/common/openapi/bundled.yaml b/x-pack/plugins/cases/common/openapi/bundled.yaml index 0418c29359fd7..f1bc4c78bf8cc 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.yaml +++ b/x-pack/plugins/cases/common/openapi/bundled.yaml @@ -364,13 +364,11 @@ paths: /api/cases/alerts/{alertId}: get: description: > - Returns the cases associated with a specific alert. This functionality - is in technical preview and may be changed or removed in a future - release. Elastic will apply best effort to fix any issues, but features - in technical preview are not subject to the support SLA of official GA - features. 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. + Returns the cases associated with a specific alert. 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 parameters: - $ref: '#/components/parameters/alert_id' - in: query @@ -531,13 +529,11 @@ paths: /api/cases/{caseId}/alerts: get: description: > - Gets all alerts attached to a case. This functionality is in technical - preview and may be changed or removed in a future release. Elastic will - apply best effort to fix any issues, but features in technical preview - are not subject to the support SLA of official GA features. 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. + Gets all alerts attached to a case. 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 parameters: - $ref: '#/components/parameters/case_id' responses: @@ -1151,13 +1147,11 @@ paths: /s/{spaceId}/api/cases/alerts/{alertId}: get: description: > - Returns the cases associated with a specific alert. This functionality - is in technical preview and may be changed or removed in a future - release. Elastic will apply best effort to fix any issues, but features - in technical preview are not subject to the support SLA of official GA - features. 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. + Returns the cases associated with a specific alert. 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 parameters: - $ref: '#/components/parameters/alert_id' - $ref: '#/components/parameters/space_id' @@ -1325,13 +1319,11 @@ paths: /s/{spaceId}/api/cases/{caseId}/alerts: get: description: > - Gets all alerts attached to a case. This functionality is in technical - preview and may be changed or removed in a future release. Elastic will - apply best effort to fix any issues, but features in technical preview - are not subject to the support SLA of official GA features. 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. + Gets all alerts attached to a case. 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 parameters: - $ref: '#/components/parameters/case_id' - $ref: '#/components/parameters/space_id' diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@alerts@{alertid}.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@alerts@{alertid}.yaml index 5a82328460edc..a00ac1e3aa044 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@alerts@{alertid}.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@alerts@{alertid}.yaml @@ -1,8 +1,8 @@ get: description: > Returns the cases associated with a specific alert. - This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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 parameters: - $ref: ../components/parameters/alert_id.yaml - in: query diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@alerts.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@alerts.yaml index bb26c63ddc52d..2a2972362f733 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@alerts.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@alerts.yaml @@ -1,8 +1,8 @@ get: description: > Gets all alerts attached to a case. - This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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 parameters: - $ref: ../components/parameters/case_id.yaml responses: diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml index 5e0491174ab68..7c3190cfb781d 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml @@ -1,8 +1,8 @@ get: description: > Returns the cases associated with a specific alert. - This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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 parameters: - $ref: ../components/parameters/alert_id.yaml - $ref: '../components/parameters/space_id.yaml' diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml index 725108cb32590..807c8df1df03d 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml @@ -1,8 +1,8 @@ get: description: > Gets all alerts attached to a case. - This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. 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 parameters: - $ref: ../components/parameters/case_id.yaml - $ref: '../components/parameters/space_id.yaml' From fa96fe2b14978438d4a19aa97ed7a9a62adcb1b7 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 28 Apr 2022 15:49:53 -0700 Subject: [PATCH 6/9] [DOCS] Add set case configureation API --- .../plugins/cases/common/openapi/bundled.json | 396 +++++++++++++++++- .../plugins/cases/common/openapi/bundled.yaml | 350 +++++++++++++++- .../parameters/configuration_id.yaml | 7 + .../components/schemas/closure_types.yaml | 5 + .../cases/common/openapi/entrypoint.yaml | 4 + .../cases/common/openapi/paths/api@cases.yaml | 4 +- .../openapi/paths/api@cases@configure.yaml | 68 +++ ...api@cases@configure@{configurationid}.yaml | 60 +++ .../paths/api@cases@{caseid}@comments.yaml | 4 +- .../openapi/paths/s@{spaceid}@api@cases.yaml | 4 +- .../s@{spaceid}@api@cases@configure.yaml | 69 +++ ...api@cases@configure@{configurationid}.yaml | 61 +++ ...{spaceid}@api@cases@{caseid}@comments.yaml | 7 +- 13 files changed, 1024 insertions(+), 15 deletions(-) create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/configuration_id.yaml create mode 100644 x-pack/plugins/cases/common/openapi/components/schemas/closure_types.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@configure@{configurationid}.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml diff --git a/x-pack/plugins/cases/common/openapi/bundled.json b/x-pack/plugins/cases/common/openapi/bundled.json index 6fb7b567d156d..80f08eaa07f66 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.json +++ b/x-pack/plugins/cases/common/openapi/bundled.json @@ -215,7 +215,7 @@ ] }, "patch": { - "description": "Updates one or more cases.", + "description": "Updates one or more cases. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -556,6 +556,187 @@ } ] }, + "post": { + "description": "Sets external connection details, such as the closure type and default connector for cases. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details.\n", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "closure_type": { + "$ref": "#/components/schemas/closure_types" + }, + "connector": { + "description": "An object that contains the connector configuration.", + "type": "object", + "properties": { + "fields": { + "description": "An object that contains the connector fields. TIP: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to null.\n", + "type": "object", + "additionalProperties": true, + "example": null + }, + "id": { + "description": "The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API.", + "type": "string", + "example": "none" + }, + "name": { + "description": "The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API.", + "type": "string", + "example": "none" + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + }, + "required": [ + "fields", + "id", + "name", + "type" + ] + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "settings": { + "description": "An object that contains the case settings.", + "type": "object", + "properties": { + "syncAlerts": { + "description": "Turns alert syncing on or off.", + "type": "boolean" + } + }, + "required": [ + "syncAlerts" + ] + } + }, + "required": [ + "closure_type", + "connector", + "owner" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/cases/configure/{configurationId}": { + "patch": { + "description": "Updates external connection details, such as the closure type and default connector for cases. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can it in your cases. Refer to the add connectors API.\n", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/configuration_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "closure_type": { + "$ref": "#/components/schemas/closure_types" + }, + "connector": { + "description": "An object that contains the connector configuration.", + "type": "object", + "properties": { + "fields": { + "description": "An object that contains the connector fields. TIP: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to null.\n", + "type": "object", + "additionalProperties": true, + "example": null + }, + "id": { + "description": "The identifier for the connector. To To retrieve connector IDs, use the find connectors API.", + "type": "string", + "example": "none" + }, + "name": { + "description": "The name of the connector.", + "type": "string", + "example": "none" + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + }, + "required": [ + "fields", + "id", + "name", + "type" + ] + }, + "version": { + "description": "The version of the connector. To retrieve the version value, use the get configuration API.", + "type": "string", + "example": "WzIwMiwxXQ==" + } + }, + "required": [ + "version" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "servers": [ { "url": "https://localhost:5601" @@ -847,7 +1028,7 @@ ] }, "patch": { - "description": "Updates a comment in a case.", + "description": "Updates a comment in a case. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -1286,7 +1467,7 @@ ] }, "patch": { - "description": "Updates one or more cases.", + "description": "Updates one or more cases. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -1639,6 +1820,193 @@ } ] }, + "post": { + "description": "Sets external connection details, such as the closure type and default connector for cases. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details.\n", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/space_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "closure_type": { + "$ref": "#/components/schemas/closure_types" + }, + "connector": { + "description": "An object that contains the connector configuration.", + "type": "object", + "properties": { + "fields": { + "description": "An object that contains the connector fields. TIP: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to null.\n", + "type": "object", + "additionalProperties": true, + "example": null + }, + "id": { + "description": "The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API.", + "type": "string", + "example": "none" + }, + "name": { + "description": "The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API.", + "type": "string", + "example": "none" + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + }, + "required": [ + "fields", + "id", + "name", + "type" + ] + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "settings": { + "description": "An object that contains the case settings.", + "type": "object", + "properties": { + "syncAlerts": { + "description": "Turns alert syncing on or off.", + "type": "boolean" + } + }, + "required": [ + "syncAlerts" + ] + } + }, + "required": [ + "closure_type", + "connector", + "owner" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/s/{spaceId}/api/cases/configure/{configurationId}": { + "patch": { + "description": "Updates external connection details, such as the closure type and default connector for cases. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can it in your cases. Refer to the add connectors API.\n", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/configuration_id" + }, + { + "$ref": "#/components/parameters/space_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "closure_type": { + "$ref": "#/components/schemas/closure_types" + }, + "connector": { + "description": "An object that contains the connector configuration.", + "type": "object", + "properties": { + "fields": { + "description": "An object that contains the connector fields. TIP: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to null.\n", + "type": "object", + "additionalProperties": true, + "example": null + }, + "id": { + "description": "The identifier for the connector. To To retrieve connector IDs, use the find connectors API.", + "type": "string", + "example": "none" + }, + "name": { + "description": "The name of the connector.", + "type": "string", + "example": "none" + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + }, + "required": [ + "fields", + "id", + "name", + "type" + ] + }, + "version": { + "description": "The version of the connector. To retrieve the version value, use the get configuration API.", + "type": "string", + "example": "WzIwMiwxXQ==" + } + }, + "required": [ + "version" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + }, + "examples": {} + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "servers": [ { "url": "https://localhost:5601" @@ -1950,7 +2318,7 @@ ] }, "patch": { - "description": "Updates a comment in a case.", + "description": "Updates a comment in a case. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -2068,7 +2436,7 @@ ] }, "get": { - "description": "Retrieves all the comments from a case.", + "description": "Retrieves all the comments from a case.\n", "deprecated": true, "parameters": [ { @@ -2418,6 +2786,16 @@ "example": "09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540" } }, + "configuration_id": { + "in": "path", + "name": "configurationId", + "description": "An identifier for the configuration.", + "required": true, + "schema": { + "type": "string", + "example": "3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9" + } + }, "case_id": { "in": "path", "name": "caseId", @@ -2480,6 +2858,14 @@ "open" ] }, + "closure_types": { + "type": "string", + "description": "Indicates whether a case is automatically closed when it is pushed to external systems (`close-by-pushing`) or not automatically closed (`close-by-user`).", + "enum": [ + "close-by-pushing", + "close-by-user" + ] + }, "comment_types": { "type": "string", "description": "The type of comment.", diff --git a/x-pack/plugins/cases/common/openapi/bundled.yaml b/x-pack/plugins/cases/common/openapi/bundled.yaml index f1bc4c78bf8cc..eae8a3a85c230 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.yaml +++ b/x-pack/plugins/cases/common/openapi/bundled.yaml @@ -181,7 +181,11 @@ paths: servers: - url: https://localhost:5601 patch: - description: Updates one or more cases. + description: > + Updates one or more cases. You must have all privileges for the + **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on the + owner of the case you're updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' requestBody: @@ -426,6 +430,158 @@ paths: examples: {} servers: - url: https://localhost:5601 + post: + description: > + Sets external connection details, such as the closure type and default + connector for cases. You must have all privileges for the **Cases** + feature in the **Management**, **Observability**, or **Security** + section of the Kibana feature privileges, depending on the owner of the + case configuration. Connectors are used to interface with external + systems. You must create a connector before you can use it in your + cases. Refer to the add connectors API. If you set a default connector, + it is automatically selected when you create cases in Kibana. If you use + the create case API, however, you must still specify all of the + connector details. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + content: + application/json: + schema: + type: object + properties: + closure_type: + $ref: '#/components/schemas/closure_types' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: > + An object that contains the connector fields. TIP: The + fields specified in the case configuration are not used + and are not propagated to individual cases, therefore it + is recommended to set it to null. + type: object + additionalProperties: true + example: null + id: + description: >- + The identifier for the connector. If you do not want a + default connector, use `none`. To retrieve connector + IDs, use the find connectors API. + type: string + example: none + name: + description: >- + The name of the connector. If you do not want a default + connector, use `none`. To retrieve connector names, use + the find connectors API. + type: string + example: none + type: + $ref: '#/components/schemas/connector_types' + required: + - fields + - id + - name + - type + owner: + $ref: '#/components/schemas/owners' + settings: + description: An object that contains the case settings. + type: object + properties: + syncAlerts: + description: Turns alert syncing on or off. + type: boolean + required: + - syncAlerts + required: + - closure_type + - connector + - owner + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/cases/configure/{configurationId}: + patch: + description: > + Updates external connection details, such as the closure type and + default connector for cases. You must have all privileges for the + **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on the + owner of the case configuration. Connectors are used to interface with + external systems. You must create a connector before you can it in your + cases. Refer to the add connectors API. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/configuration_id' + requestBody: + content: + application/json: + schema: + type: object + properties: + closure_type: + $ref: '#/components/schemas/closure_types' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: > + An object that contains the connector fields. TIP: The + fields specified in the case configuration are not used + and are not propagated to individual cases, therefore it + is recommended to set it to null. + type: object + additionalProperties: true + example: null + id: + description: >- + The identifier for the connector. To To retrieve + connector IDs, use the find connectors API. + type: string + example: none + name: + description: The name of the connector. + type: string + example: none + type: + $ref: '#/components/schemas/connector_types' + required: + - fields + - id + - name + - type + version: + description: >- + The version of the connector. To retrieve the version value, + use the get configuration API. + type: string + example: WzIwMiwxXQ== + required: + - version + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 servers: - url: https://localhost:5601 /api/cases/configure/connectors/_find: @@ -629,7 +785,11 @@ paths: servers: - url: https://localhost:5601 patch: - description: Updates a comment in a case. + description: > + Updates a comment in a case. You must have all privileges for the + **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on the + owner of the case you're updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/case_id' @@ -962,7 +1122,11 @@ paths: servers: - url: https://localhost:5601 patch: - description: Updates one or more cases. + description: > + Updates one or more cases. You must have all privileges for the + **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on the + owner of the case you're updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/space_id' @@ -1211,6 +1375,160 @@ paths: examples: {} servers: - url: https://localhost:5601 + post: + description: > + Sets external connection details, such as the closure type and default + connector for cases. You must have all privileges for the **Cases** + feature in the **Management**, **Observability**, or **Security** + section of the Kibana feature privileges, depending on the owner of the + case configuration. Connectors are used to interface with external + systems. You must create a connector before you can use it in your + cases. Refer to the add connectors API. If you set a default connector, + it is automatically selected when you create cases in Kibana. If you use + the create case API, however, you must still specify all of the + connector details. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' + requestBody: + content: + application/json: + schema: + type: object + properties: + closure_type: + $ref: '#/components/schemas/closure_types' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: > + An object that contains the connector fields. TIP: The + fields specified in the case configuration are not used + and are not propagated to individual cases, therefore it + is recommended to set it to null. + type: object + additionalProperties: true + example: null + id: + description: >- + The identifier for the connector. If you do not want a + default connector, use `none`. To retrieve connector + IDs, use the find connectors API. + type: string + example: none + name: + description: >- + The name of the connector. If you do not want a default + connector, use `none`. To retrieve connector names, use + the find connectors API. + type: string + example: none + type: + $ref: '#/components/schemas/connector_types' + required: + - fields + - id + - name + - type + owner: + $ref: '#/components/schemas/owners' + settings: + description: An object that contains the case settings. + type: object + properties: + syncAlerts: + description: Turns alert syncing on or off. + type: boolean + required: + - syncAlerts + required: + - closure_type + - connector + - owner + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /s/{spaceId}/api/cases/configure/{configurationId}: + patch: + description: > + Updates external connection details, such as the closure type and + default connector for cases. You must have all privileges for the + **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on the + owner of the case configuration. Connectors are used to interface with + external systems. You must create a connector before you can it in your + cases. Refer to the add connectors API. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/configuration_id' + - $ref: '#/components/parameters/space_id' + requestBody: + content: + application/json: + schema: + type: object + properties: + closure_type: + $ref: '#/components/schemas/closure_types' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: > + An object that contains the connector fields. TIP: The + fields specified in the case configuration are not used + and are not propagated to individual cases, therefore it + is recommended to set it to null. + type: object + additionalProperties: true + example: null + id: + description: >- + The identifier for the connector. To To retrieve + connector IDs, use the find connectors API. + type: string + example: none + name: + description: The name of the connector. + type: string + example: none + type: + $ref: '#/components/schemas/connector_types' + required: + - fields + - id + - name + - type + version: + description: >- + The version of the connector. To retrieve the version value, + use the get configuration API. + type: string + example: WzIwMiwxXQ== + required: + - version + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 servers: - url: https://localhost:5601 /s/{spaceId}/api/cases/configure/connectors/_find: @@ -1421,7 +1739,11 @@ paths: servers: - url: https://localhost:5601 patch: - description: Updates a comment in a case. + description: > + Updates a comment in a case. You must have all privileges for the + **Cases** feature in the **Management**, **Observability**, or + **Security** section of the Kibana feature privileges, depending on the + owner of the case you're updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/case_id' @@ -1523,7 +1845,8 @@ paths: servers: - url: https://localhost:5601 get: - description: Retrieves all the comments from a case. + description: | + Retrieves all the comments from a case. deprecated: true parameters: - $ref: '#/components/parameters/case_id' @@ -1749,6 +2072,14 @@ components: schema: type: string example: 09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540 + configuration_id: + in: path + name: configurationId + description: An identifier for the configuration. + required: true + schema: + type: string + example: 3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9 case_id: in: path name: caseId @@ -1798,6 +2129,15 @@ components: - closed - in-progress - open + closure_types: + type: string + description: >- + Indicates whether a case is automatically closed when it is pushed to + external systems (`close-by-pushing`) or not automatically closed + (`close-by-user`). + enum: + - close-by-pushing + - close-by-user comment_types: type: string description: The type of comment. diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/configuration_id.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/configuration_id.yaml new file mode 100644 index 0000000000000..65cce12afaa92 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/configuration_id.yaml @@ -0,0 +1,7 @@ +in: path +name: configurationId +description: An identifier for the configuration. +required: true +schema: + type: string + example: 3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/schemas/closure_types.yaml b/x-pack/plugins/cases/common/openapi/components/schemas/closure_types.yaml new file mode 100644 index 0000000000000..f09063d0db18f --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/schemas/closure_types.yaml @@ -0,0 +1,5 @@ +type: string +description: Indicates whether a case is automatically closed when it is pushed to external systems (`close-by-pushing`) or not automatically closed (`close-by-user`). +enum: + - close-by-pushing + - close-by-user \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/entrypoint.yaml b/x-pack/plugins/cases/common/openapi/entrypoint.yaml index b3187e53c53fa..7513bcd5ee65c 100644 --- a/x-pack/plugins/cases/common/openapi/entrypoint.yaml +++ b/x-pack/plugins/cases/common/openapi/entrypoint.yaml @@ -21,6 +21,8 @@ paths: $ref: 'paths/api@cases@alerts@{alertid}.yaml' '/api/cases/configure': $ref: paths/api@cases@configure.yaml + '/api/cases/configure/{configurationId}': + $ref: paths/api@cases@configure@{configurationid}.yaml '/api/cases/configure/connectors/_find': $ref: paths/api@cases@configure@connectors@_find.yaml '/api/cases/status': @@ -46,6 +48,8 @@ paths: $ref: 'paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml' '/s/{spaceId}/api/cases/configure': $ref: paths/s@{spaceid}@api@cases@configure.yaml + '/s/{spaceId}/api/cases/configure/{configurationId}': + $ref: paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml '/s/{spaceId}/api/cases/configure/connectors/_find': $ref: paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml '/s/{spaceId}/api/cases/status': diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml index 174d5ca9c6197..126a1572a0ecd 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml @@ -68,7 +68,9 @@ delete: - url: https://localhost:5601 patch: - description: Updates one or more cases. + description: > + Updates one or more cases. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml requestBody: diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@configure.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure.yaml index 85440b5f6e4a9..9f5a0fea22c2f 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@configure.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure.yaml @@ -23,5 +23,73 @@ get: servers: - url: https://localhost:5601 +post: + description: > + Sets external connection details, such as the closure type and default connector for cases. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. + Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. + If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: + closure_type: + $ref: '../components/schemas/closure_types.yaml' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: > + An object that contains the connector fields. + TIP: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to null. + type: object + additionalProperties: true + example: null + id: + description: The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API. + type: string + example: "none" + name: + description: The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API. + type: string + example: "none" + type: + $ref: '../components/schemas/connector_types.yaml' + required: + - fields + - id + - name + - type + owner: + $ref: '../components/schemas/owners.yaml' + settings: + description: An object that contains the case settings. + type: object + properties: + syncAlerts: + description: Turns alert syncing on or off. + type: boolean + required: + - syncAlerts + required: + - closure_type + - connector + - owner + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@{configurationid}.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@{configurationid}.yaml new file mode 100644 index 0000000000000..3d8c31e643228 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@{configurationid}.yaml @@ -0,0 +1,60 @@ +patch: + description: > + Updates external connection details, such as the closure type and default connector for cases. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. + Connectors are used to interface with external systems. You must create a connector before you can it in your cases. Refer to the add connectors API. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/configuration_id.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: + closure_type: + $ref: '../components/schemas/closure_types.yaml' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: > + An object that contains the connector fields. + TIP: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to null. + type: object + additionalProperties: true + example: null + id: + description: The identifier for the connector. To To retrieve connector IDs, use the find connectors API. + type: string + example: "none" + name: + description: The name of the connector. + type: string + example: "none" + type: + $ref: '../components/schemas/connector_types.yaml' + required: + - fields + - id + - name + - type + version: + description: The version of the connector. To retrieve the version value, use the get configuration API. + type: string + example: "WzIwMiwxXQ==" + required: + - version + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml index 9baefd92f8580..28551aa1e246a 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml @@ -61,7 +61,9 @@ post: - url: https://localhost:5601 patch: - description: Updates a comment in a case. + description: > + Updates a comment in a case. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: ../components/parameters/case_id.yaml diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml index 909aa39ba5c83..384100bbdbde4 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml @@ -70,7 +70,9 @@ delete: - url: https://localhost:5601 patch: - description: Updates one or more cases. + description: > + Updates one or more cases. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: '../components/parameters/space_id.yaml' diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure.yaml index 064f92998ba2a..e399b2e49f0e3 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure.yaml @@ -24,5 +24,74 @@ get: servers: - url: https://localhost:5601 +post: + description: > + Sets external connection details, such as the closure type and default connector for cases. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. + Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. + If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: '../components/parameters/space_id.yaml' + requestBody: + content: + application/json: + schema: + type: object + properties: + closure_type: + $ref: '../components/schemas/closure_types.yaml' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: > + An object that contains the connector fields. + TIP: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to null. + type: object + additionalProperties: true + example: null + id: + description: The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API. + type: string + example: "none" + name: + description: The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API. + type: string + example: "none" + type: + $ref: '../components/schemas/connector_types.yaml' + required: + - fields + - id + - name + - type + owner: + $ref: '../components/schemas/owners.yaml' + settings: + description: An object that contains the case settings. + type: object + properties: + syncAlerts: + description: Turns alert syncing on or off. + type: boolean + required: + - syncAlerts + required: + - closure_type + - connector + - owner + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml new file mode 100644 index 0000000000000..494811a229690 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml @@ -0,0 +1,61 @@ +patch: + description: > + Updates external connection details, such as the closure type and default connector for cases. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. + Connectors are used to interface with external systems. You must create a connector before you can it in your cases. Refer to the add connectors API. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/configuration_id.yaml + - $ref: '../components/parameters/space_id.yaml' + requestBody: + content: + application/json: + schema: + type: object + properties: + closure_type: + $ref: '../components/schemas/closure_types.yaml' + connector: + description: An object that contains the connector configuration. + type: object + properties: + fields: + description: > + An object that contains the connector fields. + TIP: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to null. + type: object + additionalProperties: true + example: null + id: + description: The identifier for the connector. To To retrieve connector IDs, use the find connectors API. + type: string + example: "none" + name: + description: The name of the connector. + type: string + example: "none" + type: + $ref: '../components/schemas/connector_types.yaml' + required: + - fields + - id + - name + - type + version: + description: The version of the connector. To retrieve the version value, use the get configuration API. + type: string + example: "WzIwMiwxXQ==" + required: + - version + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml index d8160317a754c..e4078563b7d6e 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml @@ -62,7 +62,9 @@ post: - url: https://localhost:5601 patch: - description: Updates a comment in a case. + description: > + Updates a comment in a case. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: ../components/parameters/case_id.yaml @@ -148,7 +150,8 @@ delete: - url: https://localhost:5601 get: - description: Retrieves all the comments from a case. + description: > + Retrieves all the comments from a case. deprecated: true parameters: - $ref: '../components/parameters/case_id.yaml' From 2f5d784458be131f1fb33d4b3c22be3739013ae1 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 28 Apr 2022 16:36:52 -0700 Subject: [PATCH 7/9] Add push and get reporters APIs --- .../plugins/cases/common/openapi/bundled.json | 150 +++++++++++++++++- .../plugins/cases/common/openapi/bundled.yaml | 113 ++++++++++++- .../components/parameters/connector_id.yaml | 7 + .../openapi/components/parameters/owner.yaml | 2 +- .../cases/common/openapi/entrypoint.yaml | 10 +- .../openapi/paths/api@cases@reporters.yaml | 18 +++ .../common/openapi/paths/api@cases@tags.yaml | 4 +- ...caseid}@connector@{connectorid}@_push.yaml | 15 ++ .../s@{spaceid}@api@cases@reporters.yaml | 19 +++ .../paths/s@{spaceid}@api@cases@tags.yaml | 4 +- ...caseid}@connector@{connectorid}@_push.yaml | 16 ++ 11 files changed, 345 insertions(+), 13 deletions(-) create mode 100644 x-pack/plugins/cases/common/openapi/components/parameters/connector_id.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@reporters.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@connector@{connectorid}@_push.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@reporters.yaml create mode 100644 x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@connector@{connectorid}@_push.yaml diff --git a/x-pack/plugins/cases/common/openapi/bundled.json b/x-pack/plugins/cases/common/openapi/bundled.json index 80f08eaa07f66..3e2a9f7cfb80c 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.json +++ b/x-pack/plugins/cases/common/openapi/bundled.json @@ -771,6 +771,39 @@ } ] }, + "/api/cases/reporters": { + "get": { + "description": "Returns information about the users who opened cases. 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.\n", + "parameters": [ + { + "$ref": "#/components/parameters/owner" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "/api/cases/status": { "get": { "description": "Returns the number of cases that are open, closed, and in progress.", @@ -822,7 +855,7 @@ }, "/api/cases/tags": { "get": { - "description": "Aggregates and returns a list of case tags.", + "description": "Aggregates and returns a list of case tags. 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.\n", "parameters": [ { "in": "query", @@ -1232,6 +1265,37 @@ } ] }, + "/api/cases/{caseId}/connector/{connectorId}/_push": { + "post": { + "description": "Pushes a case to an external service. You must have all privileges for the **Actions and Connectors** feature in the ***Management*** section of the Kibana feature privileges. You must also have all privileges for the **Cases*** feature in the **Management**, ***Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're pushing.\n", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/case_id" + }, + { + "$ref": "#/components/parameters/connector_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "/api/cases/{caseId}/user_actions": { "get": { "description": "Returns all user activity for the specified case.", @@ -2046,6 +2110,42 @@ } ] }, + "/s/{spaceId}/api/cases/reporters": { + "get": { + "description": "Returns information about the users who opened cases. 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.\n", + "parameters": [ + { + "$ref": "#/components/parameters/space_id" + }, + { + "$ref": "#/components/parameters/owner" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json; charset=utf-8": { + "schema": { + "type": "string" + } + }, + "examples": {} + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "/s/{spaceId}/api/cases/status": { "get": { "description": "Returns the number of cases that are open, closed, and in progress.", @@ -2100,7 +2200,7 @@ }, "/s/{spaceId}/api/cases/tags": { "get": { - "description": "Aggregates and returns a list of case tags.", + "description": "Aggregates and returns a list of case tags. 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.\n", "parameters": [ { "$ref": "#/components/parameters/space_id" @@ -2537,6 +2637,40 @@ } ] }, + "/s/{spaceId}/api/cases/{caseId}/connector/{connectorId}/_push": { + "post": { + "description": "Pushes a case to an external service. You must have all privileges for the **Actions and Connectors** feature in the ***Management*** section of the Kibana feature privileges. You must also have all privileges for the **Cases*** feature in the **Management**, ***Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're pushing.\n", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/case_id" + }, + { + "$ref": "#/components/parameters/connector_id" + }, + { + "$ref": "#/components/parameters/space_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, "/s/{spaceId}/api/cases/{caseId}/user_actions": { "get": { "description": "Returns all user activity for the specified case.", @@ -2624,7 +2758,7 @@ "owner": { "in": "query", "name": "owner", - "description": "A filter to limit the retrieved cases to a specific set of applications. Valid values are:cases, observability, and securitySolution. If this parameter is omitted, the response contains all cases that the user has access to read.", + "description": "A filter to limit the response to a specific set of applications. If this parameter is omitted, the response contains information about all the cases that the user has access to read.", "schema": { "oneOf": [ { @@ -2816,6 +2950,16 @@ "example": "71ec1870-725b-11ea-a0b2-c51ea50a58e2" } }, + "connector_id": { + "in": "path", + "name": "connectorId", + "description": "An identifier for the connector. To retrieve connector IDs, use the find connectors API.", + "required": true, + "schema": { + "type": "string", + "example": "abed3a70-71bd-11ea-a0b2-c51ea50a58e2" + } + }, "space_id": { "in": "path", "name": "spaceId", diff --git a/x-pack/plugins/cases/common/openapi/bundled.yaml b/x-pack/plugins/cases/common/openapi/bundled.yaml index eae8a3a85c230..2a42e422cdfaf 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.yaml +++ b/x-pack/plugins/cases/common/openapi/bundled.yaml @@ -601,6 +601,27 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /api/cases/reporters: + get: + description: > + Returns information about the users who opened cases. 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. + parameters: + - $ref: '#/components/parameters/owner' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /api/cases/status: get: description: Returns the number of cases that are open, closed, and in progress. @@ -632,7 +653,11 @@ paths: - url: https://localhost:5601 /api/cases/tags: get: - description: Aggregates and returns a list of case tags. + description: > + Aggregates and returns a list of case tags. 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. parameters: - in: query name: owner @@ -934,6 +959,26 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /api/cases/{caseId}/connector/{connectorId}/_push: + post: + description: > + Pushes a case to an external service. You must have all privileges for + the **Actions and Connectors** feature in the ***Management*** section + of the Kibana feature privileges. You must also have all privileges for + the **Cases*** feature in the **Management**, ***Observability**, or + **Security** section of the Kibana feature privileges, depending on the + owner of the case you're pushing. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/connector_id' + responses: + '200': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /api/cases/{caseId}/user_actions: get: description: Returns all user activity for the specified case. @@ -1550,6 +1595,28 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /s/{spaceId}/api/cases/reporters: + get: + description: > + Returns information about the users who opened cases. 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. + parameters: + - $ref: '#/components/parameters/space_id' + - $ref: '#/components/parameters/owner' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /s/{spaceId}/api/cases/status: get: description: Returns the number of cases that are open, closed, and in progress. @@ -1582,7 +1649,11 @@ paths: - url: https://localhost:5601 /s/{spaceId}/api/cases/tags: get: - description: Aggregates and returns a list of case tags. + description: > + Aggregates and returns a list of case tags. 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. parameters: - $ref: '#/components/parameters/space_id' - in: query @@ -1894,6 +1965,27 @@ paths: - url: https://localhost:5601 servers: - url: https://localhost:5601 + /s/{spaceId}/api/cases/{caseId}/connector/{connectorId}/_push: + post: + description: > + Pushes a case to an external service. You must have all privileges for + the **Actions and Connectors** feature in the ***Management*** section + of the Kibana feature privileges. You must also have all privileges for + the **Cases*** feature in the **Management**, ***Observability**, or + **Security** section of the Kibana feature privileges, depending on the + owner of the case you're pushing. + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/case_id' + - $ref: '#/components/parameters/connector_id' + - $ref: '#/components/parameters/space_id' + responses: + '200': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/user_actions: get: description: Returns all user activity for the specified case. @@ -1954,10 +2046,9 @@ components: in: query name: owner description: >- - A filter to limit the retrieved cases to a specific set of applications. - Valid values are:cases, observability, and securitySolution. If this - parameter is omitted, the response contains all cases that the user has - access to read. + A filter to limit the response to a specific set of applications. If + this parameter is omitted, the response contains information about all + the cases that the user has access to read. schema: oneOf: - $ref: '#/components/schemas/owners' @@ -2096,6 +2187,16 @@ components: schema: type: string example: 71ec1870-725b-11ea-a0b2-c51ea50a58e2 + connector_id: + in: path + name: connectorId + description: >- + An identifier for the connector. To retrieve connector IDs, use the find + connectors API. + required: true + schema: + type: string + example: abed3a70-71bd-11ea-a0b2-c51ea50a58e2 space_id: in: path name: spaceId diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/connector_id.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/connector_id.yaml new file mode 100644 index 0000000000000..71cdc7191cfa1 --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/components/parameters/connector_id.yaml @@ -0,0 +1,7 @@ +in: path +name: connectorId +description: An identifier for the connector. To retrieve connector IDs, use the find connectors API. +required: true +schema: + type: string + example: abed3a70-71bd-11ea-a0b2-c51ea50a58e2 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/components/parameters/owner.yaml b/x-pack/plugins/cases/common/openapi/components/parameters/owner.yaml index ac490e67e37e0..3f5e5ae73ad19 100644 --- a/x-pack/plugins/cases/common/openapi/components/parameters/owner.yaml +++ b/x-pack/plugins/cases/common/openapi/components/parameters/owner.yaml @@ -1,6 +1,6 @@ in: query name: owner -description: A filter to limit the retrieved cases to a specific set of applications. Valid values are:cases, observability, and securitySolution. If this parameter is omitted, the response contains all cases that the user has access to read. +description: A filter to limit the response to a specific set of applications. If this parameter is omitted, the response contains information about all the cases that the user has access to read. schema: oneOf: - $ref: '../schemas/owners.yaml' diff --git a/x-pack/plugins/cases/common/openapi/entrypoint.yaml b/x-pack/plugins/cases/common/openapi/entrypoint.yaml index 7513bcd5ee65c..5e8454eddd260 100644 --- a/x-pack/plugins/cases/common/openapi/entrypoint.yaml +++ b/x-pack/plugins/cases/common/openapi/entrypoint.yaml @@ -25,6 +25,8 @@ paths: $ref: paths/api@cases@configure@{configurationid}.yaml '/api/cases/configure/connectors/_find': $ref: paths/api@cases@configure@connectors@_find.yaml + '/api/cases/reporters': + $ref: 'paths/api@cases@reporters.yaml' '/api/cases/status': $ref: 'paths/api@cases@status.yaml' '/api/cases/tags': @@ -35,8 +37,10 @@ paths: $ref: 'paths/api@cases@{caseid}@alerts.yaml' '/api/cases/{caseId}/comments': $ref: 'paths/api@cases@{caseid}@comments.yaml' - /api/cases/{caseId}/comments/{commentId}: + '/api/cases/{caseId}/comments/{commentId}': $ref: 'paths/api@cases@{caseid}@comments@{commentid}.yaml' + '/api/cases/{caseId}/connector/{connectorId}/_push': + $ref: 'paths/api@cases@{caseid}@connector@{connectorid}@_push.yaml' '/api/cases/{caseId}/user_actions': $ref: 'paths/api@cases@{caseid}@user_actions.yaml' @@ -52,6 +56,8 @@ paths: $ref: paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml '/s/{spaceId}/api/cases/configure/connectors/_find': $ref: paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml + '/s/{spaceId}/api/cases/reporters': + $ref: 'paths/s@{spaceid}@api@cases@reporters.yaml' '/s/{spaceId}/api/cases/status': $ref: 'paths/s@{spaceid}@api@cases@status.yaml' '/s/{spaceId}/api/cases/tags': @@ -64,6 +70,8 @@ paths: $ref: 'paths/s@{spaceid}@api@cases@{caseid}@comments.yaml' '/s/{spaceId}/api/cases/{caseId}/comments/{commentId}': $ref: 'paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml' + '/s/{spaceId}/api/cases/{caseId}/connector/{connectorId}/_push': + $ref: 'paths/s@{spaceid}@api@cases@{caseid}@connector@{connectorid}@_push.yaml' '/s/{spaceId}/api/cases/{caseId}/user_actions': $ref: 'paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml' components: diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@reporters.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@reporters.yaml new file mode 100644 index 0000000000000..01be74b0f373b --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@reporters.yaml @@ -0,0 +1,18 @@ +get: + description: > + Returns information about the users who opened cases. + 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. + parameters: + - $ref: '../components/parameters/owner.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@tags.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@tags.yaml index b5e7b3bebfa80..80a60c41804cb 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@tags.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@tags.yaml @@ -1,5 +1,7 @@ get: - description: Aggregates and returns a list of case tags. + description: > + Aggregates and returns a list of case tags. + 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. parameters: - in: query name: owner diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@connector@{connectorid}@_push.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@connector@{connectorid}@_push.yaml new file mode 100644 index 0000000000000..896707bac93ba --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@connector@{connectorid}@_push.yaml @@ -0,0 +1,15 @@ +post: + description: > + Pushes a case to an external service. + You must have all privileges for the **Actions and Connectors** feature in the ***Management*** section of the Kibana feature privileges. You must also have all privileges for the **Cases*** feature in the **Management**, ***Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're pushing. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/case_id.yaml + - $ref: '../components/parameters/connector_id.yaml' + responses: + '200': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@reporters.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@reporters.yaml new file mode 100644 index 0000000000000..29448eb8ddbde --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@reporters.yaml @@ -0,0 +1,19 @@ +get: + description: > + Returns information about the users who opened cases. + 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. + parameters: + - $ref: '../components/parameters/space_id.yaml' + - $ref: '../components/parameters/owner.yaml' + responses: + '200': + description: Indicates a successful call. + content: + application/json; charset=utf-8: + schema: + type: string + examples: {} + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@tags.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@tags.yaml index ba78d5a04ac37..e762dceac6600 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@tags.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@tags.yaml @@ -1,5 +1,7 @@ get: - description: Aggregates and returns a list of case tags. + description: > + Aggregates and returns a list of case tags. + 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. parameters: - $ref: '../components/parameters/space_id.yaml' - in: query diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@connector@{connectorid}@_push.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@connector@{connectorid}@_push.yaml new file mode 100644 index 0000000000000..1ea8f9a6993bd --- /dev/null +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@connector@{connectorid}@_push.yaml @@ -0,0 +1,16 @@ +post: + description: > + Pushes a case to an external service. + You must have all privileges for the **Actions and Connectors** feature in the ***Management*** section of the Kibana feature privileges. You must also have all privileges for the **Cases*** feature in the **Management**, ***Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're pushing. + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + - $ref: ../components/parameters/case_id.yaml + - $ref: '../components/parameters/connector_id.yaml' + - $ref: '../components/parameters/space_id.yaml' + responses: + '200': + description: Indicates a successful call. + servers: + - url: https://localhost:5601 +servers: + - url: https://localhost:5601 \ No newline at end of file From 1c9b72e45f89f48aaae83cd762590103508bb575 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 28 Apr 2022 17:18:20 -0700 Subject: [PATCH 8/9] Add missing feature privileges --- .../plugins/cases/common/openapi/bundled.json | 86 +++------ .../plugins/cases/common/openapi/bundled.yaml | 177 ++++++++++++------ .../cases/common/openapi/paths/api@cases.yaml | 11 +- .../common/openapi/paths/api@cases@_find.yaml | 4 +- .../api@cases@configure@connectors@_find.yaml | 4 +- .../openapi/paths/api@cases@status.yaml | 14 +- .../openapi/paths/api@cases@{caseid}.yaml | 4 +- .../paths/api@cases@{caseid}@comments.yaml | 12 +- ...i@cases@{caseid}@comments@{commentid}.yaml | 8 +- .../api@cases@{caseid}@user_actions.yaml | 4 +- .../openapi/paths/s@{spaceid}@api@cases.yaml | 9 +- .../paths/s@{spaceid}@api@cases@_find.yaml | 4 +- ...@api@cases@configure@connectors@_find.yaml | 4 +- .../paths/s@{spaceid}@api@cases@status.yaml | 14 +- .../paths/s@{spaceid}@api@cases@{caseid}.yaml | 4 +- ...{spaceid}@api@cases@{caseid}@comments.yaml | 9 +- ...i@cases@{caseid}@comments@{commentid}.yaml | 8 +- ...ceid}@api@cases@{caseid}@user_actions.yaml | 4 +- 18 files changed, 228 insertions(+), 152 deletions(-) diff --git a/x-pack/plugins/cases/common/openapi/bundled.json b/x-pack/plugins/cases/common/openapi/bundled.json index 3e2a9f7cfb80c..7689b9ae56f2c 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.json +++ b/x-pack/plugins/cases/common/openapi/bundled.json @@ -22,7 +22,7 @@ "paths": { "/api/cases": { "post": { - "description": "Creates a case.", + "description": "Creates a case. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're creating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -188,15 +188,16 @@ ] }, "delete": { - "description": "Deletes one or more cases.", + "description": "Deletes one or more cases. You must have all 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 deleting.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" }, { "name": "ids", - "description": "The cases that you want to removed. All non-ASCII characters must be URL encoded.", + "description": "The cases that you want to removed. To retrieve case IDs, use the find cases API. All non-ASCII characters must be URL encoded.", "in": "query", + "required": true, "schema": { "type": "string" }, @@ -392,7 +393,7 @@ }, "/api/cases/_find": { "get": { - "description": "Retrieves a paginated subset of cases.", + "description": "Retrieves a paginated subset of cases. 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.\n", "parameters": [ { "$ref": "#/components/parameters/default_search_operator" @@ -745,7 +746,7 @@ }, "/api/cases/configure/connectors/_find": { "get": { - "description": "Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned.", + "description": "Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned. You must have read privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", "responses": { "200": { "description": "Indicates a successful call.", @@ -806,26 +807,11 @@ }, "/api/cases/status": { "get": { - "description": "Returns the number of cases that are open, closed, and in progress.", + "description": "Returns the number of cases that are open, closed, and in progress. 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.\n", "deprecated": true, "parameters": [ { - "in": "query", - "name": "owner", - "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read.", - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/owners" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/owners" - } - } - ] - } + "$ref": "#/components/parameters/owner" } ], "responses": { @@ -903,7 +889,7 @@ }, "/api/cases/{caseId}": { "get": { - "description": "Retrieves a specified case.", + "description": "Retrieves a specified case. 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.\n", "parameters": [ { "$ref": "#/components/parameters/case_id" @@ -980,7 +966,7 @@ }, "/api/cases/{caseId}/comments": { "post": { - "description": "Adds a comment to a case.", + "description": "Adds a comment to a case. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -1152,7 +1138,7 @@ ] }, "delete": { - "description": "Deletes all comments from a case.", + "description": "Deletes all comments from a case. You must have all 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 updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -1173,7 +1159,7 @@ ] }, "get": { - "description": "Retrieves all the comments from a case.", + "description": "Retrieves all the comments from a case. 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 with the comments you're seeking.\n", "deprecated": true, "parameters": [ { @@ -1207,7 +1193,7 @@ }, "/api/cases/{caseId}/comments/{commentId}": { "delete": { - "description": "Deletes a comment from a case.", + "description": "Deletes a comment from a case. You must have all 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 updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -1231,7 +1217,7 @@ ] }, "get": { - "description": "Retrieves a comment from a case.", + "description": "Retrieves a comment from a case. 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 with the comments you're seeking.\n", "parameters": [ { "$ref": "#/components/parameters/case_id" @@ -1298,7 +1284,7 @@ }, "/api/cases/{caseId}/user_actions": { "get": { - "description": "Returns all user activity for the specified case.", + "description": "Returns all user activity for the specified case. 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.\n", "deprecated": true, "parameters": [ { @@ -1332,7 +1318,7 @@ }, "/s/{spaceId}/api/cases": { "post": { - "description": "Creates a case.", + "description": "Creates a case. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're creating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -1501,7 +1487,7 @@ ] }, "delete": { - "description": "Deletes one or more cases.", + "description": "Deletes one or more cases. You must have all 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 deleting.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -1513,6 +1499,7 @@ "name": "ids", "description": "The cases that you want to removed. All non-ASCII characters must be URL encoded.", "in": "query", + "required": true, "schema": { "type": "string" }, @@ -1711,7 +1698,7 @@ }, "/s/{spaceId}/api/cases/_find": { "get": { - "description": "Retrieves a paginated subset of cases.", + "description": "Retrieves a paginated subset of cases. 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.\n", "parameters": [ { "$ref": "#/components/parameters/space_id" @@ -2079,7 +2066,7 @@ }, "/s/{spaceId}/api/cases/configure/connectors/_find": { "get": { - "description": "Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned.", + "description": "Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned. You must have read privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", "parameters": [ { "$ref": "#/components/parameters/space_id" @@ -2148,29 +2135,14 @@ }, "/s/{spaceId}/api/cases/status": { "get": { - "description": "Returns the number of cases that are open, closed, and in progress.", + "description": "Returns the number of cases that are open, closed, and in progress. 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.\n", "deprecated": true, "parameters": [ { "$ref": "#/components/parameters/space_id" }, { - "in": "query", - "name": "owner", - "description": "A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read.", - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/owners" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/owners" - } - } - ] - } + "$ref": "#/components/parameters/owner" } ], "responses": { @@ -2251,7 +2223,7 @@ }, "/s/{spaceId}/api/cases/{caseId}": { "get": { - "description": "Retrieves a specified case.", + "description": "Retrieves a specified case. 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.\n", "parameters": [ { "$ref": "#/components/parameters/case_id" @@ -2334,7 +2306,7 @@ }, "/s/{spaceId}/api/cases/{caseId}/comments": { "post": { - "description": "Adds a comment to a case.", + "description": "Adds a comment to a case. You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -2512,7 +2484,7 @@ ] }, "delete": { - "description": "Deletes all comments from a case.", + "description": "Deletes all comments from a case. You must have all 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 updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -2536,7 +2508,7 @@ ] }, "get": { - "description": "Retrieves all the comments from a case.\n", + "description": "Retrieves all the comments from a case. 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 with the comments you're seeking.\n", "deprecated": true, "parameters": [ { @@ -2573,7 +2545,7 @@ }, "/s/{spaceId}/api/cases/{caseId}/comments/{commentId}": { "delete": { - "description": "Deletes a comment from a case.", + "description": "Deletes a comment from a case. You must have all 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 updating.\n", "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" @@ -2600,7 +2572,7 @@ ] }, "get": { - "description": "Retrieves a comment from a case.", + "description": "Retrieves a comment from a case. 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 with the comments you're seeking.\n", "parameters": [ { "$ref": "#/components/parameters/case_id" @@ -2673,7 +2645,7 @@ }, "/s/{spaceId}/api/cases/{caseId}/user_actions": { "get": { - "description": "Returns all user activity for the specified case.", + "description": "Returns all user activity for the specified case. 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.\n", "deprecated": true, "parameters": [ { diff --git a/x-pack/plugins/cases/common/openapi/bundled.yaml b/x-pack/plugins/cases/common/openapi/bundled.yaml index 2a42e422cdfaf..2ab823839573d 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.yaml +++ b/x-pack/plugins/cases/common/openapi/bundled.yaml @@ -15,7 +15,11 @@ servers: paths: /api/cases: post: - description: Creates a case. + description: > + Creates a case. You must have all privileges for the **Cases** feature + in the **Management**, **Observability**, or **Security** section of the + Kibana feature privileges, depending on the owner of the case you're + creating. parameters: - $ref: '#/components/parameters/kbn_xsrf' requestBody: @@ -164,14 +168,19 @@ paths: servers: - url: https://localhost:5601 delete: - description: Deletes one or more cases. + description: > + Deletes one or more cases. You must have all 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 deleting. parameters: - $ref: '#/components/parameters/kbn_xsrf' - name: ids description: >- - The cases that you want to removed. All non-ASCII characters must be - URL encoded. + The cases that you want to removed. To retrieve case IDs, use the + find cases API. All non-ASCII characters must be URL encoded. in: query + required: true schema: type: string example: '%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D' @@ -337,7 +346,11 @@ paths: - url: https://localhost:5601 /api/cases/_find: get: - description: Retrieves a paginated subset of cases. + description: > + Retrieves a paginated subset of cases. 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. parameters: - $ref: '#/components/parameters/default_search_operator' - $ref: '#/components/parameters/fields' @@ -586,9 +599,11 @@ paths: - url: https://localhost:5601 /api/cases/configure/connectors/_find: get: - description: >- + description: > Retrieves information about connectors. In particular, only the - connectors that are supported for use in cases are returned. + connectors that are supported for use in cases are returned. You must + have read privileges for the **Actions and Connectors** feature in the + **Management** section of the Kibana feature privileges. responses: '200': description: Indicates a successful call. @@ -624,21 +639,14 @@ paths: - url: https://localhost:5601 /api/cases/status: get: - description: Returns the number of cases that are open, closed, and in progress. + description: > + Returns the number of cases that are open, closed, and in progress. 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. deprecated: true parameters: - - in: query - name: owner - description: >- - A filter to limit the retrieved case statistics to a specific set of - applications. If this parameter is omitted, the response contains - all cases that the user has access to read. - schema: - oneOf: - - $ref: '#/components/schemas/owners' - - type: array - items: - $ref: '#/components/schemas/owners' + - $ref: '#/components/parameters/owner' responses: '200': description: Indicates a successful call. @@ -685,7 +693,11 @@ paths: - url: https://localhost:5601 /api/cases/{caseId}: get: - description: Retrieves a specified case. + description: > + Retrieves a specified case. 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. parameters: - $ref: '#/components/parameters/case_id' - in: query @@ -731,7 +743,11 @@ paths: - url: https://localhost:5601 /api/cases/{caseId}/comments: post: - description: Adds a comment to a case. + description: > + Adds a comment to a case. You must have all privileges for the **Cases** + feature in the **Management**, **Observability**, or **Security** + section of the Kibana feature privileges, depending on the owner of the + case you're updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/case_id' @@ -904,7 +920,11 @@ paths: servers: - url: https://localhost:5601 delete: - description: Deletes all comments from a case. + description: > + Deletes all comments from a case. You must have all 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 updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/case_id' @@ -914,7 +934,11 @@ paths: servers: - url: https://localhost:5601 get: - description: Retrieves all the comments from a case. + description: > + Retrieves all the comments from a case. 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 with the comments you're seeking. deprecated: true parameters: - $ref: '#/components/parameters/case_id' @@ -932,7 +956,11 @@ paths: - url: https://localhost:5601 /api/cases/{caseId}/comments/{commentId}: delete: - description: Deletes a comment from a case. + description: > + Deletes a comment from a case. You must have all 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 updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/case_id' @@ -943,7 +971,11 @@ paths: servers: - url: https://localhost:5601 get: - description: Retrieves a comment from a case. + description: > + Retrieves a comment from a case. 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 with the comments you're seeking. parameters: - $ref: '#/components/parameters/case_id' - $ref: '#/components/parameters/comment_id' @@ -981,7 +1013,11 @@ paths: - url: https://localhost:5601 /api/cases/{caseId}/user_actions: get: - description: Returns all user activity for the specified case. + description: > + Returns all user activity for the specified case. 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. deprecated: true parameters: - $ref: '#/components/parameters/case_id' @@ -999,7 +1035,11 @@ paths: - url: https://localhost:5601 /s/{spaceId}/api/cases: post: - description: Creates a case. + description: > + Creates a case. You must have all privileges for the **Cases** feature + in the **Management**, **Observability**, or **Security** section of the + Kibana feature privileges, depending on the owner of the case you're + creating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/space_id' @@ -1149,7 +1189,11 @@ paths: servers: - url: https://localhost:5601 delete: - description: Deletes one or more cases. + description: > + Deletes one or more cases. You must have all 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 deleting. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/space_id' @@ -1158,6 +1202,7 @@ paths: The cases that you want to removed. All non-ASCII characters must be URL encoded. in: query + required: true schema: type: string example: '%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D' @@ -1324,7 +1369,11 @@ paths: - url: https://localhost:5601 /s/{spaceId}/api/cases/_find: get: - description: Retrieves a paginated subset of cases. + description: > + Retrieves a paginated subset of cases. 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. parameters: - $ref: '#/components/parameters/space_id' - $ref: '#/components/parameters/default_search_operator' @@ -1578,9 +1627,11 @@ paths: - url: https://localhost:5601 /s/{spaceId}/api/cases/configure/connectors/_find: get: - description: >- + description: > Retrieves information about connectors. In particular, only the - connectors that are supported for use in cases are returned. + connectors that are supported for use in cases are returned. You must + have read privileges for the **Actions and Connectors** feature in the + **Management** section of the Kibana feature privileges. parameters: - $ref: '#/components/parameters/space_id' responses: @@ -1619,22 +1670,15 @@ paths: - url: https://localhost:5601 /s/{spaceId}/api/cases/status: get: - description: Returns the number of cases that are open, closed, and in progress. + description: > + Returns the number of cases that are open, closed, and in progress. 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. deprecated: true parameters: - $ref: '#/components/parameters/space_id' - - in: query - name: owner - description: >- - A filter to limit the retrieved case statistics to a specific set of - applications. If this parameter is omitted, the response contains - all cases that the user has access to read. - schema: - oneOf: - - $ref: '#/components/schemas/owners' - - type: array - items: - $ref: '#/components/schemas/owners' + - $ref: '#/components/parameters/owner' responses: '200': description: Indicates a successful call. @@ -1682,7 +1726,11 @@ paths: - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}: get: - description: Retrieves a specified case. + description: > + Retrieves a specified case. 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. parameters: - $ref: '#/components/parameters/case_id' - $ref: '#/components/parameters/space_id' @@ -1730,7 +1778,11 @@ paths: - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/comments: post: - description: Adds a comment to a case. + description: > + Adds a comment to a case. You must have all privileges for the **Cases** + feature in the **Management**, **Observability**, or **Security** + section of the Kibana feature privileges, depending on the owner of the + case you're updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/case_id' @@ -1905,7 +1957,11 @@ paths: servers: - url: https://localhost:5601 delete: - description: Deletes all comments from a case. + description: > + Deletes all comments from a case. You must have all 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 updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/case_id' @@ -1916,8 +1972,11 @@ paths: servers: - url: https://localhost:5601 get: - description: | - Retrieves all the comments from a case. + description: > + Retrieves all the comments from a case. 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 with the comments you're seeking. deprecated: true parameters: - $ref: '#/components/parameters/case_id' @@ -1936,7 +1995,11 @@ paths: - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/comments/{commentId}: delete: - description: Deletes a comment from a case. + description: > + Deletes a comment from a case. You must have all 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 updating. parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/space_id' @@ -1948,7 +2011,11 @@ paths: servers: - url: https://localhost:5601 get: - description: Retrieves a comment from a case. + description: > + Retrieves a comment from a case. 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 with the comments you're seeking. parameters: - $ref: '#/components/parameters/case_id' - $ref: '#/components/parameters/comment_id' @@ -1988,7 +2055,11 @@ paths: - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/user_actions: get: - description: Returns all user activity for the specified case. + description: > + Returns all user activity for the specified case. 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. deprecated: true parameters: - $ref: '#/components/parameters/case_id' diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml index 126a1572a0ecd..652bd1932561a 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases.yaml @@ -1,5 +1,7 @@ post: - description: Creates a case. + description: > + Creates a case. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're creating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml requestBody: @@ -52,12 +54,15 @@ post: - url: https://localhost:5601 delete: - description: Deletes one or more cases. + description: > + Deletes one or more cases. + You must have all 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 deleting. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - name: ids - description: The cases that you want to removed. All non-ASCII characters must be URL encoded. + description: The cases that you want to removed. To retrieve case IDs, use the find cases API. All non-ASCII characters must be URL encoded. in: query + required: true schema: type: string example: '%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D' diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml index bf91693d41635..0ce9b6460e9fb 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@_find.yaml @@ -1,5 +1,7 @@ get: - description: Retrieves a paginated subset of cases. + description: > + Retrieves a paginated subset of cases. + 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. parameters: - $ref: '../components/parameters/default_search_operator.yaml' - $ref: '../components/parameters/fields.yaml' diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@connectors@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@connectors@_find.yaml index 7ace969718a0d..52419fe9e684a 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@connectors@_find.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@configure@connectors@_find.yaml @@ -1,5 +1,7 @@ get: - description: Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned. + description: > + Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned. + You must have read privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. responses: '200': description: Indicates a successful call. diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@status.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@status.yaml index 76620c0732b92..79de144a82e47 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@status.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@status.yaml @@ -1,16 +1,10 @@ get: - description: Returns the number of cases that are open, closed, and in progress. + description: > + Returns the number of cases that are open, closed, and in progress. + 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. deprecated: true parameters: - - in: query - name: owner - description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read. - schema: - oneOf: - - $ref: '../components/schemas/owners.yaml' - - type: array - items: - $ref: '../components/schemas/owners.yaml' + - $ref: '../components/parameters/owner.yaml' responses: '200': description: Indicates a successful call. diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}.yaml index 1f4d179dd63bd..3b6cd8d82aabc 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}.yaml @@ -1,5 +1,7 @@ get: - description: Retrieves a specified case. + description: > + Retrieves a specified case. + 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. parameters: - $ref: ../components/parameters/case_id.yaml - in: query diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml index 28551aa1e246a..d3490c5461b46 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments.yaml @@ -1,5 +1,7 @@ post: - description: Adds a comment to a case. + description: > + Adds a comment to a case. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: ../components/parameters/case_id.yaml @@ -136,7 +138,9 @@ patch: - url: https://localhost:5601 delete: - description: Deletes all comments from a case. + description: > + Deletes all comments from a case. + You must have all 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 updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: ../components/parameters/case_id.yaml @@ -147,7 +151,9 @@ delete: - url: https://localhost:5601 get: - description: Retrieves all the comments from a case. + description: > + Retrieves all the comments from a case. + 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 with the comments you're seeking. deprecated: true parameters: - $ref: ../components/parameters/case_id.yaml diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml index 059510445de92..bf69042a4d5c3 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml @@ -1,5 +1,7 @@ delete: - description: Deletes a comment from a case. + description: > + Deletes a comment from a case. + You must have all 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 updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: ../components/parameters/case_id.yaml @@ -11,7 +13,9 @@ delete: - url: https://localhost:5601 get: - description: Retrieves a comment from a case. + description: > + Retrieves a comment from a case. + 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 with the comments you're seeking. parameters: - $ref: '../components/parameters/case_id.yaml' - $ref: '../components/parameters/comment_id.yaml' diff --git a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@user_actions.yaml b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@user_actions.yaml index 9e866b046dd4b..b1f8e8f9e2421 100644 --- a/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@user_actions.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/api@cases@{caseid}@user_actions.yaml @@ -1,5 +1,7 @@ get: - description: Returns all user activity for the specified case. + description: > + Returns all user activity for the specified case. + 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. deprecated: true parameters: - $ref: '../components/parameters/case_id.yaml' diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml index 384100bbdbde4..fd9c236f56c33 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases.yaml @@ -1,5 +1,7 @@ post: - description: Creates a case. + description: > + Creates a case. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're creating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: '../components/parameters/space_id.yaml' @@ -53,13 +55,16 @@ post: - url: https://localhost:5601 delete: - description: Deletes one or more cases. + description: > + Deletes one or more cases. + You must have all 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 deleting. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: '../components/parameters/space_id.yaml' - name: ids description: The cases that you want to removed. All non-ASCII characters must be URL encoded. in: query + required: true schema: type: string example: '%5B%22d4e7abb0-b462-11ec-9a8d-698504725a43%22%5D' diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml index 7bc9f727e98d3..ef70bc8125034 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@_find.yaml @@ -1,5 +1,7 @@ get: - description: Retrieves a paginated subset of cases. + description: > + Retrieves a paginated subset of cases. + 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. parameters: - $ref: '../components/parameters/space_id.yaml' - $ref: '../components/parameters/default_search_operator.yaml' diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml index ea405146dd2af..bb084d0c94567 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml @@ -1,5 +1,7 @@ get: - description: Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned. + description: > + Retrieves information about connectors. In particular, only the connectors that are supported for use in cases are returned. + You must have read privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. parameters: - $ref: '../components/parameters/space_id.yaml' responses: diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@status.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@status.yaml index 36984e56e7048..3f3bc63878e82 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@status.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@status.yaml @@ -1,17 +1,11 @@ get: - description: Returns the number of cases that are open, closed, and in progress. + description: > + Returns the number of cases that are open, closed, and in progress. + 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. deprecated: true parameters: - $ref: '../components/parameters/space_id.yaml' - - in: query - name: owner - description: A filter to limit the retrieved case statistics to a specific set of applications. If this parameter is omitted, the response contains all cases that the user has access to read. - schema: - oneOf: - - $ref: '../components/schemas/owners.yaml' - - type: array - items: - $ref: '../components/schemas/owners.yaml' + - $ref: '../components/parameters/owner.yaml' responses: '200': description: Indicates a successful call. diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml index f3e409fe743a0..3b2c3d598f3b1 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml @@ -1,5 +1,7 @@ get: - description: Retrieves a specified case. + description: > + Retrieves a specified case. + 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. parameters: - $ref: ../components/parameters/case_id.yaml - $ref: '../components/parameters/space_id.yaml' diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml index e4078563b7d6e..ab3e016b220c3 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml @@ -1,5 +1,7 @@ post: - description: Adds a comment to a case. + description: > + Adds a comment to a case. + You must have all privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case you're updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: ../components/parameters/case_id.yaml @@ -138,7 +140,9 @@ patch: - url: https://localhost:5601 delete: - description: Deletes all comments from a case. + description: > + Deletes all comments from a case. + You must have all 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 updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: ../components/parameters/case_id.yaml @@ -152,6 +156,7 @@ delete: get: description: > Retrieves all the comments from a case. + 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 with the comments you're seeking. deprecated: true parameters: - $ref: '../components/parameters/case_id.yaml' diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml index 330283ac6c830..8175f1d72ba56 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml @@ -1,5 +1,7 @@ delete: - description: Deletes a comment from a case. + description: > + Deletes a comment from a case. + You must have all 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 updating. parameters: - $ref: ../components/headers/kbn_xsrf.yaml - $ref: '../components/parameters/space_id.yaml' @@ -12,7 +14,9 @@ delete: - url: https://localhost:5601 get: - description: Retrieves a comment from a case. + description: > + Retrieves a comment from a case. + 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 with the comments you're seeking. parameters: - $ref: '../components/parameters/case_id.yaml' - $ref: '../components/parameters/comment_id.yaml' diff --git a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml index 7c72c149e3570..02a05cdebe8d5 100644 --- a/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml +++ b/x-pack/plugins/cases/common/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml @@ -1,5 +1,7 @@ get: - description: Returns all user activity for the specified case. + description: > + Returns all user activity for the specified case. + 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. deprecated: true parameters: - $ref: '../components/parameters/case_id.yaml' From 534e146c8917d1265ad7a3f9872126f873381bb8 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 28 Apr 2022 17:26:37 -0700 Subject: [PATCH 9/9] Add tags --- x-pack/plugins/cases/common/openapi/bundled.json | 9 ++++++++- x-pack/plugins/cases/common/openapi/bundled.yaml | 4 +++- x-pack/plugins/cases/common/openapi/entrypoint.yaml | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/cases/common/openapi/bundled.json b/x-pack/plugins/cases/common/openapi/bundled.json index 7689b9ae56f2c..7151d64f1b8d6 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.json +++ b/x-pack/plugins/cases/common/openapi/bundled.json @@ -1,6 +1,5 @@ { "openapi": "3.0.1", - "tags": [], "info": { "title": "Cases", "description": "OpenAPI schema for Cases endpoints", @@ -13,6 +12,14 @@ "url": "https://www.elastic.co/licensing/elastic-license" } }, + "tags": [ + { + "name": "cases" + }, + { + "name": "kibana" + } + ], "servers": [ { "url": "http://localhost:5601", diff --git a/x-pack/plugins/cases/common/openapi/bundled.yaml b/x-pack/plugins/cases/common/openapi/bundled.yaml index 2ab823839573d..1e1859bb837dd 100644 --- a/x-pack/plugins/cases/common/openapi/bundled.yaml +++ b/x-pack/plugins/cases/common/openapi/bundled.yaml @@ -1,5 +1,4 @@ openapi: 3.0.1 -tags: [] info: title: Cases description: OpenAPI schema for Cases endpoints @@ -9,6 +8,9 @@ info: license: name: Elastic License 2.0 url: https://www.elastic.co/licensing/elastic-license +tags: + - name: cases + - name: kibana servers: - url: http://localhost:5601 description: local diff --git a/x-pack/plugins/cases/common/openapi/entrypoint.yaml b/x-pack/plugins/cases/common/openapi/entrypoint.yaml index 5e8454eddd260..8ac423acf19e5 100644 --- a/x-pack/plugins/cases/common/openapi/entrypoint.yaml +++ b/x-pack/plugins/cases/common/openapi/entrypoint.yaml @@ -1,5 +1,4 @@ openapi: 3.0.1 -tags: [] info: title: Cases description: OpenAPI schema for Cases endpoints @@ -9,6 +8,9 @@ info: license: name: Elastic License 2.0 url: https://www.elastic.co/licensing/elastic-license +tags: + - name: cases + - name: kibana servers: - url: 'http://localhost:5601' description: local