Alerting: v0 schema for integrations (mimir) (#110908)

* generate schema for mimir integrations from schema on front-end
* review and fix the settings
* Update GetAvailableNotifiersV2 to return mimir as v0
* add version argument to GetSecretKeysForContactPointType
* update TestGetSecretKeysForContactPointType to include v0
* add type alias field to contain alternate types that different from Grafana's
* add support for msteamsv2
* update ConfigForIntegrationType to look for alternate type
* update IntegrationConfigFromType to use new result of ConfigForIntegrationType
* add reference to parent plugin to NotifierPluginVersion to allow getting plugin type by it's alias
* add tests to ensure consistency
* make API response stable
* add tests against snapshot + omit optional fields
This commit is contained in:
Yuri Tseretyan
2025-09-17 09:25:56 -04:00
committed by GitHub
parent a6db37c2b7
commit c36b2ae191
13 changed files with 17112 additions and 110 deletions
+5 -1
View File
@@ -3,6 +3,7 @@ package api
import (
"net/http"
"slices"
"strings"
"github.com/grafana/grafana/pkg/api/response"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
@@ -12,7 +13,10 @@ import (
func (hs *HTTPServer) GetAlertNotifiers() 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()))
v2 := slices.SortedFunc(channels_config.GetAvailableNotifiersV2(), func(a, b *channels_config.VersionedNotifierPlugin) int {
return strings.Compare(a.Type, b.Type)
})
return response.JSON(http.StatusOK, v2)
}
return response.JSON(http.StatusOK, channels_config.GetAvailableNotifiers())
}