upcloud

package
v0.0.0-...-278d4fc Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FirewallRuleActionAccept = "accept"
	FirewallRuleActionReject = "reject"
	FirewallRuleActionDrop   = "drop"

	FirewallRuleDirectionIn  = "in"
	FirewallRuleDirectionOut = "out"

	FirewallRuleProtocolTCP  = "tcp"
	FirewallRuleProtocolUDP  = "udp"
	FirewallRuleProtocolICMP = "icmp"
)

Constants

View Source
const (
	IPAddressFamilyIPv4 = "IPv4"
	IPAddressFamilyIPv6 = "IPv6"

	IPAddressAccessPrivate = "private"
	IPAddressAccessPublic  = "public"
)

Constants

View Source
const (
	ServerStateStarted     = "started"
	ServerStateStopped     = "stopped"
	ServerStateMaintenance = "maintenance"
	ServerStateError       = "error"

	VideoModelVGA    = "vga"
	VideoModelCirrus = "cirrus"

	StopTypeSoft = "soft"
	StopTypeHard = "hard"
)

Constants

View Source
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 Account

type Account struct {
	Credits  float64 `xml:"credits"`
	UserName string  `xml:"username"`
}

Account represents an account

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 Error

type Error struct {
	ErrorCode    string `xml:"error_code"`
	ErrorMessage string `xml:"error_message"`
}

Error represents an error

func (*Error) Error

func (e *Error) Error() string

Error implements the Error interface

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 Plans

type Plans struct {
	Plans []Plan `xml:"plan"`
}

Plans represents a /plan response

type Price

type Price struct {
	Amount int     `xml:"amount"`
	Price  float64 `xml:"price"`
}

Price represents a price

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 Tags

type Tags struct {
	Tags []Tag `xml:"tag"`
}

Tags represents a list of tags

type TimeZones

type TimeZones struct {
	TimeZones []string `xml:"timezone"`
}

TimeZones represents a list of timezones

type Zone

type Zone struct {
	Id          string `xml:"id"`
	Description string `xml:"description"`
}

Zone represents a zone

type Zones

type Zones struct {
	Zones []Zone `xml:"zone"`
}

Zones represents a /zone response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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