2019-04-25 02:06:44 -05:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-06-22 10:49:13 -05:00
|
|
|
|
2019-04-25 02:06:44 -05:00
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
|
|
)
|
|
|
|
|
2020-06-01 10:11:25 -05:00
|
|
|
func (server *HTTPServer) AdminProvisioningReloadDashboards(c *models.ReqContext) Response {
|
2019-04-25 02:06:44 -05:00
|
|
|
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")
|
|
|
|
}
|
|
|
|
|
2020-06-22 10:49:13 -05:00
|
|
|
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")
|
|
|
|
}
|
|
|
|
|
2019-04-25 02:06:44 -05:00
|
|
|
func (server *HTTPServer) AdminProvisioningReloadNotifications(c *models.ReqContext) Response {
|
|
|
|
err := server.ProvisioningService.ProvisionNotifications()
|
|
|
|
if err != nil {
|
|
|
|
return Error(500, "", err)
|
|
|
|
}
|
|
|
|
return Success("Notifications config reloaded")
|
|
|
|
}
|