agent

package
v0.0.0-...-51a0f74 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 116 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Stop

func (a *MachineAgent) Stop() error

Stop stops the 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.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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