Alerting: Remove legacy alerting (#83671)

Removes legacy alerting, so long and thanks for all the fish! 🐟

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
Co-authored-by: Sonia Aguilar <soniaAguilarPeiron@users.noreply.github.com>
Co-authored-by: Armand Grillet <armandgrillet@users.noreply.github.com>
Co-authored-by: William Wernert <rwwiv@users.noreply.github.com>
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
Gilles De Mey
2024-03-14 15:36:35 +01:00
committed by GitHub
parent f26344e176
commit 8765c48389
298 changed files with 540 additions and 45125 deletions

View File

@@ -17,7 +17,6 @@ import (
"github.com/grafana/grafana/pkg/services/ngalert/backtesting"
"github.com/grafana/grafana/pkg/services/ngalert/eval"
"github.com/grafana/grafana/pkg/services/ngalert/metrics"
"github.com/grafana/grafana/pkg/services/ngalert/migration"
"github.com/grafana/grafana/pkg/services/ngalert/models"
"github.com/grafana/grafana/pkg/services/ngalert/notifier"
"github.com/grafana/grafana/pkg/services/ngalert/provisioning"
@@ -75,7 +74,6 @@ type API struct {
Historian Historian
Tracer tracing.Tracer
AppUrl *url.URL
UpgradeService migration.UpgradeService
// Hooks can be used to replace API handlers for specific paths.
Hooks *Hooks
@@ -162,13 +160,4 @@ func (api *API) RegisterAPIEndpoints(m *metrics.API) {
receiverService: api.ReceiverService,
muteTimingService: api.MuteTimings,
}), m)
// Inject upgrade endpoints if legacy alerting is enabled and the feature flag is enabled.
if !api.Cfg.UnifiedAlerting.IsEnabled() && api.FeatureManager.IsEnabledGlobally(featuremgmt.FlagAlertingPreviewUpgrade) {
api.RegisterUpgradeApiEndpoints(NewUpgradeApi(NewUpgradeSrc(
logger,
api.UpgradeService,
api.Cfg,
)), m)
}
}

View File

@@ -1,140 +0,0 @@
package api
import (
"errors"
"net/http"
"strconv"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/infra/log"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/services/ngalert/migration"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
)
type UpgradeSrv struct {
log log.Logger
upgradeService migration.UpgradeService
cfg *setting.Cfg
}
func NewUpgradeSrc(
log log.Logger,
upgradeService migration.UpgradeService,
cfg *setting.Cfg,
) *UpgradeSrv {
return &UpgradeSrv{
log: log,
upgradeService: upgradeService,
cfg: cfg,
}
}
func (srv *UpgradeSrv) RoutePostUpgradeOrg(c *contextmodel.ReqContext) response.Response {
summary, err := srv.upgradeService.MigrateOrg(c.Req.Context(), c.OrgID, c.QueryBool("skipExisting"))
if err != nil {
if errors.Is(err, migration.ErrUpgradeInProgress) {
return ErrResp(http.StatusConflict, err, "Upgrade already in progress")
}
return ErrResp(http.StatusInternalServerError, err, "Server error")
}
return response.JSON(http.StatusOK, summary)
}
func (srv *UpgradeSrv) RouteGetOrgUpgrade(c *contextmodel.ReqContext) response.Response {
state, err := srv.upgradeService.GetOrgMigrationState(c.Req.Context(), c.OrgID)
if err != nil {
if errors.Is(err, migration.ErrUpgradeInProgress) {
return ErrResp(http.StatusConflict, err, "Upgrade already in progress")
}
return ErrResp(http.StatusInternalServerError, err, "Server error")
}
return response.JSON(http.StatusOK, state)
}
func (srv *UpgradeSrv) RouteDeleteOrgUpgrade(c *contextmodel.ReqContext) response.Response {
err := srv.upgradeService.RevertOrg(c.Req.Context(), c.OrgID)
if err != nil {
if errors.Is(err, migration.ErrUpgradeInProgress) {
return ErrResp(http.StatusConflict, err, "Upgrade already in progress")
}
return ErrResp(http.StatusInternalServerError, err, "Server error")
}
return response.JSON(http.StatusOK, util.DynMap{"message": "Grafana Alerting resources deleted for this organization."})
}
func (srv *UpgradeSrv) RoutePostUpgradeAlert(c *contextmodel.ReqContext, dashboardIdParam string, panelIdParam string) response.Response {
dashboardId, err := strconv.ParseInt(dashboardIdParam, 10, 64)
if err != nil {
return ErrResp(http.StatusBadRequest, err, "failed to parse dashboardId")
}
panelId, err := strconv.ParseInt(panelIdParam, 10, 64)
if err != nil {
return ErrResp(http.StatusBadRequest, err, "failed to parse panelId")
}
summary, err := srv.upgradeService.MigrateAlert(c.Req.Context(), c.OrgID, dashboardId, panelId)
if err != nil {
if errors.Is(err, migration.ErrUpgradeInProgress) {
return ErrResp(http.StatusConflict, err, "Upgrade already in progress")
}
return ErrResp(http.StatusInternalServerError, err, "Server error")
}
return response.JSON(http.StatusOK, summary)
}
func (srv *UpgradeSrv) RoutePostUpgradeDashboard(c *contextmodel.ReqContext, dashboardIdParam string) response.Response {
dashboardId, err := strconv.ParseInt(dashboardIdParam, 10, 64)
if err != nil {
return ErrResp(http.StatusBadRequest, err, "failed to parse dashboardId")
}
summary, err := srv.upgradeService.MigrateDashboardAlerts(c.Req.Context(), c.OrgID, dashboardId, c.QueryBool("skipExisting"))
if err != nil {
if errors.Is(err, migration.ErrUpgradeInProgress) {
return ErrResp(http.StatusConflict, err, "Upgrade already in progress")
}
return ErrResp(http.StatusInternalServerError, err, "Server error")
}
return response.JSON(http.StatusOK, summary)
}
func (srv *UpgradeSrv) RoutePostUpgradeAllDashboards(c *contextmodel.ReqContext) response.Response {
summary, err := srv.upgradeService.MigrateAllDashboardAlerts(c.Req.Context(), c.OrgID, c.QueryBool("skipExisting"))
if err != nil {
if errors.Is(err, migration.ErrUpgradeInProgress) {
return ErrResp(http.StatusConflict, err, "Upgrade already in progress")
}
return ErrResp(http.StatusInternalServerError, err, "Server error")
}
return response.JSON(http.StatusOK, summary)
}
func (srv *UpgradeSrv) RoutePostUpgradeChannel(c *contextmodel.ReqContext, channelIdParam string) response.Response {
channelId, err := strconv.ParseInt(channelIdParam, 10, 64)
if err != nil {
return ErrResp(http.StatusBadRequest, err, "failed to parse channelId")
}
summary, err := srv.upgradeService.MigrateChannel(c.Req.Context(), c.OrgID, channelId)
if err != nil {
if errors.Is(err, migration.ErrUpgradeInProgress) {
return ErrResp(http.StatusConflict, err, "Upgrade already in progress")
}
return ErrResp(http.StatusInternalServerError, err, "Server error")
}
return response.JSON(http.StatusOK, summary)
}
func (srv *UpgradeSrv) RoutePostUpgradeAllChannels(c *contextmodel.ReqContext) response.Response {
summary, err := srv.upgradeService.MigrateAllChannels(c.Req.Context(), c.OrgID, c.QueryBool("skipExisting"))
if err != nil {
if errors.Is(err, migration.ErrUpgradeInProgress) {
return ErrResp(http.StatusConflict, err, "Upgrade already in progress")
}
return ErrResp(http.StatusInternalServerError, err, "Server error")
}
return response.JSON(http.StatusOK, summary)
}

