machine

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: Apache-2.0 Imports: 62 Imported by: 124

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorMachineNotExist is returned when virtual machine does not exist due to user interrupt cancel(i.e. Ctrl + C)
	ErrorMachineNotExist = errors.New("machine does not exist")
)

Functions

func CacheAndLoadImages added in v0.24.0

func CacheAndLoadImages(images []string) error

CacheAndLoadImages caches and loads images to all profiles

func CacheBinariesForBootstrapper added in v1.0.1

func CacheBinariesForBootstrapper(version string, clusterBootstrapper string) error

CacheBinariesForBootstrapper will cache binaries for a bootstrapper

func CacheImagesForBootstrapper added in v0.22.0

func CacheImagesForBootstrapper(imageRepository string, version string, clusterBootstrapper string) error

CacheImagesForBootstrapper will cache images for a bootstrapper

func CheckIfHostExistsAndLoad added in v1.7.3

func CheckIfHostExistsAndLoad(api libmachine.API, machineName string) (*host.Host, error)

CheckIfHostExistsAndLoad checks if a host exists, and loads it if it does

func CommandRunner added in v0.34.0

func CommandRunner(h *host.Host) (command.Runner, error)

CommandRunner returns best available command runner for this host

func CopyBinary added in v1.0.1

func CopyBinary(cr command.Runner, src string, dest string) error

CopyBinary copies a locally cached binary to the guest VM

func CreateSSHShell added in v1.7.3

func CreateSSHShell(api libmachine.API, cc config.ClusterConfig, n config.Node, args []string) error

CreateSSHShell creates a new SSH shell / client

func DeleteHost added in v1.7.3

func DeleteHost(api libmachine.API, machineName string) error

DeleteHost deletes the host VM.

func GetHostStatus added in v1.7.3

func GetHostStatus(api libmachine.API, machineName string) (string, error)

GetHostStatus gets the status of the host VM.

func IsHostRunning added in v1.7.3

func IsHostRunning(api libmachine.API, name string) bool

IsHostRunning asserts that this profile's primary host is in state "Running"

func List added in v1.6.0

func List(miniHome ...string) (validMachines []*Machine, inValidMachines []*Machine, err error)

List return all valid and invalid machines If a machine is valid or invalid is determined by the cluster.IsValid function

func LoadImages added in v0.22.0

func LoadImages(cc *config.ClusterConfig, runner command.Runner, images []string, cacheDir string) error

LoadImages loads previously cached images into the container runtime

func NewAPIClient added in v0.17.0

func NewAPIClient() (libmachine.API, error)

NewAPIClient gets a new client.

func NewRPCClient added in v0.20.0

func NewRPCClient(storePath, certsDir string) libmachine.API

NewRPCClient gets a new client.

func StartDriver

func StartDriver()

StartDriver starts the driver

func StartHost added in v1.7.3

func StartHost(api libmachine.API, cfg config.ClusterConfig, n config.Node) (*host.Host, error)

StartHost starts a host VM.

func StopHost added in v1.7.3

func StopHost(api libmachine.API, machineName string) error

StopHost stops the host VM, saving state to disk.

Types

type CertGenerator added in v0.15.0

type CertGenerator struct {
	cert.X509CertGenerator
}

CertGenerator is used to override the default machine CertGenerator with a longer timeout.

func (*CertGenerator) ValidateCertificate added in v0.15.0

func (cg *CertGenerator) ValidateCertificate(addr string, authOptions *auth.Options) (bool, error)

ValidateCertificate is a reimplementation of the default generator with a longer timeout.

type ConnChecker added in v0.16.0

type ConnChecker struct {
}

ConnChecker can check the connection

func (*ConnChecker) Check added in v0.16.0

func (cc *ConnChecker) Check(h *host.Host, swarm bool) (string, *auth.Options, error)

Check checks the connection

type LocalClient added in v0.17.0

type LocalClient struct {
	*persist.Filestore
	// contains filtered or unexported fields
}

LocalClient is a non-RPC implementation of the libmachine API

func (*LocalClient) Close added in v0.17.0

func (api *LocalClient) Close() error

Close closes the client

func (*LocalClient) Create added in v0.17.0

func (api *LocalClient) Create(h *host.Host) error

Create creates the host

func (*LocalClient) Load added in v0.17.0

func (api *LocalClient) Load(name string) (*host.Host, error)

Load a new client, creating driver

func (*LocalClient) NewHost added in v0.17.0

func (api *LocalClient) NewHost(drvName string, rawDriver []byte) (*host.Host, error)

NewHost creates a new Host

type Machine added in v1.6.0

type Machine struct {
	*host.Host
}

Machine contains information about a machine

func Load added in v1.6.0

func Load(name string) (*Machine, error)

Load loads a machine or throws an error if the machine could not be loaded.

func (*Machine) IsValid added in v1.6.0

func (h *Machine) IsValid() bool

IsValid checks if the machine has the essential info needed for a machine

Jump to

Keyboard shortcuts

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