commands

package
v0.0.0-...-6cf1bc9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2016 License: AGPL-3.0 Imports: 91 Imported by: 0

Documentation

Index

Constants

View Source
const JujuPluginPattern = "^juju-[a-zA-Z]"
View Source
const JujuPluginPrefix = "juju-"
View Source
const PluginTopicText = `` /* 166-byte string literal not displayed */

Variables

Functions

func ConvertActionResults

func ConvertActionResults(result params.ActionResult, query actionQuery) map[string]interface{}

ConvertActionResults takes the results from the api and creates a map suitable for format converstion to YAML or JSON.

func Main

func Main(args []string) int

Main registers subcommands for the juju executable, and hands over control to the cmd package. This function is not redundant with main, because it provides an entry point for testing with arbitrary command line arguments. This function returns the exit code, for main to pass to os.Exit.

func NewAddKeysCommand

func NewAddKeysCommand() cmd.Command

NewAddKeysCommand is used to add a new ssh key to a model.

func NewImportKeysCommand

func NewImportKeysCommand() cmd.Command

NewImportKeysCommand is used to add new authorized ssh keys to a model.

func NewJujuCommand

func NewJujuCommand(ctx *cmd.Context) cmd.Command

NewJujuCommand ...

func NewListKeysCommand

func NewListKeysCommand() cmd.Command

NewListKeysCommand returns a command used to list the authorized ssh keys.

func NewRemoveKeysCommand

func NewRemoveKeysCommand() cmd.Command

NewRemoveKeysCommand is used to delete ssk keys for a user.

func PluginHelpTopic

func PluginHelpTopic() string

func RegisterCommand

func RegisterCommand(newCommand func() cmd.Command)

RegisterCommand adds the provided func to the set of those that will be called when the juju command runs. Each returned command will be registered with the "juju" supercommand.

func RegisterEnvCommand

func RegisterEnvCommand(newCommand func() modelcmd.ModelCommand)

RegisterEnvCommand adds the provided func to the set of those that will be called when the juju command runs. Each returned command will be wrapped in envCmdWrapper, which is what gets registered with the "juju" supercommand.

func RunPlugin

func RunPlugin(ctx *cmd.Context, subcommand string, args []string) error

Types

type BootstrapInterface

type BootstrapInterface interface {
	Bootstrap(ctx environs.BootstrapContext, environ environs.Environ, args bootstrap.BootstrapParams) error
	CloudRegionDetector(environs.EnvironProvider) (environs.CloudRegionDetector, bool)
}

BootstrapInterface provides bootstrap functionality that Run calls to support cleaner testing.

type DebugLogAPI

type DebugLogAPI interface {
	WatchDebugLog(params api.DebugLogParams) (<-chan api.LogMessage, error)
	Close() error
}

type MakeHAClient

type MakeHAClient interface {
	Close() error
	EnableHA(
		numControllers int, cons constraints.Value,
		placement []string) (params.ControllersChanges, error)
}

MakeHAClient defines the methods on the client api that the ensure availability command calls.

type PluginCommand

type PluginCommand struct {
	modelcmd.ModelCommandBase
	// contains filtered or unexported fields
}

func (*PluginCommand) Info

func (*PluginCommand) Info() *cmd.Info

Info is just a stub so that PluginCommand implements cmd.Command. Since this is never actually called, we can happily return nil.

func (*PluginCommand) Init

func (c *PluginCommand) Init(args []string) error

func (*PluginCommand) Run

func (c *PluginCommand) Run(ctx *cmd.Context) error

type PluginDescription

type PluginDescription struct {
	// contains filtered or unexported fields
}

func GetPluginDescriptions

func GetPluginDescriptions() []PluginDescription

GetPluginDescriptions runs each plugin with "--description". The calls to the plugins are run in parallel, so the function should only take as long as the longest call.

type RunClient

type RunClient interface {
	action.APIClient
	RunOnAllMachines(commands string, timeout time.Duration) ([]params.ActionResult, error)
	Run(params.RunParams) ([]params.ActionResult, error)
}

RunClient exposes the capabilities required by the CLI

type SSHCommon

type SSHCommon struct {
	modelcmd.ModelCommandBase

	Target string
	Args   []string
	// contains filtered or unexported fields
}

SSHCommon implements functionality shared by sshCommand, SCPCommand and DebugHooksCommand.

func (*SSHCommon) AllowInterspersedFlags

func (c *SSHCommon) AllowInterspersedFlags() bool

AllowInterspersedFlags for ssh/scp is set to false so that flags after the unit name are passed through to ssh, for eg. `juju ssh -v application-name/0 uname -a`.

func (*SSHCommon) SetFlags

func (c *SSHCommon) SetFlags(f *gnuflag.FlagSet)

type SSHKeysBase

type SSHKeysBase struct {
	modelcmd.ModelCommandBase
}

func (*SSHKeysBase) NewKeyManagerClient

func (c *SSHKeysBase) NewKeyManagerClient() (*keymanager.Client, error)

NewKeyManagerClient returns a keymanager client for the root api endpoint that the environment command returns.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL