vultr

package
Version: v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockApiServer

func NewMockApiServer() *httptest.Server

Types

type Driver

type Driver struct {
	*drivers.BaseDriver

	APIKey string

	InstanceId   string
	ServerType   int
	DCID         int
	VpsPlanId    int
	OSID         int
	InternalIp   string
	ReservedIPV4 string
	DockerPort   int

	IpxeChainURL string
	ISOID        int
	ScriptId     string
	SnapshotId   string
	AppId        string

	IPV6                    bool
	PrivateNetwork          bool
	AutoBackups             bool
	NotifyActivate          bool
	DDOSProtection          bool
	DDOSProtectionAvailable bool

	Userdata          string
	Label             string
	Hostname          string
	Tag               string
	FirewallGroupId   string
	SSHKeyIdAvailable bool
	SSHKeyId          []string
	NetworkId         []string
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(hostName, storePath string) *Driver

NewDriver creates and returns a new instance of the Vultr driver

func (*Driver) Create

func (d *Driver) Create() error

Create a host using the driver's config

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver

func (*Driver) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

GetCreateFlags returns the mcnflag.Flag slice representing the flags that can be set, their descriptions and defaults.

func (*Driver) GetIP

func (d *Driver) GetIP() (string, error)

GetIP returns an IP or hostname that this host is available at e.g. 1.2.3.4 or docker-host-d60b70a14d3a.cloudapp.net

func (*Driver) GetSSHHostname

func (d *Driver) GetSSHHostname() (string, error)

GetSSHHostname returns hostname for use with ssh

func (*Driver) GetSSHKeyPath

func (d *Driver) GetSSHKeyPath() string

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

GetState returns the state that the host is in (running, stopped, etc)

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

GetURL returns a Docker compatible host URL for connecting to this host e.g. tcp://1.2.3.4:2376

func (*Driver) Kill

func (d *Driver) Kill() error

Kill stops a host forcefully

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck allows for pre-create operations to make sure a driver is ready for creation

func (*Driver) Remove

func (d *Driver) Remove() error

Remove a host

func (*Driver) Restart

func (d *Driver) Restart() error

Restart a host. This may just call Stop(); Start() if the provider does not have any special restart behaviour.

func (*Driver) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error

SetConfigFromFlags configures the driver with the object that was returned by RegisterCreateFlags

func (*Driver) Start

func (d *Driver) Start() error

Start a host

func (*Driver) Stop

func (d *Driver) Stop() error

Stop a host gracefully

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL