Skip to content

Commit

Permalink
[MDS][Bug]added changes for de registering plugins not in MDS and cha…
Browse files Browse the repository at this point in the history
…nged other… (#2222)

* added changes for de registering plugins not in Neo and changed other apis to 400

Signed-off-by: sumukhswamy <[email protected]>

* added changes for de registering plugins not in Neo and changed other apis to 400

Signed-off-by: sumukhswamy <[email protected]>

* added changes for de registering plugins not in Neo and changed other apis to 400

Signed-off-by: sumukhswamy <[email protected]>

---------

Signed-off-by: sumukhswamy <[email protected]>
(cherry picked from commit a55310b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Oct 22, 2024
1 parent efdf804 commit 47a5e78
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions server/routes/application_analytics/app_analytics_router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function registerAppAnalyticsRouter(router: IRouter) {
} catch (err: any) {

Check warning on line 42 in server/routes/application_analytics/app_analytics_router.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
console.error('Error occurred while fetching applications', err);
return response.custom({
statusCode: err.statusCode || 500,
statusCode: err.statusCode || 400,
body: err.message,
});
}
Expand Down Expand Up @@ -78,7 +78,7 @@ export function registerAppAnalyticsRouter(router: IRouter) {
} catch (err: any) {

Check warning on line 78 in server/routes/application_analytics/app_analytics_router.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
console.error('Error occurred while fetching application', err);
return response.custom({
statusCode: err.statusCode || 500,
statusCode: err.statusCode || 400,
body: err.message,
});
}
Expand Down Expand Up @@ -120,7 +120,7 @@ export function registerAppAnalyticsRouter(router: IRouter) {
} catch (err: any) {

Check warning on line 120 in server/routes/application_analytics/app_analytics_router.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
console.error('Error occurred while creating a new application', err);
return response.custom({
statusCode: err.statusCode || 500,
statusCode: err.statusCode || 400,
body: err.message,
});
}
Expand Down Expand Up @@ -161,7 +161,7 @@ export function registerAppAnalyticsRouter(router: IRouter) {
} catch (err: any) {

Check warning on line 161 in server/routes/application_analytics/app_analytics_router.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
console.error('Error occurred while renaming an existing application', err);
return response.custom({
statusCode: err.statusCode || 500,
statusCode: err.statusCode || 400,
body: err.message,
});
}
Expand Down Expand Up @@ -210,7 +210,7 @@ export function registerAppAnalyticsRouter(router: IRouter) {
} catch (err: any) {

Check warning on line 210 in server/routes/application_analytics/app_analytics_router.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
console.error('Error occurred while updating an existing application', err);
return response.custom({
statusCode: err.statusCode || 500,
statusCode: err.statusCode || 400,
body: err.message,
});
}
Expand Down Expand Up @@ -245,7 +245,7 @@ export function registerAppAnalyticsRouter(router: IRouter) {
});
} catch (err: any) {
return response.custom({
statusCode: err.statusCode || 500,
statusCode: err.statusCode || 400,
body: err.message,
});
}
Expand Down
30 changes: 15 additions & 15 deletions server/routes/custom_panels/panels_router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in fetching panel list:', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down Expand Up @@ -77,7 +77,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in fetching panel:', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down Expand Up @@ -118,7 +118,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in creating new panel', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down Expand Up @@ -146,7 +146,7 @@ export function PanelsRouter(router: IRouter) {
);

