Skip to content

Commit

Permalink
[ResponseOps][Connectors] Add descriptions for OpenAPI responses (ela…
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Aug 29, 2024
1 parent 2385487 commit 1016ef0
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 27 deletions.
11 changes: 8 additions & 3 deletions x-pack/plugins/actions/server/routes/connector/get/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
21 changes: 13 additions & 8 deletions x-pack/plugins/actions/server/routes/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 8 additions & 2 deletions x-pack/plugins/actions/server/routes/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
12 changes: 9 additions & 3 deletions x-pack/plugins/actions/server/routes/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 8 additions & 1 deletion x-pack/plugins/actions/server/routes/legacy/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ export const createActionRoute = (
deprecated: true,
},
validate: {
body: bodySchema,
request: {
body: bodySchema,
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(
Expand Down
9 changes: 8 additions & 1 deletion x-pack/plugins/actions/server/routes/legacy/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 9 additions & 2 deletions x-pack/plugins/actions/server/routes/legacy/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 8 additions & 1 deletion x-pack/plugins/actions/server/routes/legacy/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 9 additions & 2 deletions x-pack/plugins/actions/server/routes/legacy/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
13 changes: 9 additions & 4 deletions x-pack/plugins/actions/server/routes/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1016ef0

Please sign in to comment.