Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions public/app/features/alerting/unified/api/alertmanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ function getReceiverResultError(receiversResult: TestReceiversResult) {
export async function addAlertManagers(alertManagerConfig: ExternalAlertmanagerConfig): Promise<void> {
await lastValueFrom(
getBackendSrv().fetch({
method: 'POST',
method: 'PUT',
data: alertManagerConfig,
url: '/api/v1/ngalert/admin_config',
url: '/api/v1/provisioning/alert-rules',
showErrorAlert: false,
showSuccessAlert: false,
})
Expand All @@ -263,7 +263,7 @@ export async function fetchExternalAlertmanagerConfig(): Promise<ExternalAlertma
const result = await lastValueFrom(
getBackendSrv().fetch<ExternalAlertmanagerConfig>({
method: 'GET',
url: '/api/v1/ngalert/admin_config',
url: '/api/v1/provisioning/alert-rules',
showErrorAlert: false,
})
);
Expand Down
5 changes: 2 additions & 3 deletions public/app/features/alerting/unified/api/alertmanagerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,16 @@ export const alertmanagerApi = alertingApi.injectEndpoints({
}),

getExternalAlertmanagerConfig: build.query<ExternalAlertmanagerConfig, void>({
query: () => ({ url: '/api/v1/ngalert/admin_config' }),
query: () => ({ url: '/api/v1/provisioning/alert-rules' }),
providesTags: ['AlertmanagerChoice'],
}),

getExternalAlertmanagers: build.query<ExternalAlertmanagers, void>({
query: () => ({ url: '/api/v1/ngalert/alertmanagers' }),
transformResponse: (response: ExternalAlertmanagersResponse) => response.data,
}),

saveExternalAlertmanagersConfig: build.mutation<{ message: string }, ExternalAlertmanagerConfig>({
query: (config) => ({ url: '/api/v1/ngalert/admin_config', method: 'POST', data: config }),
query: (config) => ({ url: '/api/v1/provisioning/alert-rules', method: 'PUT', data: config }),
invalidatesTags: ['AlertmanagerChoice'],
}),

Expand Down