Documentation ¶
Index ¶
- Constants
- Variables
- type DigitalOceanManager
- func (digoMgr *DigitalOceanManager) CanSpawn() (bool, error)
- func (digoMgr *DigitalOceanManager) Configure(settings *evergreen.Settings) error
- func (digoMgr *DigitalOceanManager) GetDNSName(host *host.Host) (string, error)
- func (digoMgr *DigitalOceanManager) GetInstanceStatus(host *host.Host) (cloud.CloudStatus, error)
- func (digoMgr *DigitalOceanManager) GetSSHOptions(host *host.Host, keyPath string) ([]string, error)
- func (_ *DigitalOceanManager) GetSettings() cloud.ProviderSettings
- func (digoMgr *DigitalOceanManager) IsSSHReachable(host *host.Host, keyPath string) (bool, error)
- func (digoMgr *DigitalOceanManager) IsUp(host *host.Host) (bool, error)
- func (digoMgr *DigitalOceanManager) OnUp(host *host.Host) error
- func (digoMgr *DigitalOceanManager) SpawnInstance(d *distro.Distro, hostOpts cloud.HostOptions) (*host.Host, error)
- func (digoMgr *DigitalOceanManager) TerminateInstance(host *host.Host) error
- func (digoMgr *DigitalOceanManager) TimeTilNextPayment(host *host.Host) time.Duration
- type Settings
Constants ¶
const ( DigitalOceanStatusOff = "off" DigitalOceanStatusNew = "new" DigitalOceanStatusActive = "active" DigitalOceanStatusArchive = "archive" ProviderName = "digitalocean" )
Variables ¶
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 ¶
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) 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"` }