View File

@@ -64,24 +64,6 @@ func (api *API) authorize(method, path string) web.Handler {
ac.EvalPermission(ac.ActionAlertingReceiversReadSecrets),
)
// Grafana unified alerting upgrade paths
case http.MethodGet + "/api/v1/upgrade/org":
return middleware.ReqOrgAdmin
case http.MethodPost + "/api/v1/upgrade/org":
return middleware.ReqOrgAdmin
case http.MethodDelete + "/api/v1/upgrade/org":
return middleware.ReqOrgAdmin
case http.MethodPost + "/api/v1/upgrade/dashboards":
return middleware.ReqOrgAdmin
case http.MethodPost + "/api/v1/upgrade/dashboards/{DashboardID}":
return middleware.ReqOrgAdmin
case http.MethodPost + "/api/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}":
return middleware.ReqOrgAdmin
case http.MethodPost + "/api/v1/upgrade/channels":
return middleware.ReqOrgAdmin
case http.MethodPost + "/api/v1/upgrade/channels/{ChannelID}":
return middleware.ReqOrgAdmin
// Grafana, Prometheus-compatible Paths
case http.MethodGet + "/api/prometheus/grafana/api/v1/rules":
eval = ac.EvalPermission(ac.ActionAlertingRuleRead)

View File

@@ -40,7 +40,7 @@ func TestAuthorize(t *testing.T) {
}
paths[p] = methods
}
require.Len(t, paths, 64)
require.Len(t, paths, 58)
ac := acmock.New()
api := &API{AccessControl: ac}

View File

