Documentation ¶
Index ¶
- Variables
- func MachineAgentFactoryFn(agentConfWriter agentconf.AgentConfigWriter, ...) machineAgentFactoryFnType
- func NewMachineAgentCmd(ctx *cmd.Context, machineAgentFactory machineAgentFactoryFnType, ...) cmd.Command
- type AgentInitializer
- type BootstrapCommand
- type CommandRunner
- 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 ModelMetrics
Constants ¶
This section is empty.
Variables ¶
var ProductionMongoWriteConcern = true
ProductionMongoWriteConcern is provided to override in tests, default is true
Functions ¶
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 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(ctx *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 CommandRunner ¶
type CommandRunner interface {
RunCommands(run exec.RunParams) (*exec.ExecResponse, error)
}
CommandRunner allows to run commands on the underlying system
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 ModelMetrics ¶
type ModelMetrics interface {
ForModel(model names.ModelTag) dependency.Metrics
}
ModelMetrics defines a type for creating metrics for a given model.