Documentation ¶
Index ¶
- func ReadJSON(r io.Reader, v interface{}) error
- func WriteDrive(obj *Drive) (io.Reader, error)
- type Context
- type ContextDrive
- type ContextIPv4
- type ContextIPv4Config
- type ContextNIC
- type ContextVLan
- type Drive
- type Drives
- type Error
- type IPv4
- type Job
- type JobData
- type Jobs
- type LibraryDrive
- type Meta
- type NIC
- type Resource
- func MakeDriveResource(uuid string) *Resource
- func MakeIPResource(ip string) *Resource
- func MakeJobResource(uuid string) *Resource
- func MakeLibDriveResource(uuid string) *Resource
- func MakeResource(t, uuid string) *Resource
- func MakeServerResource(uuid string) *Resource
- func MakeUserResource(uuid string) *Resource
- func MakeVLanResource(uuid string) *Resource
- type RuntimeNetwork
- type RuntimeNetworkStat
- type Server
- type ServerDrive
- type Servers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct { CPU int64 `json:"cpu,omitempty"` CPUModel string `json:"cpu_model,omitempty"` Drives []ContextDrive `json:"drives,omitempty"` Mem int64 `json:"mem,omitempty"` Meta map[string]string `json:"meta,omitempty"` Name string `json:"name,omitempty"` NICs []ContextNIC `json:"nics,omitempty"` UUID string `json:"uuid,omitempty"` VNCPassword string `json:"vnc_password,omitempty"` }
Context contains detail properties of server instance context
type ContextDrive ¶
type ContextDrive struct { BootOrder int `json:"boot_order,omitempty"` Channel string `json:"dev_channel,omitempty"` Device string `json:"device,omitempty"` }
ContextDrive describes properties of disk drive in server context
type ContextIPv4 ¶
type ContextIPv4 struct { Conf string `json:"conf"` IP ContextIPv4Config `json:"ip"` }
ContextIPv4 describes IPv4 configuration in server context
type ContextIPv4Config ¶
type ContextIPv4Config struct { Gateway string `json:"gateway"` Meta map[string]string `json:"meta"` Nameservers []string `json:"nameservers"` Netmask int `json:"netmask"` UUID string `json:"uuid"` }
ContextIPv4Config describes IPv4 parameters in server context
type ContextNIC ¶
type ContextNIC struct { IPv4 *ContextIPv4 `json:"ip_v4_conf"` Mac string `json:"mac"` Model string `json:"model"` VLan *ContextVLan `json:"vlan"` }
ContextNIC describes network interface properties in server context
type ContextVLan ¶
type ContextVLan struct { Meta map[string]string `json:"meta,omitempty"` Tags []string `json:"tags,omitempty"` UUID string `json:"uuid"` }
ContextVLan describes network interface properties for VLan in server context
type Drive ¶
type Drive struct { Resource LibraryDrive Affinities []string `json:"affinities,omitempty"` AllowMultimount bool `json:"allow_multimount,omitempty"` Jobs []Resource `json:"jobs,omitempty"` Media string `json:"media,omitempty"` Meta map[string]string `json:"meta,omitempty"` Name string `json:"name,omitempty"` Owner *Resource `json:"owner,omitempty"` Size uint64 `json:"size,omitempty"` Status string `json:"status,omitempty"` StorageType string `json:"storage_type,omitempty"` }
Drive contains properties of cloud drive instance
type Error ¶
type Error struct { Point string `json:"error_point"` Type string `json:"error_type"` Message string `json:"error_message"` }
Error contains error information from server reply
type Job ¶
type Job struct { Resource Children []string `json:"children"` Created time.Time `json:"created"` Data JobData `json:"data"` LastModified time.Time `json:"last_modified"` Operation string `json:"operation"` Resources []string `json:"resources"` State string `json:"state"` }
Job contains properties of job instance
type JobData ¶
type JobData struct {
Progress int `json:"progress"`
}
JobData contains metainformation of job instance
type LibraryDrive ¶
type LibraryDrive struct { Arch string `json:"arch,omitempty"` ImageType string `json:"image_type,omitempty"` OS string `json:"os,omitempty"` Paid bool `json:"paid,omitempty"` }
LibraryDrive contains properties of cloud drive instance specific for CloudSigma media library drives
type Meta ¶
type Meta struct { Limit int `json:"limit"` Offset int `json:"offset"` TotalCount int `json:"total_count"` }
Meta describes properties of dataset
type NIC ¶
type NIC struct { IPv4 *IPv4 `json:"ip_v4_conf,omitempty"` Model string `json:"model,omitempty"` MAC string `json:"mac,omitempty"` VLAN *Resource `json:"vlan,omitempty"` Runtime *RuntimeNetwork `json:"runtime,omitempty"` }
NIC describes properties of network interface card
type Resource ¶
type Resource struct { URI string `json:"resource_uri,omitempty"` UUID string `json:"uuid,omitempty"` }
Resource describes properties of linked resource
func MakeDriveResource ¶
MakeDriveResource returns drive Resource structure for given UUID
func MakeIPResource ¶
MakeIPResource returns IP Resource structure for given IP address
func MakeJobResource ¶
MakeJobResource returns job Resource structure for given UUID
func MakeLibDriveResource ¶
MakeLibDriveResource returns library drive Resource structure for given UUID
func MakeResource ¶
MakeResource returns Resource structure from given type and UUID
func MakeServerResource ¶
MakeServerResource returns server Resource structure for given UUID
func MakeUserResource ¶
MakeUserResource returns user Resource structure for given UUID
func MakeVLanResource ¶
MakeVLanResource returns VLan Resource structure for given UUID
type RuntimeNetwork ¶
type RuntimeNetwork struct { InterfaceType string `json:"interface_type,omitempty"` IO RuntimeNetworkStat `json:"io,omitempty"` IPv4 *Resource `json:"ip_v4,omitempty"` }
RuntimeNetwork describes properties of network interface card at runtime
type RuntimeNetworkStat ¶
type RuntimeNetworkStat struct { BytesRecv int64 `json:"bytes_recv"` BytesSent int64 `json:"bytes_sent"` PacketsRecv int64 `json:"packets_recv"` PacketsSent int64 `json:"packets_sent"` }
RuntimeNetworkStat describes runtime I/O statistic for network interface card at runtime
type Server ¶
type Server struct { Resource Context bool `json:"context,omitempty"` CPU uint64 `json:"cpu,omitempty"` CPUsInsteadOfCores bool `json:"cpus_instead_of_cores,omitempty"` CPUModel string `json:"cpu_model,omitempty"` Drives []ServerDrive `json:"drives,omitempty"` Mem uint64 `json:"mem,omitempty"` Meta map[string]string `json:"meta,omitempty"` Name string `json:"name,omitempty"` NICs []NIC `json:"nics,omitempty"` SMP uint64 `json:"smp,omitempty"` Status string `json:"status,omitempty"` VNCPassword string `json:"vnc_password,omitempty"` }
Server contains detail properties of cloud server instance
func ReadServer ¶
ReadServer reads and unmarshalls description of single cloud server instance from JSON stream