Documentation ¶
Overview ¶
With many thanks to the example code from https://github.com/spaceapegames/terraform-provider-example
Index ¶
- type Client
- func (c *Client) CreateInstance(Name string, CPUs int, Memory int, Networks []NetworkSpec, Disks []DiskSpec, ...) (Instance, error)
- func (c *Client) CreateNetwork(netblock string, provideDHCP bool, provideNAT bool, name string) (Network, error)
- func (c *Client) DefloatInterface(interfaceUUID string) error
- func (c *Client) DeleteInstance(instanceUUID string) error
- func (c *Client) DeleteNetwork(networkUUID string) error
- func (c *Client) FloatInterface(interfaceUUID string) error
- func (c *Client) GetInstance(instanceUUID string) (Instance, error)
- func (c *Client) GetInstanceInterfaces(instanceUUID string) ([]NetworkInterface, error)
- func (c *Client) GetInstances() ([]Instance, error)
- func (c *Client) GetNetwork(networkUUID string) (Network, error)
- func (c *Client) GetNetworks() ([]Network, error)
- type DiskSpec
- type Instance
- type Network
- type NetworkInterface
- type NetworkSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds all of the information required to connect to the server
func (*Client) CreateInstance ¶
func (c *Client) CreateInstance(Name string, CPUs int, Memory int, Networks []NetworkSpec, Disks []DiskSpec, SSHKey string, UserData string) (Instance, error)
CreateInstance creates a new instance
func (*Client) CreateNetwork ¶
func (c *Client) CreateNetwork(netblock string, provideDHCP bool, provideNAT bool, name string) (Network, error)
CreateNetwork creates a new network
func (*Client) DefloatInterface ¶
DefloatInterface removes a floating IP from an interface
func (*Client) DeleteInstance ¶
DeleteInstance deletes an instance
func (*Client) DeleteNetwork ¶
DeleteNetwork removes a network with a specified UUID
func (*Client) FloatInterface ¶
FloatInterface adds a floating IP to an interface
func (*Client) GetInstance ¶
GetInstance fetches a specific instance by UUID
func (*Client) GetInstanceInterfaces ¶
func (c *Client) GetInstanceInterfaces(instanceUUID string) ([]NetworkInterface, error)
GetInstanceInterfaces fetches a list of network interfaces for an instance
func (*Client) GetInstances ¶
GetInstances fetches a list of instances
func (*Client) GetNetwork ¶
GetNetwork fetches a specific instance by UUID
func (*Client) GetNetworks ¶
GetNetworks fetches a list of networks
type DiskSpec ¶
type DiskSpec struct { Base string `json:"base"` Size int `json:"size"` Bus string `json:"bus"` Type string `json:"type"` }
DiskSpec is a definition of an instance disk
type Instance ¶
type Instance struct { UUID string `json:"uuid"` Name string `json:"name"` CPUs int `json:"cpus"` Memory int `json:"memory"` DiskSpecs []DiskSpec `json:"disk_spec"` SSHKey string `json:"ssh_key"` Node string `json:"node"` ConsolePort int `json:"console_port"` VDIPort int `json:"vdi_port"` UserData string `json:"User_data"` BlockDevices map[string]interface{} `json:"block_devices"` State string `json:"state"` StateUpdated float64 `json:"state_updated"` }
Instance is a definition of an instance
type Network ¶
type Network struct { UUID string `json:"uuid"` Name string `json:"name"` VXId int `json:"vxid"` NetBlock string `json:"netblock"` ProvideDHCP bool `json:"provide_dhcp"` ProvideNAT bool `json:"provide_nat"` Owner string `json:"owner"` FloatingGateway string `json:"floating_gateway"` State string `json:"state"` StateUpdated float64 `json:"state_updated"` }
Network is a definition of a network
type NetworkInterface ¶
type NetworkInterface struct { UUID string `json:"uuid"` NetworkUUID string `json:"network_uuid"` InstanceUUID string `json:"instance_uuid"` MACAddress string `json:"macaddr"` IPv4 string `json:"ipv4"` Order int `json:"order"` Floating string `json:"floating"` State string `json:"state"` StateUpdated float64 `json:"state_updated"` Model string `json:"model"` }
NetworkInterface is a definition of an network interface for an instance