Skip to content

Commit

Permalink
[8.15] [ResponseOps][Connectors] Add descriptions for OpenAPI respons…
Browse files Browse the repository at this point in the history
…es (#191678) (#191762)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[ResponseOps][Connectors] Add descriptions for OpenAPI responses
(#191678)](#191678)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-08-29T17:35:42Z","message":"[ResponseOps][Connectors]
Add descriptions for OpenAPI responses
(#191678)","sha":"1016ef06d7a78d46c19dc38ee6e642d3f65da89c","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","docs","Feature:Actions/ConnectorsManagement","backport:prev-minor","v8.16.0"],"title":"[ResponseOps][Connectors]
Add descriptions for OpenAPI
responses","number":191678,"url":"https://github.com/elastic/kibana/pull/191678","mergeCommit":{"message":"[ResponseOps][Connectors]
Add descriptions for OpenAPI responses
(#191678)","sha":"1016ef06d7a78d46c19dc38ee6e642d3f65da89c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191678","number":191678,"mergeCommit":{"message":"[ResponseOps][Connectors]
Add descriptions for OpenAPI responses
(#191678)","sha":"1016ef06d7a78d46c19dc38ee6e642d3f65da89c"}}]}]
BACKPORT-->

Co-authored-by: Lisa Cawley <[email protected]>
  • Loading branch information
kibanamachine and lcawl authored Aug 29, 2024
1 parent c23a32f commit e3d87f0
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 e3d87f0

Please sign in to comment.