Documentation ¶
Index ¶
- Variables
- func ConnectAsAgent(a agent.Agent) (io.Closer, error)
- func MachineAgentFactoryFn(agentConfWriter agentconf.AgentConfigWriter, ...) machineAgentFactoryFnType
- func NewCheckConnectionCommand(config agentconf.AgentConf, connect ConnectFunc) cmd.Command
- func NewMachineAgentCmd(ctx *cmd.Context, machineAgentFactory machineAgentFactoryFnType, ...) cmd.Command
- type AgentInitializer
- type BootstrapCommand
- type CAASUnitInitCommand
- type CaasOperatorAgent
- func (op *CaasOperatorAgent) ChangeConfig(mutate agent.ConfigMutator) error
- func (op *CaasOperatorAgent) Done(err error)
- func (op *CaasOperatorAgent) Info() *cmd.Info
- func (op *CaasOperatorAgent) Init(args []string) error
- func (op *CaasOperatorAgent) Run(ctx *cmd.Context) (err error)
- func (op *CaasOperatorAgent) SetFlags(f *gnuflag.FlagSet)
- func (op *CaasOperatorAgent) Stop() error
- func (op *CaasOperatorAgent) Tag() names.Tag
- func (op *CaasOperatorAgent) Wait() error
- func (op *CaasOperatorAgent) Workers() (worker.Worker, error)
- type ConnectFunc
- type MachineAgent
- func (a *MachineAgent) ChangeConfig(mutate agent.ConfigMutator) error
- func (a *MachineAgent) Done(err error)
- func (a *MachineAgent) Restart() error
- func (a *MachineAgent) Run(ctx *cmd.Context) (err error)
- func (a *MachineAgent) Stop() error
- func (a *MachineAgent) Tag() names.Tag
- func (a *MachineAgent) Wait() error
- func (a *MachineAgent) WorkersStarted() <-chan struct{}
- type ModelCommand
- func (m *ModelCommand) Done(err error)
- func (m *ModelCommand) Info() *cmd.Info
- func (m *ModelCommand) Init(args []string) error
- func (m *ModelCommand) Run(ctx *cmd.Context) error
- func (m *ModelCommand) SetFlags(f *gnuflag.FlagSet)
- func (m *ModelCommand) Stop() error
- func (m *ModelCommand) Tag() names.Tag
- func (m *ModelCommand) Wait() error
- func (m *ModelCommand) Workers() (worker.Worker, error)
- type UnitAgent
- func (a *UnitAgent) APIWorkers() (worker.Worker, error)
- func (a *UnitAgent) ChangeConfig(mutate agent.ConfigMutator) error
- func (a *UnitAgent) Done(err error)
- func (a *UnitAgent) Info() *cmd.Info
- func (a *UnitAgent) Init(args []string) error
- func (a *UnitAgent) Run(ctx *cmd.Context) (err error)
- func (a *UnitAgent) SetFlags(f *gnuflag.FlagSet)
- func (a *UnitAgent) Stop() error
- func (a *UnitAgent) Tag() names.Tag
- func (a *UnitAgent) Wait() error
Constants ¶
This section is empty.
Variables ¶
var ( // Should be an explicit dependency, can't do it cleanly yet. // Exported for testing. CaasOperatorManifolds = caasoperator.Manifolds )
var ProductionMongoWriteConcern = true
ProductionMongoWriteConcern is provided to override in tests, default is true
Functions ¶
func ConnectAsAgent ¶
ConnectAsAgent really connects to the API specified in the agent config. It's extracted so tests can pass something else in.
func MachineAgentFactoryFn ¶
func MachineAgentFactoryFn( agentConfWriter agentconf.AgentConfigWriter, bufferedLogger *logsender.BufferedLogWriter, newIntrospectionSocketName func(names.Tag) string, preUpgradeSteps upgrades.PreUpgradeStepsFunc, rootDir string, ) machineAgentFactoryFnType
MachineAgentFactoryFn returns a function which instantiates a MachineAgent given a machineId.
func NewCheckConnectionCommand ¶
func NewCheckConnectionCommand(config agentconf.AgentConf, connect ConnectFunc) cmd.Command
NewCheckConnectionCommand returns a command that will test connecting to the API with details from the agent's config.
func NewMachineAgentCmd ¶
func NewMachineAgentCmd( ctx *cmd.Context, machineAgentFactory machineAgentFactoryFnType, agentInitializer AgentInitializer, configFetcher agentconf.AgentConfigWriter, ) cmd.Command
NewMachineAgentCmd creates a Command which handles parsing command-line arguments and instantiating and running a MachineAgent.
Types ¶
type AgentInitializer ¶
type AgentInitializer interface { AddFlags(*gnuflag.FlagSet) CheckArgs([]string) error // DataDir returns the directory where this agent should store its data. DataDir() string }
AgentInitializer handles initializing a type for use as a Jujud agent.
type BootstrapCommand ¶
type BootstrapCommand struct { cmd.CommandBase agentconf.AgentConf BootstrapParamsFile string Timeout time.Duration }
BootstrapCommand represents a jujud bootstrap command.
func NewBootstrapCommand ¶
func NewBootstrapCommand() *BootstrapCommand
NewBootstrapCommand returns a new BootstrapCommand that has been initialized.
func (*BootstrapCommand) Info ¶
func (c *BootstrapCommand) Info() *cmd.Info
Info returns a description of the command.
func (*BootstrapCommand) Init ¶
func (c *BootstrapCommand) Init(args []string) error
Init initializes the command for running.
func (*BootstrapCommand) Run ¶
func (c *BootstrapCommand) Run(_ *cmd.Context) error
Run initializes state for an environment.
func (*BootstrapCommand) SetFlags ¶
func (c *BootstrapCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags adds the flags for this command to the passed gnuflag.FlagSet.
type CAASUnitInitCommand ¶
type CAASUnitInitCommand struct { cmd.CommandBase Wait bool Send bool Args struct { Unit string `json:"unit"` OperatorFile string `json:"operator-file"` OperatorCACertFile string `json:"operator-ca-cert-file"` CharmDir string `json:"charm-dir"` CallerPID int `json:"caller-pid"` } // contains filtered or unexported fields }
CAASUnitInitCommand represents a jujud bootstrap command.
func NewCAASUnitInitCommand ¶
func NewCAASUnitInitCommand() *CAASUnitInitCommand
NewCAASUnitInitCommand returns a new CAASUnitInitCommand that has been initialized.
func (*CAASUnitInitCommand) Info ¶
func (c *CAASUnitInitCommand) Info() *cmd.Info
Info returns a description of the command.
func (*CAASUnitInitCommand) Init ¶
func (c *CAASUnitInitCommand) Init(args []string) error
func (*CAASUnitInitCommand) Run ¶
func (c *CAASUnitInitCommand) Run(ctx *cmd.Context) (errOut error)
func (*CAASUnitInitCommand) SetFlags ¶
func (c *CAASUnitInitCommand) SetFlags(f *gnuflag.FlagSet)
type CaasOperatorAgent ¶
type CaasOperatorAgent struct { cmd.CommandBase agentconf.AgentConf ApplicationName string // contains filtered or unexported fields }
CaasOperatorAgent is a cmd.Command responsible for running a CAAS operator agent.
func NewCaasOperatorAgent ¶
func NewCaasOperatorAgent( ctx *cmd.Context, bufferedLogger *logsender.BufferedLogWriter, configure func(*caasoperator.ManifoldsConfig) error, ) (*CaasOperatorAgent, error)
NewCaasOperatorAgent creates a new CAASOperatorAgent instance properly initialized.
func (*CaasOperatorAgent) ChangeConfig ¶
func (op *CaasOperatorAgent) ChangeConfig(mutate agent.ConfigMutator) error
ChangeConfig implements Agent.
func (*CaasOperatorAgent) Done ¶
func (op *CaasOperatorAgent) Done(err error)
Done signals the machine agent is finished
func (*CaasOperatorAgent) Info ¶
func (op *CaasOperatorAgent) Info() *cmd.Info
Info implements Command.
func (*CaasOperatorAgent) Init ¶
func (op *CaasOperatorAgent) Init(args []string) error
Init initializes the command for running.
func (*CaasOperatorAgent) Run ¶
func (op *CaasOperatorAgent) Run(ctx *cmd.Context) (err error)
Run implements Command.
func (*CaasOperatorAgent) SetFlags ¶
func (op *CaasOperatorAgent) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.
func (*CaasOperatorAgent) Wait ¶
func (op *CaasOperatorAgent) Wait() error
Wait waits for the CaasOperator agent to finish.
func (*CaasOperatorAgent) Workers ¶
func (op *CaasOperatorAgent) Workers() (worker.Worker, error)
Workers returns a dependency.Engine running the operator's responsibilities.
type ConnectFunc ¶
ConnectFunc connects to the API as the given agent.
type MachineAgent ¶
type MachineAgent struct { agentconf.AgentConfigWriter // contains filtered or unexported fields }
MachineAgent is responsible for tying together all functionality needed to orchestrate a Jujud instance which controls a machine.
func NewMachineAgent ¶
func NewMachineAgent( agentTag names.Tag, agentConfWriter agentconf.AgentConfigWriter, bufferedLogger *logsender.BufferedLogWriter, runner *worker.Runner, loopDeviceManager looputil.LoopDeviceManager, newIntrospectionSocketName func(names.Tag) string, preUpgradeSteps upgrades.PreUpgradeStepsFunc, rootDir string, isCaasAgent bool, ) (*MachineAgent, error)
NewMachineAgent instantiates a new MachineAgent.
func (*MachineAgent) ChangeConfig ¶
func (a *MachineAgent) ChangeConfig(mutate agent.ConfigMutator) error
func (*MachineAgent) Done ¶
func (a *MachineAgent) Done(err error)
Done signals the machine agent is finished
func (*MachineAgent) Restart ¶
func (a *MachineAgent) Restart() error
Restart restarts the agent's service.
func (*MachineAgent) Run ¶
func (a *MachineAgent) Run(ctx *cmd.Context) (err error)
Run runs a machine agent.
func (*MachineAgent) Tag ¶
func (a *MachineAgent) Tag() names.Tag
func (*MachineAgent) Wait ¶
func (a *MachineAgent) Wait() error
Wait waits for the machine agent to finish.
func (*MachineAgent) WorkersStarted ¶
func (a *MachineAgent) WorkersStarted() <-chan struct{}
WorkersStarted returns a channel that's closed once all top level workers have been started. This is provided for testing purposes.
type ModelCommand ¶
type ModelCommand struct { agentconf.AgentConf cmd.CommandBase ModelUUID string // contains filtered or unexported fields }
ModelCommand is a cmd.Command responsible for running a model agent.
func NewModelCommand ¶
func NewModelCommand() *ModelCommand
NewModelCommand creates a new ModelCommand instance properly initialized
func (*ModelCommand) Done ¶
func (m *ModelCommand) Done(err error)
Done signals the model agent is finished
func (*ModelCommand) Init ¶
func (m *ModelCommand) Init(args []string) error
Init initializers the command for running
func (*ModelCommand) Run ¶
func (m *ModelCommand) Run(ctx *cmd.Context) error
Run implements Command
func (*ModelCommand) SetFlags ¶
func (m *ModelCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command
func (*ModelCommand) Tag ¶
func (m *ModelCommand) Tag() names.Tag
func (*ModelCommand) Wait ¶
func (m *ModelCommand) Wait() error
func (*ModelCommand) Workers ¶
func (m *ModelCommand) Workers() (worker.Worker, error)
type UnitAgent ¶
type UnitAgent struct { cmd.CommandBase agentconf.AgentConf UnitName string // contains filtered or unexported fields }
UnitAgent is a cmd.Command responsible for running a unit agent.
func NewUnitAgent ¶
func NewUnitAgent(ctx *cmd.Context, bufferedLogger *logsender.BufferedLogWriter) (*UnitAgent, error)
NewUnitAgent creates a new UnitAgent value properly initialized.
func (*UnitAgent) APIWorkers ¶
APIWorkers returns a dependency.Engine running the unit agent's responsibilities.
func (*UnitAgent) ChangeConfig ¶
func (a *UnitAgent) ChangeConfig(mutate agent.ConfigMutator) error