[ResponseOps][Connectors] Add descriptions for OpenAPI responses (#191678)

This commit is contained in:
Lisa Cawley 2024-08-29 10:35:42 -07:00 committed by GitHub
parent 23854878ec
commit 1016ef06d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 89 additions and 27 deletions

View file

@ -27,11 +27,16 @@ export const getConnectorRoute = (
access: 'public',
summary: `Get connector information`,
tags: ['oas-tag:connectors'],
// description:
// 'You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.',
},
validate: {
params: getConnectorParamsSchemaV1,
request: {
params: getConnectorParamsSchemaV1,
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(

View file

@ -63,16 +63,21 @@ export const createActionRoute = (
access: 'public',
summary: 'Create a connector',
tags: ['oas-tag:connectors'],
// description:
// 'You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.',
},
validate: {
params: schema.maybe(
schema.object({
id: schema.maybe(schema.string()),
})
),
body: bodySchema,
request: {
params: schema.maybe(
schema.object({
id: schema.maybe(schema.string()),
})
),
body: bodySchema,
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(

View file

@ -29,11 +29,17 @@ export const deleteActionRoute = (
access: 'public',
summary: `Delete a connector`,
description: 'WARNING: When you delete a connector, it cannot be recovered.',
// You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.
tags: ['oas-tag:connectors'],
},
validate: {
params: paramSchema,
request: {
params: paramSchema,
},
response: {
204: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(

View file

@ -46,12 +46,18 @@ export const executeActionRoute = (
summary: `Run a connector`,
description:
'You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems.',
// You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. If you use an index connector, you must also have `all`, `create`, `index`, or `write` indices privileges.
tags: ['oas-tag:connectors'],
},
validate: {
body: bodySchema,
params: paramSchema,
request: {
body: bodySchema,
params: paramSchema,
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(

View file

@ -40,7 +40,14 @@ export const createActionRoute = (
deprecated: true,
},
validate: {
body: bodySchema,
request: {
body: bodySchema,
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(

View file

@ -35,7 +35,14 @@ export const deleteActionRoute = (
deprecated: true,
},
validate: {
params: paramSchema,
request: {
params: paramSchema,
},
response: {
204: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(async function (context, req, res) {

View file

@ -40,8 +40,15 @@ export const executeActionRoute = (
tags: ['oas-tag:connectors'],
},
validate: {
body: bodySchema,
params: paramSchema,
request: {
body: bodySchema,
params: paramSchema,
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(async function (context, req, res) {

View file

@ -34,7 +34,14 @@ export const getActionRoute = (
tags: ['oas-tag:connectors'],
},
validate: {
params: paramSchema,
request: {
params: paramSchema,
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(async function (context, req, res) {

View file

@ -40,8 +40,15 @@ export const updateActionRoute = (
tags: ['oas-tag:connectors'],
},
validate: {
body: bodySchema,
params: paramSchema,
request: {
body: bodySchema,
params: paramSchema,
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(async function (context, req, res) {

View file

@ -58,12 +58,17 @@ export const updateActionRoute = (
access: 'public',
summary: `Update a connector`,
tags: ['oas-tag:connectors'],
// description:
// 'You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.',
},
validate: {
body: bodySchema,
params: paramSchema,
request: {
body: bodySchema,
params: paramSchema,
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(