Alerting: Rule version history API (#99041)
* implement store method to read rule versions * implement request handler * declare a new endpoint * fix fake to return correct response * add tests * add integration tests * rename history to versions * apply diff from swagger CI step Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com> --------- Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
@@ -550,6 +550,19 @@ func (a *AlertRuleMutators) WithUpdatedBy(uid *UserUID) AlertRuleMutator {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *AlertRuleMutators) WithUID(uid string) AlertRuleMutator {
|
||||
return func(r *AlertRule) {
|
||||
r.UID = uid
|
||||
}
|
||||
}
|
||||
|
||||
func (a *AlertRuleMutators) WithKey(key AlertRuleKey) AlertRuleMutator {
|
||||
return func(r *AlertRule) {
|
||||
r.UID = key.UID
|
||||
r.OrgID = key.OrgID
|
||||
}
|
||||
}
|
||||
|
||||
func (g *AlertRuleGenerator) GenerateLabels(min, max int, prefix string) data.Labels {
|
||||
count := max
|
||||
if min > max {
|
||||
|
||||
Reference in New Issue
Block a user