Skip to content

Commit

Permalink
[MDS] Mute the non-mds endpoints for direct query data connections (#…
Browse files Browse the repository at this point in the history
…8537) (#8597)

* Mute the non-mds  endpoints for direct query data connections when MDS enabled



* Handle the case for local cluster too



* Handle the case for local cluster 2



* Changeset file for PR #8537 created/updated

---------



(cherry picked from commit 47ae28b)

Signed-off-by: Ryan Liang <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 16, 2024
1 parent 14a4ba7 commit 8dbad3f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8537.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [MDS] Mute the non-mds endpoints for direct query data connections ([#8537](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8537))
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const getDirectQueryConnections = async (dataSourceId: string, http: Http
};

export const getLocalClusterConnections = async (http: HttpSetup) => {
const res = await http.get(`${DATACONNECTIONS_BASE}`);
const res = await http.get(`${DATACONNECTIONS_BASE}/dataSourceMDSId=`);
const localClusterConnections: DataSourceTableItem[] = res.map(
(dataConnection: DirectQueryDatasourceDetails) => ({
id: `${dataConnection.name}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
EDIT,
} from '../../framework/utils/shared';

export function registerDataConnectionsRoute(router: IRouter, dataSourceEnabled: boolean) {
export function registerNonMdsDataConnectionsRoute(router: IRouter) {
router.get(
{
path: `${DATACONNECTIONS_BASE}/{name}`,
Expand Down Expand Up @@ -204,7 +204,9 @@ export function registerDataConnectionsRoute(router: IRouter, dataSourceEnabled:
}
}
);
}

export function registerDataConnectionsRoute(router: IRouter, dataSourceEnabled: boolean) {
router.get(
{
path: `${DATACONNECTIONS_BASE}/dataSourceMDSId={dataSourceMDSId?}`,
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/data_source_management/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

import { IRouter, ILegacyClusterClient } from '../../../../core/server';
import { registerDslRoute } from './dsl';
import { registerDataConnectionsRoute } from './data_connections_router';
import {
registerDataConnectionsRoute,
registerNonMdsDataConnectionsRoute,
} from './data_connections_router';
import { registerDatasourcesRoute } from './datasources_router';
import { registerPplRoute } from './ppl';
import { DSLFacet } from '../services/facets/dsl_facet';
Expand Down Expand Up @@ -43,6 +46,9 @@ export function setupRoutes({
// const queryService = new QueryService(client);
// registerSqlRoute(router, queryService);

if (!dataSourceEnabled) {
registerNonMdsDataConnectionsRoute(router);
}
registerDataConnectionsRoute(router, dataSourceEnabled);
registerDatasourcesRoute(router, dataSourceEnabled);
}

0 comments on commit 8dbad3f

Please sign in to comment.