Documentation ¶
Overview ¶
Package exoscale provides a standard way to create a virtual machine on exoscale.ch.
Index ¶
- Variables
- type Config
- type SecurityGroup
- type ServiceOffering
- type ServiceOfferingType
- type Template
- type VM
- func (vm *VM) AddDisk() error
- func (vm *VM) Destroy() error
- func (vm *VM) GetIPs() ([]net.IP, error)
- func (vm *VM) GetName() string
- func (vm *VM) GetSSH(options ssh.Options) (ssh.Client, error)
- func (vm *VM) GetState() (string, error)
- func (vm *VM) Halt() error
- func (vm *VM) Provision() error
- func (vm *VM) RemoveDisk(diskName string) error
- func (vm *VM) Resume() error
- func (vm *VM) Start() error
- func (vm *VM) Suspend() error
- func (vm *VM) WaitVMCreation(timeoutSeconds int, pollIntervalSeconds int) error
- type Zone
Constants ¶
This section is empty.
Variables ¶
var SSHTimeout = 30 * time.Second
SSHTimeout is the maximum time to wait before failing to GetSSH. This is not thread-safe.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Endpoint string `json:"endpoint,omitempty"` // required APIKey string `json:"apikey,omitempty"` // required APISecret string `json:"apisecret,omitempty"` // required }
Config is the new droplet payload
type SecurityGroup ¶
SecurityGroup is a Exoscale security group
type ServiceOffering ¶
type ServiceOffering struct { ID string `json:"id,omitempty"` Name ServiceOfferingType `json:"name,omitempty"` }
ServiceOffering is a Exoscale machine type offering
type ServiceOfferingType ¶
type ServiceOfferingType string
ServiceOfferingType is a Exoscale instance type offering
const ( Micro ServiceOfferingType = "Micro" Tiny ServiceOfferingType = "Tiny" Small ServiceOfferingType = "Small" Medium ServiceOfferingType = "Medium" Large ServiceOfferingType = "Large" ExtraLarge ServiceOfferingType = "Extra-large" Huge ServiceOfferingType = "Huge" )
Exoscal offerings
type Template ¶
type Template struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` ZoneName string `json:"zonename,omitempty"` StorageGB int `json:"storagegb,omitempty"` }
Template is the base image for Exoscale virtual machines
type VM ¶
type VM struct { Config Config // Exoscale client configuration Name string // virtual machine name Template Template // template identification ServiceOffering ServiceOffering // Service offering SecurityGroups []SecurityGroup // list of security groups associated with the virtual machine KeypairName string // SSH Keypair identifier to use Userdata string // User data sent to the virtual machine Zone Zone // Zone identifier ID string // Virtual machine ID. JobID string // virtual machine creation job ID SSHCreds ssh.Credentials // SSH credentials required to connect to machine // contains filtered or unexported fields }
VM represents an Exoscale virtual machine.
func (*VM) GetName ¶
GetName returns the name of the virtual machine If an error occurs, an empty string is returned
func (*VM) Provision ¶
Provision creates a virtual machine on exoscale. A JobID is informed that can be used to poll the VM creation process (see WaitVMCreation)