Skip to content

Commit

Permalink
fix api 404 error (opensearch-project#1810)
Browse files Browse the repository at this point in the history
Signed-off-by: Eric <menwe@amazon.com>
  • Loading branch information
mengweieric authored May 1, 2024
1 parent 9151f5c commit 441168e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions server/routes/data_connections/data_connections_router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,29 @@ export function registerDataConnectionsRoute(router: IRouter, dataSourceEnabled:
}
);

router.get(
{
path: `${DATACONNECTIONS_BASE}`,
validate: false,
},
async (context, request, response): Promise<any> => {
try {
const dataConnectionsresponse = await context.observability_plugin.observabilityClient
.asScoped(request)
.callAsCurrentUser('ppl.getDataConnections');
return response.ok({
body: dataConnectionsresponse,
});
} catch (error: any) {
console.error('Issue in fetching data sources:', error);
return response.custom({
statusCode: error.statusCode || 500,
body: error.response,
});
}
}
);

router.get(
{
path: `${DATACONNECTIONS_BASE}/dataSourceMDSId={dataSourceMDSId?}`,
Expand Down

0 comments on commit 441168e

Please sign in to comment.