Alerting: Update remote alertmanager to use extended receivers API. (#89253)
* Alerting: Update remote alertmanager to use extended receivers API. * Update integration test and Mimir image * Update Mimir image in more places
This commit is contained in:
@@ -11,7 +11,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
grafanaAlertmanagerConfigPath = "/api/v1/grafana/config"
|
||||
grafanaAlertmanagerConfigPath = "/api/v1/grafana/config"
|
||||
grafanaAlertmanagerReceiversPath = "/api/v1/grafana/receivers"
|
||||
)
|
||||
|
||||
type UserGrafanaConfig struct {
|
||||
@@ -63,3 +64,16 @@ func (mc *Mimir) CreateGrafanaAlertmanagerConfig(ctx context.Context, cfg *apimo
|
||||
func (mc *Mimir) DeleteGrafanaAlertmanagerConfig(ctx context.Context) error {
|
||||
return mc.doOK(ctx, grafanaAlertmanagerConfigPath, http.MethodDelete, nil)
|
||||
}
|
||||
|
||||
func (mc *Mimir) GetReceivers(ctx context.Context) ([]apimodels.Receiver, error) {
|
||||
response := []apimodels.Receiver{}
|
||||
|
||||
// nolint:bodyclose
|
||||
// closed within `do`
|
||||
_, err := mc.do(ctx, grafanaAlertmanagerReceiversPath, http.MethodGet, nil, &response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ type MimirClient interface {
|
||||
DeleteGrafanaAlertmanagerConfig(ctx context.Context) error
|
||||
|
||||
ShouldPromoteConfig() bool
|
||||
|
||||
// Mimir implements an extended version of the receivers API under a different path.
|
||||
GetReceivers(ctx context.Context) ([]apimodels.Receiver, error)
|
||||
}
|
||||
|
||||
type Mimir struct {
|
||||
|
||||
Reference in New Issue
Block a user