mirror of
https://github.com/grafana/grafana.git
synced 2025-09-20 07:06:08 +08:00
20 lines
645 B
TypeScript
20 lines
645 B
TypeScript
import { AlertmanagerApiFeatures } from '../../../../types/unified-alerting-dto';
|
|
|
|
import { alertingApi } from './alertingApi';
|
|
import { discoverAlertmanagerFeatures } from './buildInfo';
|
|
|
|
export const featureDiscoveryApi = alertingApi.injectEndpoints({
|
|
endpoints: (build) => ({
|
|
discoverAmFeatures: build.query<AlertmanagerApiFeatures, { amSourceName: string }>({
|
|
queryFn: async ({ amSourceName }) => {
|
|
try {
|
|
const amFeatures = await discoverAlertmanagerFeatures(amSourceName);
|
|
return { data: amFeatures };
|
|
} catch (error) {
|
|
return { error: error };
|
|
}
|
|
},
|
|
}),
|
|
}),
|
|
});
|