digitalocean

package
v0.0.0-...-1d50e38 Latest Latest
Warning

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

Go to latest
Published: May 30, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DigitalOceanStatusOff     = "off"
	DigitalOceanStatusNew     = "new"
	DigitalOceanStatusActive  = "active"
	DigitalOceanStatusArchive = "archive"

	ProviderName = "digitalocean"
)

Variables

View Source
var (
	// bson fields for the Settings struct
	ImageIdKey  = bsonutil.MustHaveTag(Settings{}, "ImageId")
	SizeIdKey   = bsonutil.MustHaveTag(Settings{}, "SizeId")
	RegionIdKey = bsonutil.MustHaveTag(Settings{}, "RegionId")
	SSHKeyIdKey = bsonutil.MustHaveTag(Settings{}, "SSHKeyId")
)

Functions

This section is empty.

Types

type DigitalOceanManager

type DigitalOceanManager struct {
	// contains filtered or unexported fields
}

func (*DigitalOceanManager) CanSpawn

func (digoMgr *DigitalOceanManager) CanSpawn() (bool, error)

CanSpawn returns if a given cloud provider supports spawning a new host dynamically. Always returns true for DigitalOcean.

func (*DigitalOceanManager) Configure

func (digoMgr *DigitalOceanManager) Configure(settings *evergreen.Settings) error

Configure populates a DigitalOceanManager by reading relevant settings from the config object.

func (*DigitalOceanManager) GetDNSName

func (digoMgr *DigitalOceanManager) GetDNSName(host *host.Host) (string, error)

GetDNSName gets the DNS hostname of a droplet by reading it directly from the DigitalOcean API

func (*DigitalOceanManager) GetInstanceStatus

func (digoMgr *DigitalOceanManager) GetInstanceStatus(host *host.Host) (cloud.CloudStatus, error)

GetInstanceStatus returns a universal status code representing the state of a droplet.

func (*DigitalOceanManager) GetSSHOptions

func (digoMgr *DigitalOceanManager) GetSSHOptions(host *host.Host, keyPath string) ([]string, error)

GetSSHOptions returns an array of default SSH options for connecting to a droplet.

func (*DigitalOceanManager) GetSettings

func (_ *DigitalOceanManager) GetSettings() cloud.ProviderSettings

func (*DigitalOceanManager) IsSSHReachable

func (digoMgr *DigitalOceanManager) IsSSHReachable(host *host.Host, keyPath string) (bool, error)

IsSSHReachable checks if a droplet appears to be reachable via SSH by attempting to contact the host directly.

func (*DigitalOceanManager) IsUp

func (digoMgr *DigitalOceanManager) IsUp(host *host.Host) (bool, error)

IsUp checks the droplet's state by querying the DigitalOcean API and returns true if the host should be available to connect with SSH.

func (*DigitalOceanManager) OnUp

func (digoMgr *DigitalOceanManager) OnUp(host *host.Host) error

func (*DigitalOceanManager) SpawnInstance

func (digoMgr *DigitalOceanManager) SpawnInstance(d *distro.Distro, hostOpts cloud.HostOptions) (*host.Host, error)

SpawnInstance creates a new droplet for the given distro.

func (*DigitalOceanManager) TerminateInstance

func (digoMgr *DigitalOceanManager) TerminateInstance(host *host.Host) error

TerminateInstance destroys a droplet.

func (*DigitalOceanManager) TimeTilNextPayment

func (digoMgr *DigitalOceanManager) TimeTilNextPayment(host *host.Host) time.Duration

TimeTilNextPayment returns the amount of time until the next payment is due for the host

type Settings

type Settings struct {
	ImageId  int `mapstructure:"image_id" json:"image_id" bson:"image_id"`
	SizeId   int `mapstructure:"size_id" json:"size_id" bson:"size_id"`
	RegionId int `mapstructure:"region_id" json:"region_id" bson:"region_id"`
	SSHKeyId int `mapstructure:"ssh_key_id" json:"ssh_key_id" bson:"ssh_key_id"`
}

func (*Settings) Validate

func (self *Settings) Validate() error

Validate checks that the settings from the config file are sane.

Jump to

Keyboard shortcuts

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