Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertRunResults(runResults []params.RunResult) interface{}
- func Main(args []string)
- func NewAuthorizedKeysCommand() cmd.Command
- func NewJujuCommand(ctx *cmd.Context) cmd.Command
- func PluginHelpTopic() string
- func RunPlugin(ctx *cmd.Context, subcommand string, args []string) error
- type APIInfoCommand
- type AddKeysCommand
- type AddRelationCommand
- type AuthorizedKeysBase
- type AuthorizedKeysCommand
- type BootstrapCommand
- func (c *BootstrapCommand) Info() *cmd.Info
- func (c *BootstrapCommand) Init(args []string) (err error)
- func (c *BootstrapCommand) Run(ctx *cmd.Context) (resultErr error)
- func (c *BootstrapCommand) SetBootstrapEndpointAddress(environ environs.Environ) error
- func (c *BootstrapCommand) SetFlags(f *gnuflag.FlagSet)
- type BootstrapInterface
- type DebugHooksCommand
- type DebugLogAPI
- type DebugLogCommand
- type DeleteKeysCommand
- type DeployCommand
- type DestroyEnvironmentCommand
- type EndpointCommand
- type EnsureAvailabilityClient
- type EnsureAvailabilityCommand
- type ExposeCommand
- type GetCommand
- type HelpToolCommand
- type ImportKeysCommand
- type InfoData
- type InitCommand
- type ListKeysCommand
- type PluginCommand
- type PluginDescription
- type PublishCommand
- func (c *PublishCommand) ChangePushLocation(change func(string) string)
- func (c *PublishCommand) Info() *cmd.Info
- func (c *PublishCommand) Init(args []string) error
- func (c *PublishCommand) Run(ctx *cmd.Context) (err error)
- func (c *PublishCommand) SetFlags(f *gnuflag.FlagSet)
- func (c *PublishCommand) SetPollDelay(delay time.Duration)
- type RemoveRelationCommand
- type RemoveServiceCommand
- type RemoveUnitCommand
- type ResolvedCommand
- type RunClient
- type RunCommand
- type SCPCommand
- type SSHCommand
- type SSHCommon
- type SwitchCommand
- type SyncToolsCommand
- type UnexposeCommand
- type UpgradeCharmCommand
- type UpgradeJujuCommand
Constants ¶
const JujuPluginPrefix = "juju-"
const PluginTopicText = `` /* 166-byte string literal not displayed */
Variables ¶
var DefaultLogLocation = "/var/log/juju/all-machines.log"
var DoubleEnvironmentError = stderrors.New("you cannot supply both -e and the envname as a positional argument")
var NoEnvironmentError = stderrors.New("no environment specified")
Functions ¶
func ConvertRunResults ¶
ConvertRunResults takes the results from the api and creates a map suitable for format converstion to YAML or JSON.
func Main ¶
func Main(args []string)
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.
func PluginHelpTopic ¶
func PluginHelpTopic() string
Types ¶
type APIInfoCommand ¶
type APIInfoCommand struct { envcmd.EnvCommandBase // contains filtered or unexported fields }
APIInfoCommand returns the fields used to connect to an API server.
func (*APIInfoCommand) Info ¶
func (c *APIInfoCommand) Info() *cmd.Info
func (*APIInfoCommand) Init ¶
func (c *APIInfoCommand) Init(args []string) error
func (*APIInfoCommand) Run ¶
func (c *APIInfoCommand) Run(ctx *cmd.Context) error
Print out the addresses of the API server endpoints.
func (*APIInfoCommand) SetFlags ¶
func (c *APIInfoCommand) SetFlags(f *gnuflag.FlagSet)
type AddKeysCommand ¶
type AddKeysCommand struct { AuthorizedKeysBase // contains filtered or unexported fields }
AddKeysCommand is used to add a new authorized ssh key for a user.
func (*AddKeysCommand) Info ¶
func (c *AddKeysCommand) Info() *cmd.Info
func (*AddKeysCommand) Init ¶
func (c *AddKeysCommand) Init(args []string) error
func (*AddKeysCommand) SetFlags ¶
func (c *AddKeysCommand) SetFlags(f *gnuflag.FlagSet)
type AddRelationCommand ¶
type AddRelationCommand struct { envcmd.EnvCommandBase Endpoints []string }
AddRelationCommand adds a relation between two service endpoints.
func (*AddRelationCommand) Info ¶
func (c *AddRelationCommand) Info() *cmd.Info
func (*AddRelationCommand) Init ¶
func (c *AddRelationCommand) Init(args []string) error
type AuthorizedKeysBase ¶
type AuthorizedKeysBase struct {
envcmd.EnvCommandBase
}
func (*AuthorizedKeysBase) NewKeyManagerClient ¶
func (c *AuthorizedKeysBase) NewKeyManagerClient() (*keymanager.Client, error)
NewKeyManagerClient returns a keymanager client for the root api endpoint that the environment command returns.
type AuthorizedKeysCommand ¶
type AuthorizedKeysCommand struct {
*cmd.SuperCommand
}
func (*AuthorizedKeysCommand) SetFlags ¶
func (c *AuthorizedKeysCommand) SetFlags(f *gnuflag.FlagSet)
type BootstrapCommand ¶
type BootstrapCommand struct { envcmd.EnvCommandBase Constraints constraints.Value UploadTools bool Series []string MetadataSource string Placement string KeepBrokenEnvironment bool NoAutoUpgrade bool AgentVersionParam string AgentVersion *version.Number // contains filtered or unexported fields }
BootstrapCommand is responsible for launching the first machine in a juju environment, and setting up everything necessary to continue working.
func (*BootstrapCommand) Info ¶
func (c *BootstrapCommand) Info() *cmd.Info
func (*BootstrapCommand) Init ¶
func (c *BootstrapCommand) Init(args []string) (err error)
func (*BootstrapCommand) Run ¶
func (c *BootstrapCommand) Run(ctx *cmd.Context) (resultErr error)
Run connects to the environment specified on the command line and bootstraps a juju in that environment if none already exists. If there is as yet no environments.yaml file, the user is informed how to create one.
func (*BootstrapCommand) SetBootstrapEndpointAddress ¶
func (c *BootstrapCommand) SetBootstrapEndpointAddress(environ environs.Environ) error
SetBootstrapEndpointAddress writes the API endpoint address of the bootstrap server into the connection information. This should only be run once directly after Bootstrap. It assumes that there is just one instance in the environment - the bootstrap instance.
func (*BootstrapCommand) SetFlags ¶
func (c *BootstrapCommand) SetFlags(f *gnuflag.FlagSet)
type BootstrapInterface ¶
type BootstrapInterface interface { EnsureNotBootstrapped(env environs.Environ) error Bootstrap(ctx environs.BootstrapContext, environ environs.Environ, args bootstrap.BootstrapParams) error }
bootstrap functionality that Run calls to support cleaner testing
type DebugHooksCommand ¶
type DebugHooksCommand struct { SSHCommand // contains filtered or unexported fields }
DebugHooksCommand is responsible for launching a ssh shell on a given unit or machine.
func (*DebugHooksCommand) Info ¶
func (c *DebugHooksCommand) Info() *cmd.Info
func (*DebugHooksCommand) Init ¶
func (c *DebugHooksCommand) Init(args []string) error
type DebugLogAPI ¶
type DebugLogAPI interface { WatchDebugLog(params api.DebugLogParams) (io.ReadCloser, error) Close() error }
type DebugLogCommand ¶
type DebugLogCommand struct { envcmd.EnvCommandBase // contains filtered or unexported fields }
func (*DebugLogCommand) Info ¶
func (c *DebugLogCommand) Info() *cmd.Info
func (*DebugLogCommand) Init ¶
func (c *DebugLogCommand) Init(args []string) error
func (*DebugLogCommand) Run ¶
func (c *DebugLogCommand) Run(ctx *cmd.Context) (err error)
Run retrieves the debug log via the API.
func (*DebugLogCommand) SetFlags ¶
func (c *DebugLogCommand) SetFlags(f *gnuflag.FlagSet)
type DeleteKeysCommand ¶
type DeleteKeysCommand struct { AuthorizedKeysBase // contains filtered or unexported fields }
DeleteKeysCommand is used to delete authorised ssh keys for a user.
func (*DeleteKeysCommand) Info ¶
func (c *DeleteKeysCommand) Info() *cmd.Info
func (*DeleteKeysCommand) Init ¶
func (c *DeleteKeysCommand) Init(args []string) error
func (*DeleteKeysCommand) SetFlags ¶
func (c *DeleteKeysCommand) SetFlags(f *gnuflag.FlagSet)
type DeployCommand ¶
type DeployCommand struct { envcmd.EnvCommandBase service.UnitCommandBase CharmName string ServiceName string Config cmd.FileVar Constraints constraints.Value Networks string // TODO(dimitern): Drop this in a follow-up and fix docs. BumpRevision bool // Remove this once the 1.16 support is dropped. RepoPath string // defaults to JUJU_REPOSITORY RegisterURL string // TODO(axw) move this to UnitCommandBase once we support --storage // on add-unit too. // // Storage is a map of storage constraints, keyed on the storage name // defined in charm storage metadata. Storage map[string]storage.Constraints }
func (*DeployCommand) Info ¶
func (c *DeployCommand) Info() *cmd.Info
func (*DeployCommand) Init ¶
func (c *DeployCommand) Init(args []string) error
func (*DeployCommand) SetFlags ¶
func (c *DeployCommand) SetFlags(f *gnuflag.FlagSet)
type DestroyEnvironmentCommand ¶
type DestroyEnvironmentCommand struct { envcmd.EnvCommandBase cmd.CommandBase // contains filtered or unexported fields }
DestroyEnvironmentCommand destroys an environment.
func (*DestroyEnvironmentCommand) Info ¶
func (c *DestroyEnvironmentCommand) Info() *cmd.Info
func (*DestroyEnvironmentCommand) Init ¶
func (c *DestroyEnvironmentCommand) Init(args []string) error
func (*DestroyEnvironmentCommand) Run ¶
func (c *DestroyEnvironmentCommand) Run(ctx *cmd.Context) (result error)
func (*DestroyEnvironmentCommand) SetFlags ¶
func (c *DestroyEnvironmentCommand) SetFlags(f *gnuflag.FlagSet)
type EndpointCommand ¶
type EndpointCommand struct { envcmd.EnvCommandBase // contains filtered or unexported fields }
EndpointCommand returns the API endpoints
func (*EndpointCommand) Info ¶
func (c *EndpointCommand) Info() *cmd.Info
func (*EndpointCommand) Run ¶
func (c *EndpointCommand) Run(ctx *cmd.Context) error
Print out the addresses of the API server endpoints.
func (*EndpointCommand) SetFlags ¶
func (c *EndpointCommand) SetFlags(f *gnuflag.FlagSet)
type EnsureAvailabilityClient ¶
type EnsureAvailabilityClient interface { Close() error EnsureAvailability( numStateServers int, cons constraints.Value, series string, placement []string) (params.StateServersChanges, error) }
EnsureAvailabilityClient defines the methods on the client api that the ensure availability command calls.
type EnsureAvailabilityCommand ¶
type EnsureAvailabilityCommand struct { envcmd.EnvCommandBase // NumStateServers specifies the number of state servers to make available. NumStateServers int // Series is used for newly created machines, if specified. // Otherwise, the environment's default-series is used. Series string // Constraints, if specified, will be merged with those already // in the environment when creating new machines. Constraints constraints.Value // Placement specifies specific machine(s) which will be used to host // new state servers. If there are more state servers required than // machines specified, new machines will be created. // Placement is passed verbatim to the API, to be evaluated and used server-side. Placement []string // PlacementSpec holds the unparsed placement directives argument (--to). PlacementSpec string // contains filtered or unexported fields }
EnsureAvailabilityCommand makes the system highly available.
func (*EnsureAvailabilityCommand) Info ¶
func (c *EnsureAvailabilityCommand) Info() *cmd.Info
func (*EnsureAvailabilityCommand) Init ¶
func (c *EnsureAvailabilityCommand) Init(args []string) error
func (*EnsureAvailabilityCommand) Run ¶
func (c *EnsureAvailabilityCommand) Run(ctx *cmd.Context) error
Run connects to the environment specified on the command line and calls EnsureAvailability.
func (*EnsureAvailabilityCommand) SetFlags ¶
func (c *EnsureAvailabilityCommand) SetFlags(f *gnuflag.FlagSet)
type ExposeCommand ¶
type ExposeCommand struct { envcmd.EnvCommandBase ServiceName string }
ExposeCommand is responsible exposing services.
func (*ExposeCommand) Info ¶
func (c *ExposeCommand) Info() *cmd.Info
func (*ExposeCommand) Init ¶
func (c *ExposeCommand) Init(args []string) error
type GetCommand ¶
type GetCommand struct { envcmd.EnvCommandBase ServiceName string // contains filtered or unexported fields }
GetCommand retrieves the configuration of a service.
func (*GetCommand) Info ¶
func (c *GetCommand) Info() *cmd.Info
func (*GetCommand) Init ¶
func (c *GetCommand) Init(args []string) error
func (*GetCommand) Run ¶
func (c *GetCommand) Run(ctx *cmd.Context) error
Run fetches the configuration of the service and formats the result as a YAML string.
func (*GetCommand) SetFlags ¶
func (c *GetCommand) SetFlags(f *gnuflag.FlagSet)
type HelpToolCommand ¶
type HelpToolCommand struct { cmd.CommandBase // contains filtered or unexported fields }
func (*HelpToolCommand) Info ¶
func (t *HelpToolCommand) Info() *cmd.Info
func (*HelpToolCommand) Init ¶
func (t *HelpToolCommand) Init(args []string) error
type ImportKeysCommand ¶
type ImportKeysCommand struct { AuthorizedKeysBase // contains filtered or unexported fields }
ImportKeysCommand is used to add new authorized ssh keys for a user.
func (*ImportKeysCommand) Info ¶
func (c *ImportKeysCommand) Info() *cmd.Info
func (*ImportKeysCommand) Init ¶
func (c *ImportKeysCommand) Init(args []string) error
func (*ImportKeysCommand) SetFlags ¶
func (c *ImportKeysCommand) SetFlags(f *gnuflag.FlagSet)
type InfoData ¶
type InfoData struct { User string `json:"user,omitempty" yaml:",omitempty"` Password string `json:"password,omitempty" yaml:",omitempty"` EnvironUUID string `json:"environ-uuid,omitempty" yaml:"environ-uuid,omitempty"` ServerUUID string `json:"server-uuid,omitempty" yaml:"server-uuid,omitempty"` StateServers []string `json:"state-servers,omitempty" yaml:"state-servers,omitempty"` CACert string `json:"ca-cert,omitempty" yaml:"ca-cert,omitempty"` }
type InitCommand ¶
type InitCommand struct { cmd.CommandBase WriteFile bool Show bool }
InitCommand is used to write out a boilerplate environments.yaml file.
func (*InitCommand) Info ¶
func (c *InitCommand) Info() *cmd.Info
func (*InitCommand) Run ¶
func (c *InitCommand) Run(context *cmd.Context) error
Run checks to see if there is already an environments.yaml file. In one does not exist already, a boilerplate version is created so that the user can edit it to get started.
func (*InitCommand) SetFlags ¶
func (c *InitCommand) SetFlags(f *gnuflag.FlagSet)
type ListKeysCommand ¶
type ListKeysCommand struct { AuthorizedKeysBase // contains filtered or unexported fields }
ListKeysCommand is used to list the authorized ssh keys.
func (*ListKeysCommand) Info ¶
func (c *ListKeysCommand) Info() *cmd.Info
func (*ListKeysCommand) SetFlags ¶
func (c *ListKeysCommand) SetFlags(f *gnuflag.FlagSet)
type PluginCommand ¶
type PluginCommand struct { envcmd.EnvCommandBase // 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
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 PublishCommand ¶
type PublishCommand struct { envcmd.EnvCommandBase URL string CharmPath string // contains filtered or unexported fields }
func (*PublishCommand) ChangePushLocation ¶
func (c *PublishCommand) ChangePushLocation(change func(string) string)
func (*PublishCommand) Info ¶
func (c *PublishCommand) Info() *cmd.Info
func (*PublishCommand) Init ¶
func (c *PublishCommand) Init(args []string) error
func (*PublishCommand) SetFlags ¶
func (c *PublishCommand) SetFlags(f *gnuflag.FlagSet)
func (*PublishCommand) SetPollDelay ¶
func (c *PublishCommand) SetPollDelay(delay time.Duration)
type RemoveRelationCommand ¶
type RemoveRelationCommand struct { envcmd.EnvCommandBase Endpoints []string }
RemoveRelationCommand causes an existing service relation to be shut down.
func (*RemoveRelationCommand) Info ¶
func (c *RemoveRelationCommand) Info() *cmd.Info
func (*RemoveRelationCommand) Init ¶
func (c *RemoveRelationCommand) Init(args []string) error
type RemoveServiceCommand ¶
type RemoveServiceCommand struct { envcmd.EnvCommandBase ServiceName string }
RemoveServiceCommand causes an existing service to be destroyed.
func (*RemoveServiceCommand) Info ¶
func (c *RemoveServiceCommand) Info() *cmd.Info
func (*RemoveServiceCommand) Init ¶
func (c *RemoveServiceCommand) Init(args []string) error
type RemoveUnitCommand ¶
type RemoveUnitCommand struct { envcmd.EnvCommandBase UnitNames []string }
RemoveUnitCommand is responsible for destroying service units.
func (*RemoveUnitCommand) Info ¶
func (c *RemoveUnitCommand) Info() *cmd.Info
func (*RemoveUnitCommand) Init ¶
func (c *RemoveUnitCommand) Init(args []string) error
type ResolvedCommand ¶
type ResolvedCommand struct { envcmd.EnvCommandBase UnitName string Retry bool }
ResolvedCommand marks a unit in an error state as ready to continue.
func (*ResolvedCommand) Info ¶
func (c *ResolvedCommand) Info() *cmd.Info
func (*ResolvedCommand) Init ¶
func (c *ResolvedCommand) Init(args []string) error
func (*ResolvedCommand) SetFlags ¶
func (c *ResolvedCommand) SetFlags(f *gnuflag.FlagSet)
type RunCommand ¶
type RunCommand struct { envcmd.EnvCommandBase // contains filtered or unexported fields }
RunCommand is responsible for running arbitrary commands on remote machines.
func (*RunCommand) Info ¶
func (c *RunCommand) Info() *cmd.Info
func (*RunCommand) Init ¶
func (c *RunCommand) Init(args []string) error
func (*RunCommand) SetFlags ¶
func (c *RunCommand) SetFlags(f *gnuflag.FlagSet)
type SCPCommand ¶
type SCPCommand struct {
SSHCommon
}
SCPCommand is responsible for launching a scp command to copy files to/from remote machine(s)
func (*SCPCommand) Info ¶
func (c *SCPCommand) Info() *cmd.Info
func (*SCPCommand) Init ¶
func (c *SCPCommand) Init(args []string) error
type SSHCommand ¶
type SSHCommand struct {
SSHCommon
}
SSHCommand is responsible for launching a ssh shell on a given unit or machine.
func (*SSHCommand) Info ¶
func (c *SSHCommand) Info() *cmd.Info
func (*SSHCommand) Init ¶
func (c *SSHCommand) Init(args []string) error
type SSHCommon ¶
type SSHCommon struct { envcmd.EnvCommandBase Target string Args []string // contains filtered or unexported fields }
SSHCommon provides common methods for SSHCommand, SCPCommand and DebugHooksCommand.
func (*SSHCommon) AllowInterspersedFlags ¶
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 service-name/0 uname -a`.
type SwitchCommand ¶
type SwitchCommand struct { cmd.CommandBase EnvName string List bool }
func (*SwitchCommand) Info ¶
func (c *SwitchCommand) Info() *cmd.Info
func (*SwitchCommand) Init ¶
func (c *SwitchCommand) Init(args []string) (err error)
func (*SwitchCommand) SetFlags ¶
func (c *SwitchCommand) SetFlags(f *gnuflag.FlagSet)
type SyncToolsCommand ¶
type SyncToolsCommand struct { envcmd.EnvCommandBase // contains filtered or unexported fields }
SyncToolsCommand copies all the tools from the us-east-1 bucket to the local bucket.
func (*SyncToolsCommand) Info ¶
func (c *SyncToolsCommand) Info() *cmd.Info
func (*SyncToolsCommand) Init ¶
func (c *SyncToolsCommand) Init(args []string) error
func (*SyncToolsCommand) SetFlags ¶
func (c *SyncToolsCommand) SetFlags(f *gnuflag.FlagSet)
type UnexposeCommand ¶
type UnexposeCommand struct { envcmd.EnvCommandBase ServiceName string }
UnexposeCommand is responsible exposing services.
func (*UnexposeCommand) Info ¶
func (c *UnexposeCommand) Info() *cmd.Info
func (*UnexposeCommand) Init ¶
func (c *UnexposeCommand) Init(args []string) error
type UpgradeCharmCommand ¶
type UpgradeCharmCommand struct { envcmd.EnvCommandBase ServiceName string Force bool RepoPath string // defaults to JUJU_REPOSITORY SwitchURL string Revision int // defaults to -1 (latest) }
UpgradeCharm is responsible for upgrading a service's charm.
func (*UpgradeCharmCommand) Info ¶
func (c *UpgradeCharmCommand) Info() *cmd.Info
func (*UpgradeCharmCommand) Init ¶
func (c *UpgradeCharmCommand) Init(args []string) error
func (*UpgradeCharmCommand) Run ¶
func (c *UpgradeCharmCommand) Run(ctx *cmd.Context) error
Run connects to the specified environment and starts the charm upgrade process.
func (*UpgradeCharmCommand) SetFlags ¶
func (c *UpgradeCharmCommand) SetFlags(f *gnuflag.FlagSet)
type UpgradeJujuCommand ¶
type UpgradeJujuCommand struct { envcmd.EnvCommandBase Version version.Number UploadTools bool DryRun bool ResetPrevious bool AssumeYes bool Series []string // contains filtered or unexported fields }
UpgradeJujuCommand upgrades the agents in a juju installation.
func (*UpgradeJujuCommand) Info ¶
func (c *UpgradeJujuCommand) Info() *cmd.Info
func (*UpgradeJujuCommand) Init ¶
func (c *UpgradeJujuCommand) Init(args []string) error
func (*UpgradeJujuCommand) Run ¶
func (c *UpgradeJujuCommand) Run(ctx *cmd.Context) (err error)
Run changes the version proposed for the juju envtools.
func (*UpgradeJujuCommand) SetFlags ¶
func (c *UpgradeJujuCommand) SetFlags(f *gnuflag.FlagSet)
Source Files ¶
- addrelation.go
- apiinfo.go
- authorizedkeys.go
- authorizedkeys_add.go
- authorizedkeys_delete.go
- authorizedkeys_import.go
- authorizedkeys_list.go
- bootstrap.go
- common.go
- debughooks.go
- debuglog.go
- deploy.go
- destroyenvironment.go
- endpoint.go
- ensureavailability.go
- expose.go
- flags.go
- get.go
- helptool.go
- init.go
- main.go
- plugin.go
- publish.go
- register.go
- removerelation.go
- removeservice.go
- removeunit.go
- resolved.go
- run.go
- scp.go
- ssh.go
- switch.go
- synctools.go
- unexpose.go
- upgradecharm.go
- upgradejuju.go