CLI: Allow installing custom binary plugins (#17551)
Make sure all data is sent to API to be able to select correct archive version.
This commit is contained in:
@@ -2,6 +2,8 @@ package utils
|
||||
|
||||
import (
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/grafana/grafana/pkg/cmd/grafana-cli/models"
|
||||
"github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
|
||||
)
|
||||
|
||||
type CommandLine interface {
|
||||
@@ -20,6 +22,13 @@ type CommandLine interface {
|
||||
PluginDirectory() string
|
||||
RepoDirectory() string
|
||||
PluginURL() string
|
||||
ApiClient() ApiClient
|
||||
}
|
||||
|
||||
type ApiClient interface {
|
||||
GetPlugin(pluginId, repoUrl string) (models.Plugin, error)
|
||||
DownloadFile(pluginName, filePath, url string, checksum string) (content []byte, err error)
|
||||
ListAllPlugins(repoUrl string) (models.PluginRepo, error)
|
||||
}
|
||||
|
||||
type ContextCommandLine struct {
|
||||
@@ -57,3 +66,7 @@ func (c *ContextCommandLine) PluginURL() string {
|
||||
func (c *ContextCommandLine) OptionsString() string {
|
||||
return c.GlobalString("configOverrides")
|
||||
}
|
||||
|
||||
func (c *ContextCommandLine) ApiClient() ApiClient {
|
||||
return &services.GrafanaComClient{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user