system

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnTimedOut = errors.New("connection to state server timed out")
)

Functions

func NewSuperCommand

func NewSuperCommand() cmd.Command

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) Info

func (c *KillCommand) Info() *cmd.Info

Info implements Command.Info.

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.

func (*ListCommand) Info

func (c *ListCommand) Info() *cmd.Info

Info implements Command.Info

func (*ListCommand) Run

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

Run implements Command.Run

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) Info

func (c *LoginCommand) Info() *cmd.Info

Info implements Command.Info

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

func (*RemoveBlocksCommand) Run

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

Run implements Command.Run

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

type UserManager interface {
	SetPassword(username, password string) error
}

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.

Jump to

Keyboard shortcuts

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