try {
const responseBody = await customPanelBackend.updatePanel(
const _responseBody = await customPanelBackend.updatePanel(
opensearchNotebooksClient,
request.body.panelId,
request.body.panel
Expand All @@ -159,7 +159,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in updating panel', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down Expand Up @@ -187,7 +187,7 @@ export function PanelsRouter(router: IRouter) {
);

try {
const responseBody = await customPanelBackend.renamePanel(
const _responseBody = await customPanelBackend.renamePanel(
opensearchNotebooksClient,
request.body.panelId,
request.body.panelName
Expand All @@ -200,7 +200,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in renaming panel', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down Expand Up @@ -245,7 +245,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in cloning panel', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand All @@ -272,7 +272,7 @@ export function PanelsRouter(router: IRouter) {
);

try {
const deleteResponse = await customPanelBackend.deletePanel(
const _deleteResponse = await customPanelBackend.deletePanel(
opensearchNotebooksClient,
request.params.panelId
);
Expand All @@ -284,7 +284,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in deleting panel', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand All @@ -311,7 +311,7 @@ export function PanelsRouter(router: IRouter) {
);

try {
const deleteResponse = await customPanelBackend.deletePanelList(
const _deleteResponse = await customPanelBackend.deletePanelList(
opensearchNotebooksClient,
request.params.panelIdList
);
Expand All @@ -323,7 +323,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in deleting panel', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down Expand Up @@ -354,7 +354,7 @@ export function PanelsRouter(router: IRouter) {
);

try {
const panelFilterResponse = await customPanelBackend.addPanelFilter(
const _panelFilterResponse = await customPanelBackend.addPanelFilter(
opensearchNotebooksClient,
request.body.panelId,
request.body.query,
Expand All @@ -370,7 +370,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in adding query filter', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down Expand Up @@ -409,7 +409,7 @@ export function PanelsRouter(router: IRouter) {
} catch (error: any) {
console.error('Issue in fetching panel list:', error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down
20 changes: 10 additions & 10 deletions server/routes/event_analytics/event_analytics_router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const registerEventAnalyticsRouter = ({

if (savedRes.success || savedRes?.data?.statusCode === 404) return res.ok(result);

result.statusCode = savedRes?.data?.statusCode || 500;
result.statusCode = savedRes?.data?.statusCode || 400;
result.message = savedRes?.data || '';
return res.custom(result);
}
Expand All @@ -65,7 +65,7 @@ export const registerEventAnalyticsRouter = ({

if (savedRes.success || savedRes?.data?.statusCode === 404) return res.ok(result);

result.statusCode = savedRes?.data?.statusCode || 500;
result.statusCode = savedRes?.data?.statusCode || 400;
result.message = savedRes?.data || '';
return res.custom(result);
}
Expand Down Expand Up @@ -107,7 +107,7 @@ export const registerEventAnalyticsRouter = ({

if (savedRes.success) return res.ok(result);

result.statusCode = savedRes?.data?.statusCode || 500;
result.statusCode = savedRes?.data?.statusCode || 400;
result.message = savedRes?.data || '';
return res.custom(result);
}
Expand Down Expand Up @@ -160,7 +160,7 @@ export const registerEventAnalyticsRouter = ({

if (savedRes.success) return res.ok(result);

result.statusCode = savedRes?.data?.statusCode || 500;
result.statusCode = savedRes?.data?.statusCode || 400;
result.message = savedRes?.data || '';
return res.custom(result);
}
Expand Down Expand Up @@ -201,7 +201,7 @@ export const registerEventAnalyticsRouter = ({
},
};
if (savedRes.success) return res.ok(result);
result.statusCode = savedRes?.data?.statusCode || 500;
result.statusCode = savedRes?.data?.statusCode || 400;
result.message = savedRes?.data || '';
return res.custom(result);
}
Expand Down Expand Up @@ -253,7 +253,7 @@ export const registerEventAnalyticsRouter = ({
},
};
if (updateRes.success) return res.ok(result);
result.statusCode = updateRes?.data?.statusCode || 500;
result.statusCode = updateRes?.data?.statusCode || 400;
result.message = updateRes?.data || '';
return res.custom(result);
}
Expand Down Expand Up @@ -281,7 +281,7 @@ export const registerEventAnalyticsRouter = ({

if (savedRes.success) return res.ok(result);

result.statusCode = savedRes?.data?.statusCode || 500;
result.statusCode = savedRes?.data?.statusCode || 400;
result.message = savedRes?.data || '';
return res.custom(result);
}
Expand Down Expand Up @@ -312,7 +312,7 @@ export const registerEventAnalyticsRouter = ({

if (savedRes.success) return res.ok(result);

result.statusCode = savedRes?.data?.statusCode || 500;
result.statusCode = savedRes?.data?.statusCode || 400;
result.message = savedRes?.data || '';
return res.custom(result);
}
Expand All @@ -335,7 +335,7 @@ export const registerEventAnalyticsRouter = ({
},
};
if (deleteResponse.success) return res.ok(result);
result.statusCode = deleteResponse?.data?.statusCode || 500;
result.statusCode = deleteResponse?.data?.statusCode || 400;
result.message = deleteResponse?.data || '';
return res.custom(result);
}
Expand All @@ -360,7 +360,7 @@ export const registerEventAnalyticsRouter = ({

if (savedRes.success) return res.ok(result);

result.statusCode = savedRes?.data?.statusCode || 500;
result.statusCode = savedRes?.data?.statusCode || 400;
result.message = savedRes?.data || '';
return res.custom(result);
}
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
6 changes: 3 additions & 3 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 Expand Up @@ -157,7 +157,7 @@ export function registerTraceAnalyticsDslRouter(router: IRouter, dataSourceEnabl
addRequestToMetric('trace_analytics', 'get', error);
if (error.statusCode !== 404) console.error(error);
return response.custom({
statusCode: error.statusCode || 500,
statusCode: error.statusCode || 400,
body: error.message,
});
}
Expand Down

0 comments on commit 47a5e78

Please sign in to comment.