Skip to content

Commit

Permalink
added changes for de registering plugins not in Neo and changed other…
Browse files Browse the repository at this point in the history
… apis to 400

Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy committed Oct 21, 2024
1 parent 6edd8ef commit 72e4161
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ export function setupRoutes({
client: ILegacyClusterClient;
dataSourceEnabled: boolean;
}) {
PanelsRouter(router);
VisualizationsRouter(router);
registerPplRoute({ router, facet: new PPLFacet(client) });
registerDslRoute({ router, facet: new DSLFacet(client) }, dataSourceEnabled);
registerEventAnalyticsRouter({ router, savedObjectFacet: new SavedObjectFacet(client) });
registerAppAnalyticsRouter(router);

// TODO remove trace analytics route when DSL route for autocomplete is added
registerTraceAnalyticsDslRouter(router, dataSourceEnabled);
Expand All @@ -60,6 +57,9 @@ export function setupRoutes({
// query assist is part of log explorer, which will be disabled if datasource is enabled
if (!dataSourceEnabled) {
registerQueryAssistRoutes(router);
PanelsRouter(router);
registerEventAnalyticsRouter({ router, savedObjectFacet: new SavedObjectFacet(client) });
registerAppAnalyticsRouter(router);
}

registerGettingStartedRoutes(router);
Expand Down
2 changes: 1 addition & 1 deletion server/routes/metrics/metrics_rounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function registerMetricsRoute(router: IRouter, dataSourceEnabled: boolean
} catch (error) {
if (error.statusCode !== 404) console.error(error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down
2 changes: 1 addition & 1 deletion server/routes/ppl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function registerPplRoute({ router, facet }: { router: IRouter; facet: PP
return res.ok(result);
}
return res.custom({
statusCode: queryRes.data.statusCode || queryRes.data.status || 500,
statusCode: queryRes.data.statusCode || queryRes.data.status || 400,
body: queryRes.data.body || queryRes.data.message || '',
});
}
Expand Down
4 changes: 2 additions & 2 deletions server/routes/trace_analytics_dsl_router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function registerTraceAnalyticsDslRouter(router: IRouter, dataSourceEnabl
} catch (error) {
console.error(error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down Expand Up @@ -90,7 +90,7 @@ export function registerTraceAnalyticsDslRouter(router: IRouter, dataSourceEnabl
} catch (error) {
console.error(error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down

0 comments on commit 72e4161

Please sign in to comment.