@@ -1,163 +0,0 @@
/*Package api contains base API implementation of unified alerting
*
*Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*
*Do not manually edit these files, please find ngalert/api/swagger-codegen/ for commands on how to generate them.
*/
package api
import (
"net/http"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/middleware/requestmeta"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/services/ngalert/metrics"
"github.com/grafana/grafana/pkg/web"
)
type UpgradeApi interface {
RouteDeleteOrgUpgrade(*contextmodel.ReqContext) response.Response
RouteGetOrgUpgrade(*contextmodel.ReqContext) response.Response
RoutePostUpgradeAlert(*contextmodel.ReqContext) response.Response
RoutePostUpgradeAllChannels(*contextmodel.ReqContext) response.Response
RoutePostUpgradeAllDashboards(*contextmodel.ReqContext) response.Response
RoutePostUpgradeChannel(*contextmodel.ReqContext) response.Response
RoutePostUpgradeDashboard(*contextmodel.ReqContext) response.Response
RoutePostUpgradeOrg(*contextmodel.ReqContext) response.Response
}
func (f *UpgradeApiHandler) RouteDeleteOrgUpgrade(ctx *contextmodel.ReqContext) response.Response {
return f.handleRouteDeleteOrgUpgrade(ctx)
}
func (f *UpgradeApiHandler) RouteGetOrgUpgrade(ctx *contextmodel.ReqContext) response.Response {
return f.handleRouteGetOrgUpgrade(ctx)
}
func (f *UpgradeApiHandler) RoutePostUpgradeAlert(ctx *contextmodel.ReqContext) response.Response {
// Parse Path Parameters
dashboardIDParam := web.Params(ctx.Req)[":DashboardID"]
panelIDParam := web.Params(ctx.Req)[":PanelID"]
return f.handleRoutePostUpgradeAlert(ctx, dashboardIDParam, panelIDParam)
}
func (f *UpgradeApiHandler) RoutePostUpgradeAllChannels(ctx *contextmodel.ReqContext) response.Response {
return f.handleRoutePostUpgradeAllChannels(ctx)
}
func (f *UpgradeApiHandler) RoutePostUpgradeAllDashboards(ctx *contextmodel.ReqContext) response.Response {
return f.handleRoutePostUpgradeAllDashboards(ctx)
}
func (f *UpgradeApiHandler) RoutePostUpgradeChannel(ctx *contextmodel.ReqContext) response.Response {
// Parse Path Parameters
channelIDParam := web.Params(ctx.Req)[":ChannelID"]
return f.handleRoutePostUpgradeChannel(ctx, channelIDParam)
}
func (f *UpgradeApiHandler) RoutePostUpgradeDashboard(ctx *contextmodel.ReqContext) response.Response {
// Parse Path Parameters
dashboardIDParam := web.Params(ctx.Req)[":DashboardID"]
return f.handleRoutePostUpgradeDashboard(ctx, dashboardIDParam)
}
func (f *UpgradeApiHandler) RoutePostUpgradeOrg(ctx *contextmodel.ReqContext) response.Response {
return f.handleRoutePostUpgradeOrg(ctx)
}
func (api *API) RegisterUpgradeApiEndpoints(srv UpgradeApi, m *metrics.API) {
api.RouteRegister.Group("", func(group routing.RouteRegister) {
group.Delete(
toMacaronPath("/api/v1/upgrade/org"),
requestmeta.SetOwner(requestmeta.TeamAlerting),
requestmeta.SetSLOGroup(requestmeta.SLOGroupHighSlow),
api.authorize(http.MethodDelete, "/api/v1/upgrade/org"),
metrics.Instrument(
http.MethodDelete,
"/api/v1/upgrade/org",
api.Hooks.Wrap(srv.RouteDeleteOrgUpgrade),
m,
),
)
group.Get(
toMacaronPath("/api/v1/upgrade/org"),
requestmeta.SetOwner(requestmeta.TeamAlerting),
requestmeta.SetSLOGroup(requestmeta.SLOGroupHighSlow),
api.authorize(http.MethodGet, "/api/v1/upgrade/org"),
metrics.Instrument(
http.MethodGet,
"/api/v1/upgrade/org",
api.Hooks.Wrap(srv.RouteGetOrgUpgrade),
m,
),
)
group.Post(
toMacaronPath("/api/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}"),
requestmeta.SetOwner(requestmeta.TeamAlerting),
requestmeta.SetSLOGroup(requestmeta.SLOGroupHighSlow),
api.authorize(http.MethodPost, "/api/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}"),
metrics.Instrument(
http.MethodPost,
"/api/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}",
api.Hooks.Wrap(srv.RoutePostUpgradeAlert),
m,
),
)
group.Post(
toMacaronPath("/api/v1/upgrade/channels"),
requestmeta.SetOwner(requestmeta.TeamAlerting),
requestmeta.SetSLOGroup(requestmeta.SLOGroupHighSlow),
api.authorize(http.MethodPost, "/api/v1/upgrade/channels"),
metrics.Instrument(
http.MethodPost,
"/api/v1/upgrade/channels",
api.Hooks.Wrap(srv.RoutePostUpgradeAllChannels),
m,
),
)
group.Post(
toMacaronPath("/api/v1/upgrade/dashboards"),
requestmeta.SetOwner(requestmeta.TeamAlerting),
requestmeta.SetSLOGroup(requestmeta.SLOGroupHighSlow),
api.authorize(http.MethodPost, "/api/v1/upgrade/dashboards"),
metrics.Instrument(
http.MethodPost,
"/api/v1/upgrade/dashboards",
api.Hooks.Wrap(srv.RoutePostUpgradeAllDashboards),
m,
),
)
group.Post(
toMacaronPath("/api/v1/upgrade/channels/{ChannelID}"),
requestmeta.SetOwner(requestmeta.TeamAlerting),
requestmeta.SetSLOGroup(requestmeta.SLOGroupHighSlow),
api.authorize(http.MethodPost, "/api/v1/upgrade/channels/{ChannelID}"),
metrics.Instrument(
http.MethodPost,
"/api/v1/upgrade/channels/{ChannelID}",
api.Hooks.Wrap(srv.RoutePostUpgradeChannel),
m,
),
)
group.Post(
toMacaronPath("/api/v1/upgrade/dashboards/{DashboardID}"),
requestmeta.SetOwner(requestmeta.TeamAlerting),
requestmeta.SetSLOGroup(requestmeta.SLOGroupHighSlow),
api.authorize(http.MethodPost, "/api/v1/upgrade/dashboards/{DashboardID}"),
metrics.Instrument(
http.MethodPost,
"/api/v1/upgrade/dashboards/{DashboardID}",
api.Hooks.Wrap(srv.RoutePostUpgradeDashboard),
m,
),
)
group.Post(
toMacaronPath("/api/v1/upgrade/org"),
requestmeta.SetOwner(requestmeta.TeamAlerting),
requestmeta.SetSLOGroup(requestmeta.SLOGroupHighSlow),
api.authorize(http.MethodPost, "/api/v1/upgrade/org"),
metrics.Instrument(
http.MethodPost,
"/api/v1/upgrade/org",
api.Hooks.Wrap(srv.RoutePostUpgradeOrg),
m,
),
)
}, middleware.ReqSignedIn)
}

View File

