Alerting: Add provenance field to /api/v1/provisioning/alert-rules (#76252)
This commit adds the missing Provenance field to responses for /api/v1/provisioning/alert-rules.
This commit is contained in:
@@ -57,7 +57,7 @@ type MuteTimingService interface {
|
||||
}
|
||||
|
||||
type AlertRuleService interface {
|
||||
GetAlertRules(ctx context.Context, orgID int64) ([]*alerting_models.AlertRule, error)
|
||||
GetAlertRules(ctx context.Context, orgID int64) ([]*alerting_models.AlertRule, map[string]alerting_models.Provenance, error)
|
||||
GetAlertRule(ctx context.Context, orgID int64, ruleUID string) (alerting_models.AlertRule, alerting_models.Provenance, error)
|
||||
CreateAlertRule(ctx context.Context, rule alerting_models.AlertRule, provenance alerting_models.Provenance, userID int64) (alerting_models.AlertRule, error)
|
||||
UpdateAlertRule(ctx context.Context, rule alerting_models.AlertRule, provenance alerting_models.Provenance) (alerting_models.AlertRule, error)
|
||||
@@ -300,11 +300,11 @@ func (srv *ProvisioningSrv) RouteDeleteMuteTiming(c *contextmodel.ReqContext, na
|
||||
}
|
||||
|
||||
func (srv *ProvisioningSrv) RouteGetAlertRules(c *contextmodel.ReqContext) response.Response {
|
||||
rules, err := srv.alertRules.GetAlertRules(c.Req.Context(), c.SignedInUser.GetOrgID())
|
||||
rules, provenances, err := srv.alertRules.GetAlertRules(c.Req.Context(), c.SignedInUser.GetOrgID())
|
||||
if err != nil {
|
||||
return ErrResp(http.StatusInternalServerError, err, "")
|
||||
}
|
||||
return response.JSON(http.StatusOK, ProvisionedAlertRuleFromAlertRules(rules))
|
||||
return response.JSON(http.StatusOK, ProvisionedAlertRuleFromAlertRules(rules, provenances))
|
||||
}
|
||||
|
||||
func (srv *ProvisioningSrv) RouteRouteGetAlertRule(c *contextmodel.ReqContext, UID string) response.Response {
|
||||
|
||||
Reference in New Issue
Block a user