Documentation ¶
Index ¶
- Constants
- Variables
- func Main(args []string) int
- func NewAddKeysCommand() cmd.Command
- func NewImportKeysCommand() cmd.Command
- func NewJujuCommand(ctx *cmd.Context, jujuMsg string) cmd.Command
- func NewJujuCommandWithStore(ctx *cmd.Context, store jujuclient.ClientStore, log *cmd.Log, ...) cmd.Command
- func NewListKeysCommand() cmd.Command
- func NewRemoveKeysCommand() cmd.Command
- func RunPlugin(callback cmd.MissingCallback) cmd.MissingCallback
- type BootstrapInterface
- type ControllerAPI
- type DebugLogAPI
- type MakeHAClient
- type ModelConfigAPI
- type ModelUpgraderAPI
- type NotFoundCommand
- type PluginCommand
- type PluginDescription
- type SSHKeysBase
- type SyncToolAPI
Constants ¶
const JujuPluginPattern = "^juju-[a-zA-Z]"
const JujuPluginPrefix = "juju-"
Variables ¶
var CheckCanImplicitUpload = checkCanImplicitUpload
For test.
var ErrConnectionClosed = errors.ConstError("connection closed")
ErrConnectionClosed is a sentinel error used to signal that the connection is closed.
var SeverityColor = map[string]*ansiterm.Context{ "TRACE": ansiterm.Foreground(ansiterm.Default), "DEBUG": ansiterm.Foreground(ansiterm.Green), "INFO": ansiterm.Foreground(ansiterm.BrightBlue), "WARNING": ansiterm.Foreground(ansiterm.Yellow), "ERROR": ansiterm.Foreground(ansiterm.BrightRed), "CRITICAL": { Foreground: ansiterm.White, Background: ansiterm.Red, }, }
Functions ¶
func Main ¶
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, jujuMsg string) cmd.Command
NewJujuCommand creates the "juju" super command.
func NewJujuCommandWithStore ¶
func NewJujuCommandWithStore( ctx *cmd.Context, store jujuclient.ClientStore, log *cmd.Log, jujuMsg, helpHint string, whitelist []string, embedded bool, ) cmd.Command
NewJujuCommandWithStore creates the "juju" super command with the specified parameters.
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.
Types ¶
type BootstrapInterface ¶
type BootstrapInterface interface { // Bootstrap bootstraps a controller. Bootstrap(ctx environs.BootstrapContext, environ environs.BootstrapEnviron, callCtx envcontext.ProviderCallContext, args bootstrap.BootstrapParams) error // CloudDetector returns a CloudDetector for the given provider, // if the provider supports it. CloudDetector(environs.EnvironProvider) (environs.CloudDetector, bool) // CloudRegionDetector returns a CloudRegionDetector for the given provider, // if the provider supports it. CloudRegionDetector(environs.EnvironProvider) (environs.CloudRegionDetector, bool) // CloudFinalizer returns a CloudFinalizer for the given provider, // if the provider supports it. CloudFinalizer(environs.EnvironProvider) (environs.CloudFinalizer, bool) }
BootstrapInterface provides bootstrap functionality that Run calls to support cleaner testing.
type ControllerAPI ¶
type ControllerAPI interface { CloudSpec(modelTag names.ModelTag) (environscloudspec.CloudSpec, error) ControllerConfig() (controller.Config, error) ModelConfig() (map[string]interface{}, error) Close() error }
ControllerAPI defines the controller API methods.
type DebugLogAPI ¶
type DebugLogAPI interface { WatchDebugLog(params common.DebugLogParams) (<-chan common.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 ModelConfigAPI ¶
ModelConfigAPI defines the model config API methods.
type ModelUpgraderAPI ¶
type ModelUpgraderAPI interface { UpgradeModel( modelUUID string, targetVersion version.Number, stream string, ignoreAgentVersions, druRun bool, ) (version.Number, error) AbortModelUpgrade(modelUUID string) error UploadTools(r io.ReadSeeker, vers version.Binary) (coretools.List, error) Close() error }
ModelUpgraderAPI defines model upgrader API methods.
type NotFoundCommand ¶
NotFoundCommand gives valuable feedback to the operator about what commands could be available if a mistake around the subcommand name is given.
func (NotFoundCommand) Error ¶
func (c NotFoundCommand) Error() string
type PluginCommand ¶
type PluginCommand struct { cmd.CommandBase // 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
func (*PluginCommand) SetFlags ¶
func (c *PluginCommand) SetFlags(f *gnuflag.FlagSet)
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 SSHKeysBase ¶
type SSHKeysBase struct { modelcmd.ModelCommandBase modelcmd.IAASOnlyCommand }
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.
type SyncToolAPI ¶
type SyncToolAPI interface { UploadTools(r io.ReadSeeker, v version.Binary) (coretools.List, error) Close() error }
SyncToolAPI provides an interface with a subset of the modelupgrader.Client API. This exists to enable mocking.