@@ -96,20 +96,6 @@
"title": "AlertManagersResult contains the result from querying the alertmanagers endpoint.",
"type": "object"
},
"AlertPair": {
"properties": {
"alertRule": {
"$ref": "#/definitions/AlertRuleUpgrade"
},
"error": {
"type": "string"
},
"legacyAlert": {
"$ref": "#/definitions/LegacyAlert"
}
},
"type": "object"
},
"AlertQuery": {
"properties": {
"datasourceUid": {
@@ -381,23 +367,6 @@
"title": "AlertRuleNotificationSettingsExport is the provisioned export of models.NotificationSettings.",
"type": "object"
},
"AlertRuleUpgrade": {
"properties": {
"sendsTo": {
"items": {
"type": "string"
},
"type": "array"
},
"title": {
"type": "string"
},
"uid": {
"type": "string"
}
},
"type": "object"
},
"AlertingFileExport": {
"properties": {
"apiVersion": {
@@ -686,20 +655,6 @@
"title": "Config is the top-level configuration for Alertmanager's config files.",
"type": "object"
},
"ContactPair": {
"properties": {
"contactPoint": {
"$ref": "#/definitions/ContactPointUpgrade"
},
"error": {
"type": "string"
},
"legacyChannel": {
"$ref": "#/definitions/LegacyChannel"
}
},
"type": "object"
},
"ContactPointExport": {
"properties": {
"name": {
@@ -719,20 +674,6 @@
"title": "ContactPointExport is the provisioned file export of alerting.ContactPointV1.",
"type": "object"
},
"ContactPointUpgrade": {
"properties": {
"name": {
"type": "string"
},
"routeMatchers": {
"$ref": "#/definitions/ObjectMatchers"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"ContactPoints": {
"items": {
"$ref": "#/definitions/EmbeddedContactPoint"
@@ -745,48 +686,6 @@
"title": "CounterResetHint contains the known information about a counter reset,",
"type": "integer"
},
"DashboardUpgrade": {
"properties": {
"dashboardId": {
"format": "int64",
"type": "integer"
},
"dashboardName": {
"type": "string"
},
"dashboardUid": {
"type": "string"
},
"error": {
"type": "string"
},
"folderName": {
"type": "string"
},
"folderUid": {
"type": "string"
},
"migratedAlerts": {
"items": {
"$ref": "#/definitions/AlertPair"
},
"type": "array"
},
"newFolderName": {
"type": "string"
},
"newFolderUid": {
"type": "string"
},
"provisioned": {
"type": "boolean"
},
"warning": {
"type": "string"
}
},
"type": "object"
},
"DataLink": {
"description": "DataLink define what",
"properties": {
@@ -2075,41 +1974,6 @@
},
"type": "array"
},
"LegacyAlert": {
"properties": {
"dashboardId": {
"format": "int64",
"type": "integer"
},
"id": {
"format": "int64",
"type": "integer"
},
"name": {
"type": "string"
},
"panelId": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"LegacyChannel": {
"properties": {
"id": {
"format": "int64",
"type": "integer"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"LinkTransformationConfig": {
"properties": {
"expression": {
@@ -2501,50 +2365,6 @@
},
"type": "object"
},
"OrgMigrationState": {
"properties": {
"migratedChannels": {
"items": {
"$ref": "#/definitions/ContactPair"
},
"type": "array"
},
"migratedDashboards": {
"items": {
"$ref": "#/definitions/DashboardUpgrade"
},
"type": "array"
},
"orgId": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"OrgMigrationSummary": {
"properties": {
"hasErrors": {
"type": "boolean"
},
"newAlerts": {
"format": "int64",
"type": "integer"
},
"newChannels": {
"format": "int64",
"type": "integer"
},
"newDashboards": {
"format": "int64",
"type": "integer"
},
"removed": {
"type": "boolean"
}
},
"type": "object"
},
"PagerdutyConfig": {
"properties": {
"class": {
@@ -2645,6 +2465,7 @@
"type": "object"
},
"PostableApiAlertingConfig": {
"description": "nolint:revive",
"properties": {
"global": {
"$ref": "#/definitions/GlobalConfig"
@@ -2688,6 +2509,7 @@
"type": "object"
},
"PostableApiReceiver": {
"description": "nolint:revive",
"properties": {
"discord_configs": {
"items": {
@@ -4620,7 +4442,6 @@
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
},
@@ -4781,14 +4602,12 @@
"type": "object"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/definitions/gettableAlert"
},
"type": "array"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"properties": {
"comment": {
"description": "comment",
@@ -4837,6 +4656,7 @@
"type": "object"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
},

View File

@@ -1,189 +0,0 @@
package definitions
// swagger:route GET /v1/upgrade/org upgrade RouteGetOrgUpgrade
//
// Get existing alerting upgrade for the current organization.
//
// Produces:
// - application/json
//
// Responses:
// 200: OrgMigrationState
// swagger:route POST /v1/upgrade/org upgrade RoutePostUpgradeOrg
//
// Upgrade all legacy alerts for the current organization.
//
// Produces:
// - application/json
//
// Responses:
// 200: OrgMigrationSummary
// swagger:route DELETE /v1/upgrade/org upgrade RouteDeleteOrgUpgrade
//
// Delete existing alerting upgrade for the current organization.
//
// Produces:
// - application/json
//
// Responses:
// 200: Ack
// swagger:route POST /v1/upgrade/dashboards/{DashboardID}/panels/{PanelID} upgrade RoutePostUpgradeAlert
//
// Upgrade single legacy dashboard alert for the current organization.
//
// Produces:
// - application/json
//
// Responses:
// 200: OrgMigrationSummary
// swagger:route POST /v1/upgrade/dashboards/{DashboardID} upgrade RoutePostUpgradeDashboard
//
// Upgrade all legacy dashboard alerts on a dashboard for the current organization.
//
// Produces:
// - application/json
//
// Responses:
// 200: OrgMigrationSummary
// swagger:route POST /v1/upgrade/dashboards upgrade RoutePostUpgradeAllDashboards
//
// Upgrade all legacy dashboard alerts for the current organization.
//
// Produces:
// - application/json
//
// Responses:
// 200: OrgMigrationSummary
// swagger:route POST /v1/upgrade/channels upgrade RoutePostUpgradeAllChannels
//
// Upgrade all legacy notification channels for the current organization.
//
// Produces:
// - application/json
//
// Responses:
// 200: OrgMigrationSummary
// swagger:route POST /v1/upgrade/channels/{ChannelID} upgrade RoutePostUpgradeChannel
//
// Upgrade a single legacy notification channel for the current organization.
//
// Produces:
// - application/json
//
// Responses:
// 200: OrgMigrationSummary
// swagger:parameters RoutePostUpgradeOrg RoutePostUpgradeDashboard RoutePostUpgradeAllChannels
type SkipExistingQueryParam struct {
// If true, legacy alert and notification channel upgrades from previous runs will be skipped. Otherwise, they will be replaced.
// in:query
// required:false
// default:false
SkipExisting bool
}
// swagger:parameters RoutePostUpgradeAlert RoutePostUpgradeDashboard
type DashboardParam struct {
// Dashboard ID of dashboard alert.
// in:path
// required:true
DashboardID string
}
// swagger:parameters RoutePostUpgradeAlert
type PanelParam struct {
// Panel ID of dashboard alert.
// in:path
// required:true
PanelID string
}
// swagger:parameters RoutePostUpgradeChannel
type ChannelParam struct {
// Channel ID of legacy notification channel.
// in:path
// required:true
ChannelID string
}
// swagger:model
type OrgMigrationSummary struct {
NewDashboards int `json:"newDashboards"`
NewAlerts int `json:"newAlerts"`
NewChannels int `json:"newChannels"`
Removed bool `json:"removed"`
HasErrors bool `json:"hasErrors"`
}
func (s *OrgMigrationSummary) Add(other OrgMigrationSummary) {
s.NewDashboards += other.NewDashboards
s.NewAlerts += other.NewAlerts
s.NewChannels += other.NewChannels
s.Removed = s.Removed || other.Removed
s.HasErrors = s.HasErrors || other.HasErrors
}
// swagger:model
type OrgMigrationState struct {
OrgID int64 `json:"orgId"`
MigratedDashboards []*DashboardUpgrade `json:"migratedDashboards"`
MigratedChannels []*ContactPair `json:"migratedChannels"`
}
type DashboardUpgrade struct {
MigratedAlerts []*AlertPair `json:"migratedAlerts"`
DashboardID int64 `json:"dashboardId"`
DashboardUID string `json:"dashboardUid"`
DashboardName string `json:"dashboardName"`
FolderUID string `json:"folderUid"`
FolderName string `json:"folderName"`
NewFolderUID string `json:"newFolderUid,omitempty"`
NewFolderName string `json:"newFolderName,omitempty"`
Provisioned bool `json:"provisioned"`
Warning string `json:"warning"`
Error string `json:"error,omitempty"`
}
type AlertPair struct {
LegacyAlert *LegacyAlert `json:"legacyAlert"`
AlertRule *AlertRuleUpgrade `json:"alertRule"`
Error string `json:"error,omitempty"`
}
type ContactPair struct {
LegacyChannel *LegacyChannel `json:"legacyChannel"`
ContactPointUpgrade *ContactPointUpgrade `json:"contactPoint"`
Error string `json:"error,omitempty"`
}
type LegacyAlert struct {
ID int64 `json:"id"`
DashboardID int64 `json:"dashboardId"`
PanelID int64 `json:"panelId"`
Name string `json:"name"`
}
type AlertRuleUpgrade struct {
UID string `json:"uid"`
Title string `json:"title"`
SendsTo []string `json:"sendsTo"`
}
type LegacyChannel struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
}
type ContactPointUpgrade struct {
Name string `json:"name"`
Type string `json:"type"`
RouteMatchers ObjectMatchers `json:"routeMatchers"`
}

View File

@@ -96,20 +96,6 @@
"title": "AlertManagersResult contains the result from querying the alertmanagers endpoint.",
"type": "object"
},
"AlertPair": {
"properties": {
"alertRule": {
"$ref": "#/definitions/AlertRuleUpgrade"
},
"error": {
"type": "string"
},
"legacyAlert": {
"$ref": "#/definitions/LegacyAlert"
}
},
"type": "object"
},
"AlertQuery": {
"properties": {
"datasourceUid": {
@@ -381,23 +367,6 @@
"title": "AlertRuleNotificationSettingsExport is the provisioned export of models.NotificationSettings.",
"type": "object"
},
"AlertRuleUpgrade": {
"properties": {
"sendsTo": {
"items": {
"type": "string"
},
"type": "array"
},
"title": {
"type": "string"
},
"uid": {
"type": "string"
}
},
"type": "object"
},
"AlertingFileExport": {
"properties": {
"apiVersion": {
@@ -686,20 +655,6 @@
"title": "Config is the top-level configuration for Alertmanager's config files.",
"type": "object"
},
"ContactPair": {
"properties": {
"contactPoint": {
"$ref": "#/definitions/ContactPointUpgrade"
},
"error": {
"type": "string"
},
"legacyChannel": {
"$ref": "#/definitions/LegacyChannel"
}
},
"type": "object"
},
"ContactPointExport": {
"properties": {
"name": {
@@ -719,20 +674,6 @@
"title": "ContactPointExport is the provisioned file export of alerting.ContactPointV1.",
"type": "object"
},
"ContactPointUpgrade": {
"properties": {
"name": {
"type": "string"
},
"routeMatchers": {
"$ref": "#/definitions/ObjectMatchers"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"ContactPoints": {
"items": {
"$ref": "#/definitions/EmbeddedContactPoint"
@@ -745,48 +686,6 @@
"title": "CounterResetHint contains the known information about a counter reset,",
"type": "integer"
},
"DashboardUpgrade": {
"properties": {
"dashboardId": {
"format": "int64",
"type": "integer"
},
"dashboardName": {
"type": "string"
},
"dashboardUid": {
"type": "string"
},
"error": {
"type": "string"
},
"folderName": {
"type": "string"
},
"folderUid": {
"type": "string"
},
"migratedAlerts": {
"items": {
"$ref": "#/definitions/AlertPair"
},
"type": "array"
},
"newFolderName": {
"type": "string"
},
"newFolderUid": {
"type": "string"
},
"provisioned": {
"type": "boolean"
},
"warning": {
"type": "string"
}
},
"type": "object"
},
"DataLink": {
"description": "DataLink define what",
"properties": {
@@ -2075,41 +1974,6 @@
},
"type": "array"
},
"LegacyAlert": {
"properties": {
"dashboardId": {
"format": "int64",
"type": "integer"
},
"id": {
"format": "int64",
"type": "integer"
},
"name": {
"type": "string"
},
"panelId": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"LegacyChannel": {
"properties": {
"id": {
"format": "int64",
"type": "integer"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"LinkTransformationConfig": {
"properties": {
"expression": {
@@ -2501,50 +2365,6 @@
},
"type": "object"
},
"OrgMigrationState": {
"properties": {
"migratedChannels": {
"items": {
"$ref": "#/definitions/ContactPair"
},
"type": "array"
},
"migratedDashboards": {
"items": {
"$ref": "#/definitions/DashboardUpgrade"
},
"type": "array"
},
"orgId": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"OrgMigrationSummary": {
"properties": {
"hasErrors": {
"type": "boolean"
},
"newAlerts": {
"format": "int64",
"type": "integer"
},
"newChannels": {
"format": "int64",
"type": "integer"
},
"newDashboards": {
"format": "int64",
"type": "integer"
},
"removed": {
"type": "boolean"
}
},
"type": "object"
},
"PagerdutyConfig": {
"properties": {
"class": {
@@ -2645,6 +2465,7 @@
"type": "object"
},
"PostableApiAlertingConfig": {
"description": "nolint:revive",
"properties": {
"global": {
"$ref": "#/definitions/GlobalConfig"
@@ -2688,6 +2509,7 @@
"type": "object"
},
"PostableApiReceiver": {
"description": "nolint:revive",
"properties": {
"discord_configs": {
"items": {
@@ -4354,7 +4176,6 @@
"type": "object"
},
"URL": {
"description": "The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use the EscapedPath method, which preserves\nthe original encoding of Path.\n\nThe RawPath field is an optional field which is only set when the default\nencoding of Path is different from the escaped path. See the EscapedPath method\nfor more details.\n\nURL's String method uses the EscapedPath method to obtain the path.",
"properties": {
"ForceQuery": {
"type": "boolean"
@@ -4390,7 +4211,7 @@
"$ref": "#/definitions/Userinfo"
}
},
"title": "A URL represents a parsed URL (technically, a URI reference).",
"title": "URL is a custom URL type that allows validation at configuration load time.",
"type": "object"
},
"UpdateRuleGroupResponse": {
@@ -4835,14 +4656,12 @@
"type": "object"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
},
"type": "array"
},
"integration": {
"description": "Integration integration",
"properties": {
"lastNotifyAttempt": {
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
@@ -8481,221 +8300,6 @@
"history"
]
}
},
"/v1/upgrade/channels": {
"post": {
"operationId": "RoutePostUpgradeAllChannels",
"parameters": [
{
"default": false,
"description": "If true, legacy alert and notification channel upgrades from previous runs will be skipped. Otherwise, they will be replaced.",
"in": "query",
"name": "SkipExisting",
"type": "boolean"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
},
"summary": "Upgrade all legacy notification channels for the current organization.",
"tags": [
"upgrade"
]
}
},
"/v1/upgrade/channels/{ChannelID}": {
"post": {
"operationId": "RoutePostUpgradeChannel",
"parameters": [
{
"description": "Channel ID of legacy notification channel.",
"in": "path",
"name": "ChannelID",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
},
"summary": "Upgrade a single legacy notification channel for the current organization.",
"tags": [
"upgrade"
]
}
},
"/v1/upgrade/dashboards": {
"post": {
"operationId": "RoutePostUpgradeAllDashboards",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
},
"summary": "Upgrade all legacy dashboard alerts for the current organization.",
"tags": [
"upgrade"
]
}
},
"/v1/upgrade/dashboards/{DashboardID}": {
"post": {
"operationId": "RoutePostUpgradeDashboard",
"parameters": [
{
"default": false,
"description": "If true, legacy alert and notification channel upgrades from previous runs will be skipped. Otherwise, they will be replaced.",
"in": "query",
"name": "SkipExisting",
"type": "boolean"
},
{
"description": "Dashboard ID of dashboard alert.",
"in": "path",
"name": "DashboardID",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
},
"summary": "Upgrade all legacy dashboard alerts on a dashboard for the current organization.",
"tags": [
"upgrade"
]
}
},
"/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}": {
"post": {
"operationId": "RoutePostUpgradeAlert",
"parameters": [
{
"description": "Dashboard ID of dashboard alert.",
"in": "path",
"name": "DashboardID",
"required": true,
"type": "string"
},
{
"description": "Panel ID of dashboard alert.",
"in": "path",
"name": "PanelID",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
},
"summary": "Upgrade single legacy dashboard alert for the current organization.",
"tags": [
"upgrade"
]
}
},
"/v1/upgrade/org": {
"delete": {
"operationId": "RouteDeleteOrgUpgrade",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Ack",
"schema": {
"$ref": "#/definitions/Ack"
}
}
},
"summary": "Delete existing alerting upgrade for the current organization.",
"tags": [
"upgrade"
]
},
"get": {
"operationId": "RouteGetOrgUpgrade",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OrgMigrationState",
"schema": {
"$ref": "#/definitions/OrgMigrationState"
}
}
},
"summary": "Get existing alerting upgrade for the current organization.",
"tags": [
"upgrade"
]
},
"post": {
"operationId": "RoutePostUpgradeOrg",
"parameters": [
{
"default": false,
"description": "If true, legacy alert and notification channel upgrades from previous runs will be skipped. Otherwise, they will be replaced.",
"in": "query",
"name": "SkipExisting",
"type": "boolean"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
},
"summary": "Upgrade all legacy alerts for the current organization.",
"tags": [
"upgrade"
]
}
}
},
"produces": [

View File

@@ -3387,221 +3387,6 @@
}
}
}
},
"/v1/upgrade/channels": {
"post": {
"produces": [
"application/json"
],
"tags": [
"upgrade"
],
"summary": "Upgrade all legacy notification channels for the current organization.",
"operationId": "RoutePostUpgradeAllChannels",
"parameters": [
{
"type": "boolean",
"default": false,
"description": "If true, legacy alert and notification channel upgrades from previous runs will be skipped. Otherwise, they will be replaced.",
"name": "SkipExisting",
"in": "query"
}
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
}
}
},
"/v1/upgrade/channels/{ChannelID}": {
"post": {
"produces": [
"application/json"
],
"tags": [
"upgrade"
],
"summary": "Upgrade a single legacy notification channel for the current organization.",
"operationId": "RoutePostUpgradeChannel",
"parameters": [
{
"type": "string",
"description": "Channel ID of legacy notification channel.",
"name": "ChannelID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
}
}
},
"/v1/upgrade/dashboards": {
"post": {
"produces": [
"application/json"
],
"tags": [
"upgrade"
],
"summary": "Upgrade all legacy dashboard alerts for the current organization.",
"operationId": "RoutePostUpgradeAllDashboards",
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
}
}
},
"/v1/upgrade/dashboards/{DashboardID}": {
"post": {
"produces": [
"application/json"
],
"tags": [
"upgrade"
],
"summary": "Upgrade all legacy dashboard alerts on a dashboard for the current organization.",
"operationId": "RoutePostUpgradeDashboard",
"parameters": [
{
"type": "boolean",
"default": false,
"description": "If true, legacy alert and notification channel upgrades from previous runs will be skipped. Otherwise, they will be replaced.",
"name": "SkipExisting",
"in": "query"
},
{
"type": "string",
"description": "Dashboard ID of dashboard alert.",
"name": "DashboardID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
}
}
},
"/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}": {
"post": {
"produces": [
"application/json"
],
"tags": [
"upgrade"
],
"summary": "Upgrade single legacy dashboard alert for the current organization.",
"operationId": "RoutePostUpgradeAlert",
"parameters": [
{
"type": "string",
"description": "Dashboard ID of dashboard alert.",
"name": "DashboardID",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Panel ID of dashboard alert.",
"name": "PanelID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
}
}
},
"/v1/upgrade/org": {
"get": {
"produces": [
"application/json"
],
"tags": [
"upgrade"
],
"summary": "Get existing alerting upgrade for the current organization.",
"operationId": "RouteGetOrgUpgrade",
"responses": {
"200": {
"description": "OrgMigrationState",
"schema": {
"$ref": "#/definitions/OrgMigrationState"
}
}
}
},
"post": {
"produces": [
"application/json"
],
"tags": [
"upgrade"
],
"summary": "Upgrade all legacy alerts for the current organization.",
"operationId": "RoutePostUpgradeOrg",
"parameters": [
{
"type": "boolean",
"default": false,
"description": "If true, legacy alert and notification channel upgrades from previous runs will be skipped. Otherwise, they will be replaced.",
"name": "SkipExisting",
"in": "query"
}
],
"responses": {
"200": {
"description": "OrgMigrationSummary",
"schema": {
"$ref": "#/definitions/OrgMigrationSummary"
}
}
}
},
"delete": {
"produces": [
"application/json"
],
"tags": [
"upgrade"
],
"summary": "Delete existing alerting upgrade for the current organization.",
"operationId": "RouteDeleteOrgUpgrade",
"responses": {
"200": {
"description": "Ack",
"schema": {
"$ref": "#/definitions/Ack"
}
}
}
}
}
},
"definitions": {
@@ -3697,20 +3482,6 @@
}
}
},
"AlertPair": {
"type": "object",
"properties": {
"alertRule": {
"$ref": "#/definitions/AlertRuleUpgrade"
},
"error": {
"type": "string"
},
"legacyAlert": {
"$ref": "#/definitions/LegacyAlert"
}
}
},
"AlertQuery": {
"type": "object",
"title": "AlertQuery represents a single query associated with an alert definition.",
@@ -3982,23 +3753,6 @@
}
}
},
"AlertRuleUpgrade": {
"type": "object",
"properties": {
"sendsTo": {
"type": "array",
"items": {
"type": "string"
}
},
"title": {
"type": "string"
},
"uid": {
"type": "string"
}
}
},
"AlertingFileExport": {
"type": "object",
"title": "AlertingFileExport is the full provisioned file export.",
@@ -4287,20 +4041,6 @@
}
}
},
"ContactPair": {
"type": "object",
"properties": {
"contactPoint": {
"$ref": "#/definitions/ContactPointUpgrade"
},
"error": {
"type": "string"
},
"legacyChannel": {
"$ref": "#/definitions/LegacyChannel"
}
}
},
"ContactPointExport": {
"type": "object",
"title": "ContactPointExport is the provisioned file export of alerting.ContactPointV1.",
@@ -4320,20 +4060,6 @@
}
}
},
"ContactPointUpgrade": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"routeMatchers": {
"$ref": "#/definitions/ObjectMatchers"
},
"type": {
"type": "string"
}
}
},
"ContactPoints": {
"type": "array",
"items": {
@@ -4346,48 +4072,6 @@
"format": "uint8",
"title": "CounterResetHint contains the known information about a counter reset,"
},
"DashboardUpgrade": {
"type": "object",
"properties": {
"dashboardId": {
"type": "integer",
"format": "int64"
},
"dashboardName": {
"type": "string"
},
"dashboardUid": {
"type": "string"
},
"error": {
"type": "string"
},
"folderName": {
"type": "string"
},
"folderUid": {
"type": "string"
},
"migratedAlerts": {
"type": "array",
"items": {
"$ref": "#/definitions/AlertPair"
}
},
"newFolderName": {
"type": "string"
},
"newFolderUid": {
"type": "string"
},
"provisioned": {
"type": "boolean"
},
"warning": {
"type": "string"
}
}
},
"DataLink": {
"description": "DataLink define what",
"type": "object",
@@ -5679,41 +5363,6 @@
"$ref": "#/definitions/Label"
}
},
"LegacyAlert": {
"type": "object",
"properties": {
"dashboardId": {
"type": "integer",
"format": "int64"
},
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"panelId": {
"type": "integer",
"format": "int64"
}
}
},
"LegacyChannel": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"LinkTransformationConfig": {
"type": "object",
"properties": {
@@ -6106,50 +5755,6 @@
}
}
},
"OrgMigrationState": {
"type": "object",
"properties": {
"migratedChannels": {
"type": "array",
"items": {
"$ref": "#/definitions/ContactPair"
}
},
"migratedDashboards": {
"type": "array",
"items": {
"$ref": "#/definitions/DashboardUpgrade"
}
},
"orgId": {
"type": "integer",
"format": "int64"
}
}
},
"OrgMigrationSummary": {
"type": "object",
"properties": {
"hasErrors": {
"type": "boolean"
},
"newAlerts": {
"type": "integer",
"format": "int64"
},
"newChannels": {
"type": "integer",
"format": "int64"
},
"newDashboards": {
"type": "integer",
"format": "int64"
},
"removed": {
"type": "boolean"
}
}
},
"PagerdutyConfig": {
"type": "object",
"title": "PagerdutyConfig configures notifications via PagerDuty.",
@@ -6250,6 +5855,7 @@
"type": "object"
},
"PostableApiAlertingConfig": {
"description": "nolint:revive",
"type": "object",
"properties": {
"global": {
@@ -6293,6 +5899,7 @@
}
},
"PostableApiReceiver": {
"description": "nolint:revive",
"type": "object",
"properties": {
"discord_configs": {
@@ -7959,9 +7566,8 @@
}
},
"URL": {
"description": "The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use the EscapedPath method, which preserves\nthe original encoding of Path.\n\nThe RawPath field is an optional field which is only set when the default\nencoding of Path is different from the escaped path. See the EscapedPath method\nfor more details.\n\nURL's String method uses the EscapedPath method to obtain the path.",
"type": "object",
"title": "A URL represents a parsed URL (technically, a URI reference).",
"title": "URL is a custom URL type that allows validation at configuration load time.",
"properties": {
"ForceQuery": {
"type": "boolean"
@@ -8201,7 +7807,6 @@
}
},
"alertGroup": {
"description": "AlertGroup alert group",
"type": "object",
"required": [
"alerts",
@@ -8226,6 +7831,7 @@
"$ref": "#/definitions/alertGroup"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"type": "array",
"items": {
"$ref": "#/definitions/alertGroup"
@@ -8331,6 +7937,7 @@
}
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"type": "object",
"required": [
"labels",
@@ -8395,7 +8002,6 @@
"$ref": "#/definitions/gettableAlerts"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"type": "object",
"required": [
"comment",
@@ -8445,7 +8051,6 @@
"$ref": "#/definitions/gettableSilence"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"type": "array",
"items": {
"$ref": "#/definitions/gettableSilence"
@@ -8636,6 +8241,7 @@
"$ref": "#/definitions/postableSilence"
},
"receiver": {
"description": "Receiver receiver",
"type": "object",
"required": [
"active",

View File

@@ -1,48 +0,0 @@
package api
import (
"github.com/grafana/grafana/pkg/api/response"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
)
type UpgradeApiHandler struct {
svc *UpgradeSrv
}
func NewUpgradeApi(svc *UpgradeSrv) *UpgradeApiHandler {
return &UpgradeApiHandler{
svc: svc,
}
}
func (f *UpgradeApiHandler) handleRoutePostUpgradeOrg(ctx *contextmodel.ReqContext) response.Response {
return f.svc.RoutePostUpgradeOrg(ctx)
}
func (f *UpgradeApiHandler) handleRouteGetOrgUpgrade(ctx *contextmodel.ReqContext) response.Response {
return f.svc.RouteGetOrgUpgrade(ctx)
}
func (f *UpgradeApiHandler) handleRouteDeleteOrgUpgrade(ctx *contextmodel.ReqContext) response.Response {
return f.svc.RouteDeleteOrgUpgrade(ctx)
}
func (f *UpgradeApiHandler) handleRoutePostUpgradeAlert(ctx *contextmodel.ReqContext, dashboardIdParam string, panelIdParam string) response.Response {
return f.svc.RoutePostUpgradeAlert(ctx, dashboardIdParam, panelIdParam)
}
func (f *UpgradeApiHandler) handleRoutePostUpgradeDashboard(ctx *contextmodel.ReqContext, dashboardIdParam string) response.Response {
return f.svc.RoutePostUpgradeDashboard(ctx, dashboardIdParam)
}
func (f *UpgradeApiHandler) handleRoutePostUpgradeAllDashboards(ctx *contextmodel.ReqContext) response.Response {
return f.svc.RoutePostUpgradeAllDashboards(ctx)
}
func (f *UpgradeApiHandler) handleRoutePostUpgradeChannel(ctx *contextmodel.ReqContext, channelIdParam string) response.Response {
return f.svc.RoutePostUpgradeChannel(ctx, channelIdParam)
}
func (f *UpgradeApiHandler) handleRoutePostUpgradeAllChannels(ctx *contextmodel.ReqContext) response.Response {
return f.svc.RoutePostUpgradeAllChannels(ctx)
}