Alerting: Return merged extra configurations in the API (#109636)

This commit is contained in:
Alexander Akhmetov
2025-08-14 07:46:12 +02:00
committed by GitHub
parent 7d7721e30a
commit e165a490b4
9 changed files with 214 additions and 146 deletions
+10
View File
@@ -1053,6 +1053,16 @@ func (a apiClient) GetAlertmanagerConfigWithStatus(t *testing.T) (apimodels.Gett
return sendRequestJSON[apimodels.GettableUserConfig](t, req, http.StatusOK)
}
func (a apiClient) GetAlertmanagerConfigForDatasource(t *testing.T, datasourceUID string) apimodels.GettableUserConfig {
t.Helper()
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/api/alertmanager/%s/config/api/v1/alerts", a.url, datasourceUID), nil)
require.NoError(t, err)
config, status, body := sendRequestJSON[apimodels.GettableUserConfig](t, req, http.StatusOK)
requireStatusCode(t, http.StatusOK, status, body)
return config
}
func (a apiClient) GetActiveAlertsWithStatus(t *testing.T) (apimodels.AlertGroups, int, string) {
t.Helper()
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/api/alertmanager/grafana/api/v2/alerts/groups", a.url), nil)