Documentation ¶
Index ¶
- Variables
- func NewSuperCommand() cmd.Command
- type CreateEnvironmentAPI
- type CreateEnvironmentCommand
- type DestroyCommand
- type DestroyCommandBase
- type EnvironmentsCommand
- type EnvironmentsEnvAPI
- type EnvironmentsSysAPI
- type GetUserManagerFunc
- type KillCommand
- type ListBlocksCommand
- type ListCommand
- type LoginCommand
- type RemoveBlocksCommand
- type UseEnvironmentAPI
- type UseEnvironmentCommand
- type UserEnvironment
- type UserManager
Constants ¶
This section is empty.
Variables ¶
var (
ErrConnTimedOut = errors.New("connection to state server timed out")
)
Functions ¶
func NewSuperCommand ¶
NewSuperCommand creates the system supercommand and registers the subcommands that it supports.
Types ¶
type CreateEnvironmentAPI ¶
type CreateEnvironmentAPI interface { Close() error ConfigSkeleton(provider, region string) (params.EnvironConfig, error) CreateEnvironment(owner string, account, config map[string]interface{}) (params.Environment, error) }
type CreateEnvironmentCommand ¶
type CreateEnvironmentCommand struct { envcmd.SysCommandBase // contains filtered or unexported fields }
CreateEnvironmentCommand calls the API to create a new environment.
func (*CreateEnvironmentCommand) Info ¶
func (c *CreateEnvironmentCommand) Info() *cmd.Info
func (*CreateEnvironmentCommand) Init ¶
func (c *CreateEnvironmentCommand) Init(args []string) error
func (*CreateEnvironmentCommand) Run ¶
func (c *CreateEnvironmentCommand) Run(ctx *cmd.Context) (return_err error)
func (*CreateEnvironmentCommand) SetFlags ¶
func (c *CreateEnvironmentCommand) SetFlags(f *gnuflag.FlagSet)
type DestroyCommand ¶
type DestroyCommand struct { DestroyCommandBase // contains filtered or unexported fields }
DestroyCommand destroys the specified system.
func (*DestroyCommand) Info ¶
func (c *DestroyCommand) Info() *cmd.Info
Info implements Command.Info.
func (*DestroyCommand) Run ¶
func (c *DestroyCommand) Run(ctx *cmd.Context) error
Run implements Command.Run
func (*DestroyCommand) SetFlags ¶
func (c *DestroyCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type DestroyCommandBase ¶
type DestroyCommandBase struct { envcmd.SysCommandBase // contains filtered or unexported fields }
DestroyCommandBase provides common attributes and methods that both the system destroy and system kill commands require.
func (*DestroyCommandBase) Init ¶
func (c *DestroyCommandBase) Init(args []string) error
Init implements Command.Init.
func (*DestroyCommandBase) SetFlags ¶
func (c *DestroyCommandBase) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type EnvironmentsCommand ¶
type EnvironmentsCommand struct { envcmd.SysCommandBase // contains filtered or unexported fields }
EnvironmentsCommand returns the list of all the environments the current user can access on the current system.
func (*EnvironmentsCommand) Info ¶
func (c *EnvironmentsCommand) Info() *cmd.Info
Info implements Command.Info
func (*EnvironmentsCommand) Run ¶
func (c *EnvironmentsCommand) Run(ctx *cmd.Context) error
Run implements Command.Run
func (*EnvironmentsCommand) SetFlags ¶
func (c *EnvironmentsCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type EnvironmentsEnvAPI ¶
type EnvironmentsEnvAPI interface { Close() error ListEnvironments(user string) ([]base.UserEnvironment, error) }
EnvironmentsEnvAPI defines the methods on the environment manager API that the environments command calls.
type EnvironmentsSysAPI ¶
type EnvironmentsSysAPI interface { Close() error AllEnvironments() ([]base.UserEnvironment, error) }
EnvironmentsSysAPI defines the methods on the system manager API that the environments command calls.
type GetUserManagerFunc ¶
type GetUserManagerFunc func(conn api.Connection) (UserManager, error)
GetUserManagerFunc defines a function that takes an api connection and returns the (locally defined) UserManager interface.
type KillCommand ¶
type KillCommand struct { DestroyCommandBase // contains filtered or unexported fields }
KillCommand kills the specified system.
func (*KillCommand) Init ¶
func (c *KillCommand) Init(args []string) error
Init implements Command.Init.
func (*KillCommand) Run ¶
func (c *KillCommand) Run(ctx *cmd.Context) error
Run implements Command.Run
func (*KillCommand) SetFlags ¶
func (c *KillCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type ListBlocksCommand ¶
type ListBlocksCommand struct { envcmd.SysCommandBase // contains filtered or unexported fields }
ListBlocksCommand lists all blocks for environments within the system.
func (*ListBlocksCommand) Info ¶
func (c *ListBlocksCommand) Info() *cmd.Info
Info implements Command.Info.
func (*ListBlocksCommand) Run ¶
func (c *ListBlocksCommand) Run(ctx *cmd.Context) error
Run implements Command.Run
func (*ListBlocksCommand) SetFlags ¶
func (c *ListBlocksCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type ListCommand ¶
type ListCommand struct { cmd.CommandBase // contains filtered or unexported fields }
ListCommand returns the list of all systems the user is currently logged in to on the current machine.
type LoginCommand ¶
type LoginCommand struct { cmd.CommandBase // TODO (thumper): when we support local cert definitions // allow the use to specify the user and server address. // user string // address string Server cmd.FileVar Name string KeepPassword bool // contains filtered or unexported fields }
LoginCommand logs in to a Juju system and caches the connection information.
func (*LoginCommand) Init ¶
func (c *LoginCommand) Init(args []string) error
SetFlags implements Command.Init.
func (*LoginCommand) Run ¶
func (c *LoginCommand) Run(ctx *cmd.Context) error
Run implements Command.Run
func (*LoginCommand) SetFlags ¶
func (c *LoginCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type RemoveBlocksCommand ¶
type RemoveBlocksCommand struct { envcmd.SysCommandBase // contains filtered or unexported fields }
RemoveBlocksCommand returns the list of all systems the user is currently logged in to on the current machine.
func (*RemoveBlocksCommand) Info ¶
func (c *RemoveBlocksCommand) Info() *cmd.Info
Info implements Command.Info
type UseEnvironmentAPI ¶
type UseEnvironmentAPI interface { Close() error ListEnvironments(user string) ([]base.UserEnvironment, error) }
UseEnvironmentAPI defines the methods on the environment manager API that the use environment command calls.
type UseEnvironmentCommand ¶
type UseEnvironmentCommand struct { envcmd.SysCommandBase LocalName string Owner string EnvName string EnvUUID string // contains filtered or unexported fields }
UseEnvironmentCommand returns the list of all the environments the current user can access on the current system.
func (*UseEnvironmentCommand) Info ¶
func (c *UseEnvironmentCommand) Info() *cmd.Info
Info implements Command.Info
func (*UseEnvironmentCommand) Init ¶
func (c *UseEnvironmentCommand) Init(args []string) error
SetFlags implements Command.Init.
func (*UseEnvironmentCommand) Run ¶
func (c *UseEnvironmentCommand) Run(ctx *cmd.Context) error
Run implements Command.Run
func (*UseEnvironmentCommand) SetFlags ¶
func (c *UseEnvironmentCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type UserEnvironment ¶
type UserEnvironment struct { Name string `json:"name"` UUID string `json:"env-uuid" yaml:"env-uuid"` Owner string `json:"owner"` LastConnection string `json:"last-connection" yaml:"last-connection"` }
Local structure that controls the output structure.
type UserManager ¶
UserManager defines the calls that the Login command makes to the user manager client. It is returned by a helper function that is overridden in tests.