mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 03:11:01 -06:00
cc95754e0d
Adds support for enabling app plugins using provisioning. Ref #11409 Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
func (server *HTTPServer) AdminProvisioningReloadDashboards(c *models.ReqContext) Response {
|
|
err := server.ProvisioningService.ProvisionDashboards()
|
|
if err != nil && err != context.Canceled {
|
|
return Error(500, "", err)
|
|
}
|
|
return Success("Dashboards config reloaded")
|
|
}
|
|
|
|
func (server *HTTPServer) AdminProvisioningReloadDatasources(c *models.ReqContext) Response {
|
|
err := server.ProvisioningService.ProvisionDatasources()
|
|
if err != nil {
|
|
return Error(500, "", err)
|
|
}
|
|
return Success("Datasources config reloaded")
|
|
}
|
|
|
|
func (server *HTTPServer) AdminProvisioningReloadPlugins(c *models.ReqContext) Response {
|
|
err := server.ProvisioningService.ProvisionPlugins()
|
|
if err != nil {
|
|
return Error(500, "Failed to reload plugins config", err)
|
|
}
|
|
return Success("Plugins config reloaded")
|
|
}
|
|
|
|
func (server *HTTPServer) AdminProvisioningReloadNotifications(c *models.ReqContext) Response {
|
|
err := server.ProvisioningService.ProvisionNotifications()
|
|
if err != nil {
|
|
return Error(500, "", err)
|
|
}
|
|
return Success("Notifications config reloaded")
|
|
}
|