api

package
v0.0.0-...-15aa78f Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2016 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	TargetURL string
	ZoneID    string
	APIKey    string
	SecretKey string
}

func (*API) CreateVMSnapshot

func (api *API) CreateVMSnapshot(id string) (string, error)

func (*API) DeployVirtualMachine

func (api *API) DeployVirtualMachine(options *DeployVirtualMachineOptions) (string, string, error)

func (*API) DestroyVirtualMachine

func (api *API) DestroyVirtualMachine(id string, expunge bool) error

func (*API) GetVirtualMachine

func (api *API) GetVirtualMachine(id string) (*VirtualMachine, error)

func (*API) ListDiskOfferings

func (api *API) ListDiskOfferings() ([]DiskOffering, error)

func (*API) ListServiceOfferings

func (api *API) ListServiceOfferings() ([]ServiceOffering, error)

func (*API) ListVirtualMachines

func (api *API) ListVirtualMachines() ([]VirtualMachine, error)

func (*API) QueryDeployJob

func (api *API) QueryDeployJob(jobid string) (*DeployVirtualMachineResult, error)

func (*API) RebootVirtualMachine

func (api *API) RebootVirtualMachine(id string) error

func (*API) StartVirtualMachine

func (api *API) StartVirtualMachine(id string) error

func (*API) StopVirtualMachine

func (api *API) StopVirtualMachine(id string) error

type DeployVirtualMachineOptions

type DeployVirtualMachineOptions struct {
	// Required options
	ServiceOffering string
	DiskOffering    string
	Template        string

	// Optional options
	Network string
	Name    string
}

type DeployVirtualMachineResponse

type DeployVirtualMachineResponse struct {
	ID    string `json:"id"`
	JobID string `json:"jobid"`
}

type DeployVirtualMachineResult

type DeployVirtualMachineResult struct {
	Password string `json:"password"`
}

type DiskOffering

type DiskOffering struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	DiskSize     int    `json:"disksize"`
	IsCustomized bool   `json:"iscustomized"`
}

type ErrorResponse

type ErrorResponse struct {
	ErrorCode int    `json:"errorcode"`
	ErrorText string `json:"errortext"`
}

type IDResponse

type IDResponse struct {
	ID string `json:"id"`
}

type ListDiskOfferingsResponse

type ListDiskOfferingsResponse struct {
	DiskOfferings []DiskOffering `json:"diskoffering"`
}

type ListServiceOfferingsResponse

type ListServiceOfferingsResponse struct {
	ServiceOfferings []ServiceOffering `json:"serviceoffering"`
}

type ListVirtualMachinesResponse

type ListVirtualMachinesResponse struct {
	VirtualMachines []VirtualMachine `json:"virtualmachine"`
}

type Nic

type Nic struct {
	Addr string `json:"ipaddress"`
}

type ServiceOffering

type ServiceOffering struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	CPUNumber int    `json:"cpunumber"`
	Memory    int    `json:"memory"`
}

type VirtualMachine

type VirtualMachine struct {
	ID       string `json:"id"`
	State    string `json:"state"`
	Nics     []Nic  `json:"nic"`
	Hostname string `json:"hostname"`
}

Jump to

Keyboard shortcuts

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