api

package
v0.0.0-...-dd062b7 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Url    string
	ApiId  string
	ApiKey string
}

func (*Client) ImageDelete

func (this *Client) ImageDelete(imageId int) error

func (*Client) ImageFetch

func (this *Client) ImageFetch(region string, name string, url string, format string) (int, error)

func (*Client) ImageInfo

func (this *Client) ImageInfo(imageId int) (*ImageInfoResponse, error)

func (*Client) ImageList

func (this *Client) ImageList() ([]*Image, error)

func (*Client) KeyAdd

func (this *Client) KeyAdd(name string, key string) (int, error)

func (*Client) KeyList

func (this *Client) KeyList() ([]*Key, error)

func (*Client) KeyRemove

func (this *Client) KeyRemove(keyId int) error

func (*Client) PlanList

func (this *Client) PlanList() ([]*Plan, error)

func (*Client) VmAction

func (this *Client) VmAction(vmId int, action string, value string) error

func (*Client) VmAddressAdd

func (this *Client) VmAddressAdd(vmId int) error

func (*Client) VmAddressRdns

func (this *Client) VmAddressRdns(vmId int, ip string, hostname string) error

func (*Client) VmAddressRemove

func (this *Client) VmAddressRemove(vmId int, ip string, privateip string) error

func (*Client) VmAddresses

func (this *Client) VmAddresses(vmId int) ([]*IpAddress, error)

func (*Client) VmCreate

func (this *Client) VmCreate(name string, planId int, imageId int, options *VmCreateOptions) (int, error)

func (*Client) VmDelete

func (this *Client) VmDelete(vmId int) error

func (*Client) VmInfo

func (this *Client) VmInfo(vmId int) (*VMInfoResponse, error)

func (*Client) VmList

func (this *Client) VmList() ([]*VirtualMachine, error)

func (*Client) VmReimage

func (this *Client) VmReimage(vmId int, imageId int) error

func (*Client) VmResize

func (this *Client) VmResize(vmId int, planId int) error

func (*Client) VmSnapshot

func (this *Client) VmSnapshot(vmId int, name string) (int, error)

func (*Client) VmVnc

func (this *Client) VmVnc(vmId int) (string, error)

type Image

type Image struct {
	Id     int    `json:"id"`
	Region string `json:"region"`
	Name   string `json:"name"`
	Status string `json:"status"`
}

type ImageDetails

type ImageDetails struct {
	Size    int64             `json:"size"`
	Status  string            `json:"status"`
	Details map[string]string `json:"details"`
}

type ImageFetchRequest

type ImageFetchRequest struct {
	Region string `json:"region"`
	Name   string `json:"name"`
	Url    string `json:"url"`
	Format string `json:"format"`
}

type ImageFetchResponse

type ImageFetchResponse struct {
	Id int `json:"id"`
}

type ImageInfoResponse

type ImageInfoResponse struct {
	Image   *Image        `json:"image"`
	Details *ImageDetails `json:"details"`
}

type ImageListResponse

type ImageListResponse struct {
	Images []*Image `json:"images"`
}

type IpAddress

type IpAddress struct {
	Ip        string `json:"ip"`
	PrivateIp string `json:"private_ip"`
	CanRdns   bool   `json:"can_rdns"`
	Hostname  string `json:"hostname"`
}

type Key

type Key struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
}

type KeyAddRequest

type KeyAddRequest struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

type KeyAddResponse

type KeyAddResponse struct {
	Id int `json:"id"`
}

type KeyListResponse

type KeyListResponse struct {
	Keys []*Key `json:"keys"`
}

type Plan

type Plan struct {
	Id        int    `json:"id"`
	Name      string `json:"name"`
	Price     int64  `json:"price"`
	Ram       int    `json:"ram"`
	Cpu       int    `json:"cpu"`
	Storage   int    `json:"storage"`
	Bandwidth int    `json:"bandwidth"`
}

type PlanListResponse

type PlanListResponse struct {
	Plans []*Plan `json:"plans"`
}

type VMActionRequest

type VMActionRequest struct {
	Action string `json:"action"`
	Value  string `json:"value"`
}

type VMAddressRdnsRequest

type VMAddressRdnsRequest struct {
	Hostname string `json:"hostname"`
}

type VMAddressRemoveRequest

type VMAddressRemoveRequest struct {
	Ip        string `json:"ip"`
	PrivateIp string `json:"private_ip"`
}

type VMAddressesResponse

type VMAddressesResponse struct {
	Addresses []*IpAddress `json:"addresses"`
}

type VMCreateRequest

type VMCreateRequest struct {
	Name    string `json:"name"`
	PlanId  int    `json:"plan_id"`
	ImageId int    `json:"image_id"`
	KeyId   int    `json:"key_id"`
}

type VMCreateResponse

type VMCreateResponse struct {
	Id int `json:"id"`
}

type VMInfoResponse

type VMInfoResponse struct {
	VirtualMachine *VirtualMachine        `json:"vm"`
	Details        *VirtualMachineDetails `json:"details"`
}

type VMListResponse

type VMListResponse struct {
	VirtualMachines []*VirtualMachine `json:"vms"`
}

type VMReimageRequest

type VMReimageRequest struct {
	ImageId int `json:"image_id"`
}

type VMResizeRequest

type VMResizeRequest struct {
	PlanId int `json:"plan_id"`
}

type VMSnapshotResponse

type VMSnapshotResponse struct {
	Id int `json:"id"`
}

type VMVncResponse

type VMVncResponse struct {
	Url string `json:"url"`
}

type VirtualMachine

type VirtualMachine struct {
	Id     int `json:"id"`
	PlanId int `json:"plan_id"`

	Region      string `json:"region"`
	Name        string `json:"name"`
	Status      string `json:"status"`
	TaskPending bool   `json:"task_pending"`
	ExternalIP  string `json:"external_ip"`
	PrivateIP   string `json:"private_ip"`
	CreatedTime int64  `json:"created_time"`
}

type VirtualMachineAction

type VirtualMachineAction struct {
	Action      string            `json:"action"`
	Name        string            `json:"name"`
	Options     map[string]string `json:"options"`
	Description string            `json:"description"`
	Dangerous   bool              `json:"dangerous"`
}

type VirtualMachineDetails

type VirtualMachineDetails struct {
	Ip            string                  `json:"ip"`
	PrivateIp     string                  `json:"private_ip"`
	Status        string                  `json:"status"`
	Hostname      string                  `json:"hostname"`
	BandwidthUsed int64                   `json:"bandwidth_used"`
	LoginDetails  string                  `json:"login_details"`
	Details       map[string]string       `json:"details"`
	Actions       []*VirtualMachineAction `json:"actions"`
	CanVnc        bool                    `json:"can_vnc"`
	CanReimage    bool                    `json:"can_reimage"`
	CanResize     bool                    `json:"can_resize"`
	CanSnapshot   bool                    `json:"can_snapshot"`
	CanAddresses  bool                    `json:"can_addresses"`
}

type VmCreateOptions

type VmCreateOptions struct {
	KeyId int
}

Jump to

Keyboard shortcuts

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