Documentation
¶
Index ¶
- Constants
- type Account
- type BackupRule
- type CreateServerStorageDevice
- type Error
- type FirewallRule
- type FirewallRules
- type IPAddress
- type IPAddresses
- type Plan
- type Plans
- type Price
- type PrizeZone
- type PrizeZones
- type Server
- type ServerConfiguration
- type ServerConfigurations
- type ServerDetails
- type ServerStorageDevice
- type Servers
- type Storage
- type StorageDetails
- type Storages
- type Tag
- type Tags
- type TimeZones
- type Zone
- type Zones
Constants ¶
const ( FirewallRuleActionAccept = "accept" FirewallRuleActionReject = "reject" FirewallRuleActionDrop = "drop" FirewallRuleDirectionIn = "in" FirewallRuleDirectionOut = "out" FirewallRuleProtocolTCP = "tcp" FirewallRuleProtocolUDP = "udp" FirewallRuleProtocolICMP = "icmp" )
Constants
const ( IPAddressFamilyIPv4 = "IPv4" IPAddressFamilyIPv6 = "IPv6" IPAddressAccessPrivate = "private" IPAddressAccessPublic = "public" )
Constants
const ( ServerStateStarted = "started" ServerStateStopped = "stopped" ServerStateMaintenance = "maintenance" ServerStateError = "error" VideoModelVGA = "vga" VideoModelCirrus = "cirrus" StopTypeSoft = "soft" StopTypeHard = "hard" )
Constants
const ( StorageTypeBackup = "backup" StorageTypeCDROM = "cdrom" StorageTypeDisk = "disk" StorageTypeNormal = "normal" StorageTypeTemplate = "template" StorageTierHDD = "hdd" StorageTierMaxIOPS = "maxiops" StorageAccessPublic = "public" StorageAccessPrivate = "private" StorageStateOnline = "online" StorageStateMaintenance = "maintenance" StorageStateCloning = "cloning" StorageStateBackuping = "backuping" StorageStateError = "error" BackupRuleIntervalDaily = "daily" BackupRuleIntervalMonday = "mon" BackupRuleIntervalTuesday = "tue" BackupRuleIntervalWednesday = "wed" BackupRuleIntervalThursday = "thu" BackupRuleIntervalFriday = "fri" BackupRuleIntervalSaturday = "sat" BackupRuleIntervalSunday = "sun" CreateServerStorageDeviceActionCreate = "create" CreateServerStorageDeviceActionClone = "clone" CreateServerStorageDeviceActionAttach = "attach" )
Constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupRule ¶
type BackupRule struct {
XMLName xml.Name `xml:"backup_rule"`
Interval string `xml:"interval"`
// Time should be in the format "hhmm", e.g. "0430"
Time string `xml:"time"`
Retention int `xml:"retention"`
}
BackupRule represents a backup rule
type CreateServerStorageDevice ¶
type CreateServerStorageDevice struct {
XMLName xml.Name `xml:"storage_device"`
Action string `xml:"action"`
Address string `xml:"address,omitempty"`
Storage string `xml:"storage"`
Title string `xml:"title,omitempty"`
// Storage size in gigabytes
Size int `xml:"size"`
Tier string `xml:"tier,omitempty"`
Type string `xml:"type,omitempty"`
}
CreateServerStorageDevice represents a storage device for a CreateServerRequest
type FirewallRule ¶
type FirewallRule struct {
Action string `xml:"action"`
Comment string `xml:"comment,omitempty"`
DestinationAddressStart string `xml:"destination_address_start,omitempty"`
DestinationAddressEnd string `xml:"destination_address_end,omitempty"`
DestinationPortStart string `xml:"destination_port_start,omitempty"`
DestinationPortEnd string `xml:"destination_port_end,omitempty"`
Direction string `xml:"direction"`
Family string `xml:"family"`
ICMPType string `xml:"icmp_type,omitempty"`
Position int `xml:"position"`
Protocol string `xml:"protocol,omitempty"`
SourceAddressStart string `xml:"source_address_start,omitempty"`
SourceAddressEnd string `xml:"source_address_end,omitempty"`
SourcePortStart string `xml:"source_port_start,omitempty"`
SourcePortEnd string `xml:"source_port_end,omitempty"`
}
FirewallRule represents a single firewall rule. Note that most integer values are represented as strings
type FirewallRules ¶
type FirewallRules struct {
FirewallRules []FirewallRule `xml:"firewall_rule"`
}
FirewallRules represents a list of firewall rules
type IPAddress ¶
type IPAddress struct {
Access string `xml:"access"`
Address string `xml:"address"`
Family string `xml:"family"`
// TODO: Convert to boolean
PartOfPlan string `xml:"part_of_plan"`
PTRRecord string `xml:"ptr_record"`
ServerUUID string `xml:"server"`
}
IPAddress represents an IP address
type IPAddresses ¶
type IPAddresses struct {
IPAddresses []IPAddress `xml:"ip_address"`
}
IPAddresses represents a /ip_address response
type Plan ¶
type Plan struct {
CoreNumber int `xml:"core_number"`
MemoryAmount int `xml:"memory_amount"`
Name string `xml:"name"`
PublicTrafficOut int `xml:"public_traffic_out"`
StorageSize int `xml:"storage_size"`
StorageTier string `xml:"storage_tier"`
}
Plan represents a pre-configured server configuration plan
type PrizeZone ¶
type PrizeZone struct {
Name string `xml:"name"`
Firewall *Price `xml:"firewall"`
IORequestBackup *Price `xml:"io_request_backup"`
IORequestMaxIOPS *Price `xml:"io_request_maxiops"`
IPv4Address *Price `xml:"ipv4_address"`
IPv6Address *Price `xml:"ipv6_address"`
PublicIPv4BandwidthIn *Price `xml:"public_ipv4_bandwidth_in"`
PublicIPv4BandwidthOut *Price `xml:"public_ipv4_bandwidth_out"`
PublicIPv6BandwidthIn *Price `xml:"public_ipv6_bandwidth_in"`
PublicIPv6BandwidthOut *Price `xml:"public_ipv6_bandwidth_out"`
ServerCore *Price `xml:"server_core"`
ServerMemory *Price `xml:"server_memory"`
ServerPlan1xCPU1GB *Price `xml:"server_plan_1xCPU-1GB"`
ServerPlan2xCPU2GB *Price `xml:"server_plan_2xCPU-2GB"`
ServerPlan4xCPU4GB *Price `xml:"server_plan_4xCPU-4GB"`
ServerPlan6xCPU8GB *Price `xml:"server_plan_6xCPU-8GB"`
StorageBackup *Price `xml:"storage_backup"`
StorageMaxIOPS *Price `xml:"storage_maxiops"`
StorageTemplate *Price `xml:"storage_template"`
}
PrizeZone represents a price zone. A prize zone consists of multiple items that each have a price.
type PrizeZones ¶
type PrizeZones struct {
PrizeZones []PrizeZone `xml:"zone"`
}
PrizeZones represents a /price response
type Server ¶
type Server struct {
CoreNumber int `xml:"core_number"`
Hostname string `xml:"hostname"`
License float64 `xml:"license"`
MemoryAmount int `xml:"memory_amount"`
Plan string `xml:"plan"`
Progress int `xml:"progress"`
State string `xml:"state"`
Tags []string `xml:"tags>tag"`
Title string `xml:"title"`
UUID string `xml:"uuid"`
Zone string `xml:"zone"`
}
Server represents a server
type ServerConfiguration ¶
type ServerConfiguration struct {
CoreNumber int `xml:"core_number"`
MemoryAmount int `xml:"memory_amount"`
}
ServerConfiguration represents a server configuration
type ServerConfigurations ¶
type ServerConfigurations struct {
ServerConfigurations []ServerConfiguration `xml:"server_size"`
}
ServerConfigurations represents a /server_size response
type ServerDetails ¶
type ServerDetails struct {
Server
BootOrder string `xml:"boot_order"`
CoreNumber int `xml:"core_number"`
// TODO: Convert to boolean
Firewall string `xml:"firewall"`
Host int `xml:"host"`
IPAddresses []IPAddress `xml:"ip_addresses>ip_address"`
NICModel string `xml:"nic_model"`
StorageDevices []ServerStorageDevice `xml:"storage_devices>storage_device"`
Timezone string `xml:"timezone"`
VideoModel string `xml:"video_model"`
// TODO: Convert to boolean
VNC string `xml:"vnc"`
VNCHost string `xml:"vnc_host"`
VNCPassword string `xml:"vnc_password"`
VNCPort int `xml:"vnc_port"`
}
ServerDetails represents details about a server
type ServerStorageDevice ¶
type ServerStorageDevice struct {
XMLName xml.Name `xml:"storage_device"`
Address string `xml:"address"`
// TODO: Convert to boolean
PartOfPlan string `xml:"part_of_plan"`
UUID string `xml:"storage"`
Size int `xml:"storage_size"`
Title string `xml:"storage_title"`
Type string `xml:"type"`
}
ServerStorageDevice represents a storage device in the context of server requests or server details
type Servers ¶
type Servers struct {
Servers []Server `xml:"server"`
}
Servers represents a /server response
type Storage ¶
type Storage struct {
Access string `xml:"access"`
License float64 `xml:"license"`
// TODO: Convert to boolean
PartOfPlan string `xml:"part_of_plan"`
Size int `xml:"size"`
State string `xml:"state"`
Tier string `xml:"tier"`
Title string `xml:"title"`
Type string `xml:"type"`
UUID string `xml:"uuid"`
Zone string `xml:"zone"`
// Only for type "backup":
Origin string `xml:"origin"`
Created time.Time `xml:"created"`
}
Storage represents a storage device
type StorageDetails ¶
type StorageDetails struct {
Storage
BackupRule *BackupRule `xml:"backup_rule"`
BackupUUIDs []string `xml:"backups>backup"`
ServerUUIDs []string `xml:"servers>server"`
}
StorageDetails represents detailed information about a piece of storage
type Storages ¶
type Storages struct {
Storages []Storage `xml:"storage"`
}
Storages represents a /storage response
type Tag ¶
type Tag struct {
Name string `xml:"name"`
Description string `xml:"description,omitempty"`
Servers []string `xml:"servers>server"`
}
Tag represents a server tag
type TimeZones ¶
type TimeZones struct {
TimeZones []string `xml:"timezone"`
}
TimeZones represents a list of timezones