Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-12710: API breaking changes #1594

Merged
merged 14 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const getExample = async ({
tables,
};

return apiRequestQAN.post<QueryExampleResponse, any>('/ObjectDetails/GetQueryExample', data);
return apiRequestQAN.post<QueryExampleResponse, any>('/v1/qan/query:getExample', data);
YashSartanpara1 marked this conversation as resolved.
Show resolved Hide resolved
};

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const getMetrics = async ({
totals,
};

return apiRequestQAN.post<any, any>('/ObjectDetails/GetMetrics', body);
return apiRequestQAN.post<any, any>('/v1/qan:getMetrics', body);
};

export const getHistogram = async ({
Expand All @@ -28,7 +28,7 @@ export const getHistogram = async ({
period_start_to: to,
};

return apiRequestQAN.post<HistogramResponse, HistogramRequest>('/ObjectDetails/GetHistogram', body);
return apiRequestQAN.post<HistogramResponse, HistogramRequest>('/v1/qan:getHistogram', body);
};

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const PlanService = {
};

return apiRequestQAN
.post<QueryPlanResponse, QueryPlanRequest>('/ObjectDetails/GetQueryPlan', body)
.get<QueryPlanResponse, QueryPlanRequest>(`/v1/qan/query/${body.queryid}/plan`)
.then(({ planid, query_plan }) => (
planid && query_plan ? { id: planid, plan: query_plan } : undefined
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const markCheckedLabels = (labels, paramLabels) => {

export default {
getQueryOverviewFiltersList: async (paramLabels, from, to, mainMetric) => {
const { labels } = await apiRequestQAN.post<any, any>('/Filters/Get', {
const { labels } = await apiRequestQAN.post<any, any>('/v1/qan/metrics:getFilters', {
labels: getLabelQueryParams(paramLabels),
main_metric_name: mainMetric,
period_start_from: from,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export default {
search: body.dimensionSearchText,
};

return apiRequestQAN.post<any, any>('/GetReport', request);
return apiRequestQAN.post<any, any>('/v1/qan/metrics:getReport', request);
},
};
2 changes: 1 addition & 1 deletion pmm-app/src/shared/components/Actions/Actions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { ActionRequest, ActionResponse } from './Actions.types';

export const ActionsService = {
getActionResult(body: ActionRequest): Promise<ActionResponse> {
return apiRequestManagement.post<any, any>('/Actions/Get', body);
return apiRequestManagement.get<any, any>(`/v1/actions/${body.action_id}`);
},
};
9 changes: 3 additions & 6 deletions setup-page/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ export function App() {
setLoading(true);

try {
const response = await fetch('/v1/AWSInstanceCheck', {
method: 'POST',
const response = await fetch(`/v1/server/AWSInstance?instance_id${instanceId.trim()}`, {
matejkubinec marked this conversation as resolved.
Show resolved Hide resolved
method: 'GET',
credentials: "include",
cache: "no-cache",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
instance_id: instanceId.trim(),
}),
}
});

if (!response.ok) {
Expand Down