Documentation ¶
Index ¶
- func CheckMachine(m Machine) error
- func EnableSelinux(m Machine) error
- func InstallFile(in io.Reader, m Machine, to string) error
- func Manhole(m Machine) error
- func ReadFile(m Machine, path string) (io.ReadCloser, error)
- func Reboot(m Machine) error
- func StreamJournal(m Machine) error
- func TransferFile(src Machine, srcPath string, dst Machine, dstPath string) error
- type BaseCluster
- func (bc *BaseCluster) AddMach(m Machine)
- func (bc *BaseCluster) DelMach(m Machine)
- func (bc *BaseCluster) Destroy() error
- func (bc *BaseCluster) GetDiscoveryURL(size int) (string, error)
- func (bc *BaseCluster) Keys() ([]*agent.Key, error)
- func (bc *BaseCluster) Machines() []Machine
- func (bc *BaseCluster) Name() string
- func (bc *BaseCluster) PasswordSSHClient(ip string, user string, password string) (*ssh.Client, error)
- func (bc *BaseCluster) SSH(m Machine, cmd string) ([]byte, error)
- func (bc *BaseCluster) SSHClient(ip string) (*ssh.Client, error)
- type Cluster
- type Machine
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMachine ¶ added in v0.2.0
CheckMachine tests a machine for various error conditions such as ssh being available and no systemd units failing at the time ssh is reachable. It also ensures the remote system is running CoreOS.
TODO(mischief): better error messages.
func EnableSelinux ¶ added in v0.2.0
Enable SELinux on a machine (skip on machines without SELinux support)
func InstallFile ¶
InstallFile copies data from in to the path to on m.
func Manhole ¶
Manhole connects os.Stdin, os.Stdout, and os.Stderr to an interactive shell session on the Machine m. Manhole blocks until the shell session has ended. If os.Stdin does not refer to a TTY, Manhole returns immediately with a nil error.
func ReadFile ¶ added in v0.0.10
func ReadFile(m Machine, path string) (io.ReadCloser, error)
ReadFile returns a io.ReadCloser that streams the requested file. The caller should close the reader when finished.
func Reboot ¶
Reboots a machine and blocks until the system to be accessible by SSH again. It will return an error if the machine is not accessible after a timeout.
func StreamJournal ¶
StreamJournal streams the remote system's journal to stdout.
Types ¶
type BaseCluster ¶ added in v0.2.0
type BaseCluster struct {
// contains filtered or unexported fields
}
func NewBaseCluster ¶ added in v0.2.0
func NewBaseCluster(basename string) (*BaseCluster, error)
func NewBaseClusterWithDialer ¶ added in v0.2.0
func NewBaseClusterWithDialer(basename string, dialer network.Dialer) (*BaseCluster, error)
func (*BaseCluster) AddMach ¶ added in v0.2.0
func (bc *BaseCluster) AddMach(m Machine)
func (*BaseCluster) DelMach ¶ added in v0.2.0
func (bc *BaseCluster) DelMach(m Machine)
func (*BaseCluster) Destroy ¶ added in v0.2.0
func (bc *BaseCluster) Destroy() error
Destroy destroys each machine in the cluster and closes the SSH agent.
func (*BaseCluster) GetDiscoveryURL ¶ added in v0.2.0
func (bc *BaseCluster) GetDiscoveryURL(size int) (string, error)
XXX(mischief): i don't really think this belongs here, but it completes the interface we've established.
func (*BaseCluster) Machines ¶ added in v0.2.0
func (bc *BaseCluster) Machines() []Machine
func (*BaseCluster) Name ¶ added in v0.2.0
func (bc *BaseCluster) Name() string
func (*BaseCluster) PasswordSSHClient ¶ added in v0.2.0
type Cluster ¶
type Cluster interface { // NewMachine creates a new CoreOS machine. NewMachine(config string) (Machine, error) // Machines returns a slice of the active machines in the Cluster. Machines() []Machine // GetDiscoveryURL returns a new etcd discovery URL. GetDiscoveryURL(size int) (string, error) // Destroy terminates each machine in the cluster and frees any other // associated resources. Destroy() error }
Cluster represents a cluster of CoreOS machines within a single platform.
type Machine ¶
type Machine interface { // ID returns the plaform-specific machine identifier. ID() string // IP returns the machine's public IP. IP() string // PrivateIP returns the machine's private IP. PrivateIP() string // SSHClient establishes a new SSH connection to the machine. SSHClient() (*ssh.Client, error) // PasswordSSHClient establishes a new SSH connection using the provided credentials. PasswordSSHClient(user string, password string) (*ssh.Client, error) // SSH runs a single command over a new SSH connection. SSH(cmd string) ([]byte, error) // Destroy terminates the machine and frees associated resources. Destroy() error }
Machine represents a CoreOS instance.