AlertingNG: Temp endpoint to translate dashboard alert into rule group (#32694)

* Set NoData and ExecErr states
* make save an option
* TODOs
* adjust interval
* FOR and alertRuleTags not done yet
This commit is contained in:
Kyle Brandt
2021-04-07 14:28:06 +02:00
committed by GitHub
parent 61d3900b54
commit d519913843
4 changed files with 221 additions and 1 deletions
+14
View File
@@ -214,3 +214,17 @@ func toGettableExtendedRuleNode(r ngmodels.AlertRule) apimodels.GettableExtended
},
}
}
func toPostableExtendedRuleNode(r ngmodels.AlertRule) apimodels.PostableExtendedRuleNode {
return apimodels.PostableExtendedRuleNode{
GrafanaManagedAlert: &apimodels.PostableGrafanaRule{
OrgID: r.OrgID,
Title: r.Title,
Condition: r.Condition,
Data: r.Data,
UID: r.UID,
NoDataState: apimodels.NoDataState(r.NoDataState),
ExecErrState: apimodels.ExecutionErrorState(r.ExecErrState),
},
}
}