Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControllerNodeForReplicaSetMember ¶
func ControllerNodeForReplicaSetMember(member core.ReplicaSetMember) core.ControllerNode
ControllerNodeForReplicaSetMember returns ControllerNode for ReplicaSetMember.
Types ¶
type CommandRunner ¶
type CommandRunner interface { // All strings within the command must be individually passed-in. // For example, // to run 'echo hi:D', pass in "echo", "hi:D", // to stop juju-db, pass in "systemctl", "stop", "juju-db". Run(commands ...string) (string, error) RunScript(script string, args ...string) (string, error) }
CommandRunner defines what is needed to run a command on a machine.
func NewLocalRunner ¶
func NewLocalRunner() CommandRunner
NewLocalRunner constructs a command runner that runs commands locally.
func NewRemoteRunner ¶
func NewRemoteRunner(ip string) CommandRunner
NewRemoteRunner constructs a command runner that runs commands remotely using ssh.
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine represents a juju controller machine and holds a runner for running commands on that machine (whether it's the current machine or a different one).
func New ¶
func New(ip string, jujuID string, runner CommandRunner) *Machine
New returns a machine that satisfies core.ControllerNode.
func (*Machine) Ping ¶
Ping implements ControllerNode.Ping() by ssh'ing into the machine and executing an 'echo' command.
func (*Machine) StartAgent ¶
StartAgent implements ControllerNode.StartAgent.
func (*Machine) UpdateAgentVersion ¶
UpdateAgentVersion edits the agent.conf and updates the symlink to point to the tools for the specified version.