Documentation
¶
Index ¶
- func ConnectAsAgent(ctx context.Context, a agent.Agent) (io.Closer, error)
- func MachineAgentFactoryFn(agentConfWriter agentconfig.AgentConfigWriter, ...) machineAgentFactoryFnType
- func NewCheckConnectionCommand(config agentconf.AgentConf, connect ConnectFunc) cmd.Command
- func NewMachineAgentCommand(ctx *cmd.Context, machineAgentFactory machineAgentFactoryFnType, ...) cmd.Command
- type AgentInitializer
- type CommandRunner
- 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 PreUpgradeStepsFunc
- type UpgradeStepsFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 agentconfig.AgentConfigWriter, bufferedLogger *logsender.BufferedLogWriter, preUpgradeSteps PreUpgradeStepsFunc, upgradeSteps UpgradeStepsFunc, 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 NewMachineAgentCommand ¶
func NewMachineAgentCommand( ctx *cmd.Context, machineAgentFactory machineAgentFactoryFnType, agentInitializer AgentInitializer, configFetcher agentconfig.AgentConfigWriter, ) cmd.Command
NewMachineAgentCommand creates a Command that 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 CommandRunner ¶
type CommandRunner interface {
RunCommands(run exec.RunParams) (*exec.ExecResponse, error)
}
CommandRunner allows to run commands on the underlying system
type ConnectFunc ¶
ConnectFunc connects to the API as the given agent.
type MachineAgent ¶
type MachineAgent struct { agentconfig.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 agentconfig.AgentConfigWriter, bufferedLogger *logsender.BufferedLogWriter, runner *worker.Runner, loopDeviceManager looputil.LoopDeviceManager, preUpgradeSteps PreUpgradeStepsFunc, upgradeSteps UpgradeStepsFunc, 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( bufferedLogger *logsender.BufferedLogWriter, ) *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 PreUpgradeStepsFunc ¶
type PreUpgradeStepsFunc func(state.ModelType) upgrades.PreUpgradeStepsFunc
The following allows the upgrade steps to be overridden by brittle integration tests.
type UpgradeStepsFunc ¶
type UpgradeStepsFunc = upgrades.UpgradeStepsFunc
Directories
¶
Path | Synopsis |
---|---|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |