Alerting: Update integration schema to support versions (#109969)
* add VersionedNotifierPlugin and method that converts NotifierPlugin to it * return new schema if query parameter version=2 * add version to k8s model of integration * fix open api snapshot * add version to IntegrationConfig * use current version on conversion * create versioned integrations for test
This commit is contained in:
+5
-1
@@ -2,6 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"slices"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
||||
@@ -9,7 +10,10 @@ import (
|
||||
)
|
||||
|
||||
func (hs *HTTPServer) GetAlertNotifiers() func(*contextmodel.ReqContext) response.Response {
|
||||
return func(_ *contextmodel.ReqContext) response.Response {
|
||||
return func(r *contextmodel.ReqContext) response.Response {
|
||||
if r.Query("version") == "2" {
|
||||
return response.JSON(http.StatusOK, slices.Collect(channels_config.GetAvailableNotifiersV2()))
|
||||
}
|
||||
return response.JSON(http.StatusOK, channels_config.GetAvailableNotifiers())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user