Alerting: Add endpoint to revert to a previous alertmanager configuration (#65751)

* Alerting: Add endpoint to revert to a previous alertmanager configuration

This endpoint is meant to be used in conjunction with /api/alertmanager/grafana/config/history to
revert to a previously applied alertmanager configuration. This is done by ID instead of raw config
string in order to avoid secure field complications.
This commit is contained in:
Matthew Jacobson
2023-04-05 14:10:03 -04:00
committed by GitHub
parent 6c6427e63f
commit 85f738cdf9
16 changed files with 393 additions and 9 deletions
+1
View File
@@ -29,6 +29,7 @@ type AlertingStore interface {
UpdateAlertmanagerConfiguration(ctx context.Context, cmd *models.SaveAlertmanagerConfigurationCmd) error
MarkConfigurationAsApplied(ctx context.Context, cmd *models.MarkConfigurationAsAppliedCmd) error
GetAppliedConfigurations(ctx context.Context, orgID int64, limit int) ([]*models.HistoricAlertConfiguration, error)
GetHistoricalConfiguration(ctx context.Context, orgID int64, id int64) (*models.HistoricAlertConfiguration, error)
}
// DBstore stores the alert definitions and instances in the database.