Alerting: Separate overlapping legacy and UA alerting routes (#76517)
* Separate overlapping legacy and UA alerting routes api/alert-notifiers, alerting/list, and alerting/notifications existed in both legacy and UA. Rename legacy route paths and nav ids to be independent of UA ones.
This commit is contained in:
+7
-6
@@ -239,17 +239,18 @@ func (hs *HTTPServer) GetAlert(c *contextmodel.ReqContext) response.Response {
|
||||
return response.JSON(http.StatusOK, &res)
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) GetAlertNotifiers(ngalertEnabled bool) func(*contextmodel.ReqContext) response.Response {
|
||||
func (hs *HTTPServer) GetLegacyAlertNotifiers() func(*contextmodel.ReqContext) response.Response {
|
||||
return func(_ *contextmodel.ReqContext) response.Response {
|
||||
if ngalertEnabled {
|
||||
return response.JSON(http.StatusOK, channels_config.GetAvailableNotifiers())
|
||||
}
|
||||
// TODO(codesome): This wont be required in 8.0 since ngalert
|
||||
// will be enabled by default with no disabling. This is to be removed later.
|
||||
return response.JSON(http.StatusOK, alerting.GetNotifiers())
|
||||
}
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) GetAlertNotifiers() func(*contextmodel.ReqContext) response.Response {
|
||||
return func(_ *contextmodel.ReqContext) response.Response {
|
||||
return response.JSON(http.StatusOK, channels_config.GetAvailableNotifiers())
|
||||
}
|
||||
}
|
||||
|
||||
// swagger:route GET /alert-notifications/lookup legacy_alerts_notification_channels getAlertNotificationLookup
|
||||
//
|
||||
// Get all notification channels (lookup).
|
||||
|
||||
Reference in New Issue
Block a user