Skip to content

Commit

Permalink
[HTTP] Make connector APIs public (#184068)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored May 23, 2024
1 parent 2899fae commit c86e32c
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/connector/get/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export const getConnectorRoute = (
router.get(
{
path: `${BASE_ACTION_API_PATH}/connector/{id}`,
options: {
access: 'public',
description: `Get connector information`,
},
validate: {
params: getConnectorParamsSchemaV1,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export const getAllConnectorsRoute = (
router.get(
{
path: `${BASE_ACTION_API_PATH}/connectors`,
options: {
access: 'public',
description: `Get all connectors`,
},
validate: {},
},
router.handleLegacyErrors(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export const listTypesRoute = (
router.get(
{
path: `${BASE_ACTION_API_PATH}/connector_types`,
options: {
access: 'public',
description: `Get connector types`,
},
validate: {
query: connectorTypesQuerySchemaV1,
},
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export const createActionRoute = (
router.post(
{
path: `${BASE_ACTION_API_PATH}/connector/{id?}`,
options: {
access: 'public',
description: 'Create a connector',
},
validate: {
params: schema.maybe(
schema.object({
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export const deleteActionRoute = (
router.delete(
{
path: `${BASE_ACTION_API_PATH}/connector/{id}`,
options: {
access: 'public',
description: `Delete a connector`,
},
validate: {
params: paramSchema,
},
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export const executeActionRoute = (
router.post(
{
path: `${BASE_ACTION_API_PATH}/connector/{id}/_execute`,
options: {
access: 'public',
description: `Run a connector`,
},
validate: {
body: bodySchema,
params: paramSchema,
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/legacy/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export const createActionRoute = (
router.post(
{
path: `${BASE_ACTION_API_PATH}/action`,
options: {
access: 'public',
description: `Create a connector`,
},
validate: {
body: bodySchema,
},
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/legacy/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export const deleteActionRoute = (
router.delete(
{
path: `${BASE_ACTION_API_PATH}/action/{id}`,
options: {
access: 'public',
description: `Delete a connector`,
},
validate: {
params: paramSchema,
},
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/legacy/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const executeActionRoute = (
router.post(
{
path: `${BASE_ACTION_API_PATH}/action/{id}/_execute`,
options: {
access: 'public',
description: `Run a connector`,
},
validate: {
body: bodySchema,
params: paramSchema,
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/legacy/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export const getActionRoute = (
router.get(
{
path: `${BASE_ACTION_API_PATH}/action/{id}`,
options: {
access: 'public',
description: `Get connector information`,
},
validate: {
params: paramSchema,
},
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/legacy/get_all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export const getAllActionRoute = (
router.get(
{
path: `${BASE_ACTION_API_PATH}`,
options: {
access: 'public',
description: `Get all connectors`,
},
validate: {},
},
router.handleLegacyErrors(async function (context, req, res) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export const listActionTypesRoute = (
router.get(
{
path: `${BASE_ACTION_API_PATH}/list_action_types`,
options: {
access: 'public',
description: `Get connector types`,
},
validate: {},
},
router.handleLegacyErrors(async function (context, req, res) {
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/legacy/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const updateActionRoute = (
router.put(
{
path: `${BASE_ACTION_API_PATH}/action/{id}`,
options: {
access: 'public',
description: `Update a connector`,
},
validate: {
body: bodySchema,
params: paramSchema,
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/actions/server/routes/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export const updateActionRoute = (
router.put(
{
path: `${BASE_ACTION_API_PATH}/connector/{id}`,
options: {
access: 'public',
description: `Update a connector`,
},
validate: {
body: bodySchema,
params: paramSchema,
Expand Down

0 comments on commit c86e32c

Please sign in to comment.