Documentation ¶
Index ¶
- Constants
- type AssignIPAddressRequest
- type AttachStorageRequest
- type CloneStorageRequest
- type CreateBackupRequest
- type CreateFirewallRuleRequest
- type CreateNetworkInterfaceRequest
- type CreateSDNPrivateNetworkRequest
- type CreateServerIPAddress
- type CreateServerRequest
- type CreateStorageRequest
- type CreateTagRequest
- type DeleteFirewallRuleRequest
- type DeleteNetworkInterfaceRequest
- type DeleteNetworkRequest
- type DeleteServerAndStoragesRequest
- type DeleteServerRequest
- type DeleteStorageRequest
- type DeleteTagRequest
- type DetachStorageRequest
- type EjectCDROMRequest
- type GetFirewallRuleDetailsRequest
- type GetFirewallRulesRequest
- type GetIPAddressDetailsRequest
- type GetNetworkDetailsRequest
- type GetNetworksInZoneRequest
- type GetNetworksRequest
- type GetServerDetailsRequest
- type GetStorageDetailsRequest
- type GetStoragesRequest
- type IPAddress
- type IPAddresses
- type IPNetwork
- type IPNetworks
- type Interface
- type ListServerNetworks
- type LoadCDROMRequest
- type LoginUser
- type ModifyIPAddressRequest
- type ModifyNetworkDetailsRequest
- type ModifyNetworkInterfaceRequest
- type ModifyServerRequest
- type ModifyStorageRequest
- type ModifyTagRequest
- type Network
- type ReleaseIPAddressRequest
- type Request
- type RestartServerRequest
- type RestoreBackupRequest
- type StartServerRequest
- type StopServerRequest
- type TagServerRequest
- type TemplatizeStorageRequest
- type UntagServerRequest
- type WaitForServerStateRequest
- type WaitForStorageStateRequest
Constants ¶
const ( PasswordDeliveryNone = "none" PasswordDeliveryEmail = "email" PasswordDeliverySMS = "sms" ServerStopTypeSoft = "soft" ServerStopTypeHard = "hard" RestartTimeoutActionDestroy = "destroy" RestartTimeoutActionIgnore = "ignore" )
Constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignIPAddressRequest ¶
type AssignIPAddressRequest struct { XMLName xml.Name `xml:"ip_address"` Access string `xml:"access"` Family string `xml:"family,omitempty"` ServerUUID string `xml:"server"` }
AssignIPAddressRequest represents a request to assign a new IP address to a server
func (*AssignIPAddressRequest) RequestURL ¶
func (r *AssignIPAddressRequest) RequestURL() string
RequestURL implements the Request interface
type AttachStorageRequest ¶
type AttachStorageRequest struct { XMLName xml.Name `xml:"storage_device"` ServerUUID string `xml:"-"` Type string `xml:"type,omitempty"` Address string `xml:"address,omitempty"` StorageUUID string `xml:"storage,omitempty"` }
AttachStorageRequest represents a request to attach a storage device to a server
func (*AttachStorageRequest) RequestURL ¶
func (r *AttachStorageRequest) RequestURL() string
RequestURL implements the Request interface
type CloneStorageRequest ¶
type CloneStorageRequest struct { XMLName xml.Name `xml:"storage"` UUID string `xml:"-"` Zone string `xml:"zone"` Tier string `xml:"tier,omitempty"` Title string `xml:"title"` }
CloneStorageRequest represents a requests to clone a storage device
func (*CloneStorageRequest) RequestURL ¶
func (r *CloneStorageRequest) RequestURL() string
RequestURL implements the Request interface
type CreateBackupRequest ¶
type CreateBackupRequest struct { XMLName xml.Name `xml:"storage"` UUID string `xml:"-"` Title string `xml:"title"` }
CreateBackupRequest represents a request to create a backup of a storage device
func (*CreateBackupRequest) RequestURL ¶
func (r *CreateBackupRequest) RequestURL() string
RequestURL implements the Request interface
type CreateFirewallRuleRequest ¶
type CreateFirewallRuleRequest struct { upcloud.FirewallRule XMLName xml.Name `xml:"firewall_rule"` ServerUUID string `xml:"-"` }
CreateFirewallRuleRequest represents a request to create a new firewall rule for a specific server
func (*CreateFirewallRuleRequest) RequestURL ¶
func (r *CreateFirewallRuleRequest) RequestURL() string
RequestURL implements the Request interface
type CreateNetworkInterfaceRequest ¶
type CreateNetworkInterfaceRequest struct { Interface Interface `json:"interface"` ServerUUID string `json:"-"` }
func (*CreateNetworkInterfaceRequest) RequestURL ¶
func (r *CreateNetworkInterfaceRequest) RequestURL() string
type CreateSDNPrivateNetworkRequest ¶
type CreateSDNPrivateNetworkRequest struct {
Network Network `json:"network"`
}
func (*CreateSDNPrivateNetworkRequest) RequestURL ¶
func (r *CreateSDNPrivateNetworkRequest) RequestURL() string
RequestURL implements the Request interface
type CreateServerIPAddress ¶
CreateServerIPAddress represents an IP address for a CreateServerRequest
type CreateServerRequest ¶
type CreateServerRequest struct { XMLName xml.Name `xml:"server"` AvoidHost string `xml:"avoid_host,omitempty"` BootOrder string `xml:"boot_order,omitempty"` CoreNumber int `xml:"core_number,omitempty"` // TODO: Convert to boolean Firewall string `xml:"firewall,omitempty"` Hostname string `xml:"hostname"` IPAddresses []CreateServerIPAddress `xml:"ip_addresses>ip_address"` LoginUser *LoginUser `xml:"login_user,omitempty"` MemoryAmount int `xml:"memory_amount,omitempty"` PasswordDelivery string `xml:"password_delivery,omitempty"` Plan string `xml:"plan,omitempty"` StorageDevices []upcloud.CreateServerStorageDevice `xml:"storage_devices>storage_device"` TimeZone string `xml:"timezone,omitempty"` Title string `xml:"title"` UserData string `xml:"user_data,omitempty"` VideoModel string `xml:"video_model,omitempty"` // TODO: Convert to boolean VNC string `xml:"vnc,omitempty"` VNCPassword string `xml:"vnc_password,omitempty"` Zone string `xml:"zone"` }
CreateServerRequest represents a request for creating a new server
func (*CreateServerRequest) RequestURL ¶
func (r *CreateServerRequest) RequestURL() string
RequestURL implements the Request interface
type CreateStorageRequest ¶
type CreateStorageRequest struct { XMLName xml.Name `xml:"storage"` Size int `xml:"size"` Tier string `xml:"tier,omitempty"` Title string `xml:"title"` Zone string `xml:"zone"` BackupRule *upcloud.BackupRule `xml:"backup_rule,omitempty"` }
CreateStorageRequest represents a request to create a storage device
func (*CreateStorageRequest) RequestURL ¶
func (r *CreateStorageRequest) RequestURL() string
RequestURL implements the Request interface
type CreateTagRequest ¶
CreateTagRequest represents a request to create a tag and assign it to zero or more servers
func (*CreateTagRequest) RequestURL ¶
func (r *CreateTagRequest) RequestURL() string
RequestURL implements the Request interface
type DeleteFirewallRuleRequest ¶
DeleteFirewallRuleRequest represents a request to remove a firewall rule
func (*DeleteFirewallRuleRequest) RequestURL ¶
func (r *DeleteFirewallRuleRequest) RequestURL() string
RequestURL implements the Request interface
type DeleteNetworkInterfaceRequest ¶
func (*DeleteNetworkInterfaceRequest) RequestURL ¶
func (r *DeleteNetworkInterfaceRequest) RequestURL() string
type DeleteNetworkRequest ¶
type DeleteNetworkRequest struct {
UUID string `xml:"uuid"`
}
func (*DeleteNetworkRequest) RequestURL ¶
func (r *DeleteNetworkRequest) RequestURL() string
RequestURL implements the Request interface
type DeleteServerAndStoragesRequest ¶
type DeleteServerAndStoragesRequest struct {
UUID string
}
DeleteServerAndStoragesRequest represents a request to delete a server and all attached storages
func (*DeleteServerAndStoragesRequest) RequestURL ¶
func (r *DeleteServerAndStoragesRequest) RequestURL() string
RequestURL implements the Request interface
type DeleteServerRequest ¶
type DeleteServerRequest struct {
UUID string
}
DeleteServerRequest represents a request to delete a server
func (*DeleteServerRequest) RequestURL ¶
func (r *DeleteServerRequest) RequestURL() string
RequestURL implements the Request interface
type DeleteStorageRequest ¶
type DeleteStorageRequest struct {
UUID string
}
DeleteStorageRequest represents a request to delete a storage device
func (*DeleteStorageRequest) RequestURL ¶
func (r *DeleteStorageRequest) RequestURL() string
RequestURL implements the Request interface
type DeleteTagRequest ¶
type DeleteTagRequest struct {
Name string
}
DeleteTagRequest represents a request to delete a tag
func (*DeleteTagRequest) RequestURL ¶
func (r *DeleteTagRequest) RequestURL() string
RequestURL implements the Request interface
type DetachStorageRequest ¶
type DetachStorageRequest struct { XMLName xml.Name `xml:"storage_device"` ServerUUID string `xml:"-"` Address string `xml:"address"` }
DetachStorageRequest represents a request to detach a storage device from a server
func (*DetachStorageRequest) RequestURL ¶
func (r *DetachStorageRequest) RequestURL() string
RequestURL implements the Request interface
type EjectCDROMRequest ¶
type EjectCDROMRequest struct {
ServerUUID string
}
EjectCDROMRequest represents a request to load a storage as a CD-ROM in the CD-ROM device of a server
func (*EjectCDROMRequest) RequestURL ¶
func (r *EjectCDROMRequest) RequestURL() string
RequestURL implements the Request interface
type GetFirewallRuleDetailsRequest ¶
GetFirewallRuleDetailsRequest represents a request to get details about a specific firewall rule
func (*GetFirewallRuleDetailsRequest) RequestURL ¶
func (r *GetFirewallRuleDetailsRequest) RequestURL() string
RequestURL implements the Request interface
type GetFirewallRulesRequest ¶
type GetFirewallRulesRequest struct {
ServerUUID string
}
GetFirewallRulesRequest represents a request for retrieving the firewall rules for a specific server
func (*GetFirewallRulesRequest) RequestURL ¶
func (r *GetFirewallRulesRequest) RequestURL() string
RequestURL implements the Request interface
type GetIPAddressDetailsRequest ¶
type GetIPAddressDetailsRequest struct {
Address string
}
GetIPAddressDetailsRequest represents a request to retrieve details about a specific IP address
func (*GetIPAddressDetailsRequest) RequestURL ¶
func (r *GetIPAddressDetailsRequest) RequestURL() string
RequestURL implements the Request interface
type GetNetworkDetailsRequest ¶
type GetNetworkDetailsRequest struct {
UUID string `xml:"uuid"`
}
func (*GetNetworkDetailsRequest) RequestURL ¶
func (r *GetNetworkDetailsRequest) RequestURL() string
RequestURL implements the Request interface
type GetNetworksInZoneRequest ¶
type GetNetworksInZoneRequest struct {
Zone string `xml:"zone"`
}
GetNetworksRequest represents a request to retrieve all networks in a zone
func (*GetNetworksInZoneRequest) RequestURL ¶
func (r *GetNetworksInZoneRequest) RequestURL() string
RequestURL implements the Request interface
type GetNetworksRequest ¶
type GetNetworksRequest struct { }
GetNetworksRequest represents a request to retrieve all networks
func (*GetNetworksRequest) RequestURL ¶
func (r *GetNetworksRequest) RequestURL() string
RequestURL implements the Request interface
type GetServerDetailsRequest ¶
type GetServerDetailsRequest struct {
UUID string
}
GetServerDetailsRequest represents a request for retrieving details about a server
func (*GetServerDetailsRequest) RequestURL ¶
func (r *GetServerDetailsRequest) RequestURL() string
RequestURL implements the Request interface
type GetStorageDetailsRequest ¶
type GetStorageDetailsRequest struct {
UUID string
}
GetStorageDetailsRequest represents a request for retrieving details about a piece of storage
func (*GetStorageDetailsRequest) RequestURL ¶
func (r *GetStorageDetailsRequest) RequestURL() string
RequestURL implements the Request interface
type GetStoragesRequest ¶
type GetStoragesRequest struct { // If specified, only storages with this access type will be retrieved Access string // If specified, only storages with this type will be retrieved Type string // If specified, only storages marked as favorite will be retrieved Favorite bool }
GetStoragesRequest represents a request for retrieving all or some storages
func (*GetStoragesRequest) RequestURL ¶
func (r *GetStoragesRequest) RequestURL() string
RequestURL implements the Request interface
type IPAddresses ¶
type IPAddresses struct {
IPAddress []IPAddress `xml:"ip_address,omitempty"`
}
type IPNetworks ¶
type IPNetworks struct {
IPNetwork []IPNetwork `json:"ip_network"`
}
type ListServerNetworks ¶
type ListServerNetworks struct { Interface Interface `xml:"interface"` ServerUUID string `xml:"-"` }
func (*ListServerNetworks) RequestURL ¶
func (r *ListServerNetworks) RequestURL() string
type LoadCDROMRequest ¶
type LoadCDROMRequest struct { XMLName xml.Name `xml:"storage_device"` ServerUUID string `xml:"-"` StorageUUID string `xml:"storage"` }
LoadCDROMRequest represents a request to load a storage as a CD-ROM in the CD-ROM device of a server
func (*LoadCDROMRequest) RequestURL ¶
func (r *LoadCDROMRequest) RequestURL() string
RequestURL implements the Request interface
type LoginUser ¶
type LoginUser struct { CreatePassword string `xml:"create_password,omitempty"` Username string `xml:"username,omitempty"` SSHKeys []string `xml:"ssh_keys>ssh_key,omitempty"` }
LoginUser represents the login_user block when creating a new server
type ModifyIPAddressRequest ¶
type ModifyIPAddressRequest struct { XMLName xml.Name `xml:"ip_address"` IPAddress string `xml:"-"` PTRRecord string `xml:"ptr_record"` }
ModifyIPAddressRequest represents a request to modify the PTR DNS record of a specific IP address
func (*ModifyIPAddressRequest) RequestURL ¶
func (r *ModifyIPAddressRequest) RequestURL() string
RequestURL implements the Request interface
type ModifyNetworkDetailsRequest ¶
func (*ModifyNetworkDetailsRequest) RequestURL ¶
func (r *ModifyNetworkDetailsRequest) RequestURL() string
RequestURL implements the Request interface
type ModifyNetworkInterfaceRequest ¶
type ModifyNetworkInterfaceRequest struct { Interface Interface `xml:"interface"` ServerUUID string `xml:"-"` Index int `xml:"-"` }
func (*ModifyNetworkInterfaceRequest) RequestURL ¶
func (r *ModifyNetworkInterfaceRequest) RequestURL() string
type ModifyServerRequest ¶
type ModifyServerRequest struct { XMLName xml.Name `xml:"server"` UUID string `xml:"-"` AvoidHost string `xml:"avoid_host,omitempty"` BootOrder string `xml:"boot_order,omitempty"` // TODO: Investigate correct type and format CoreNumber string `xml:"core_number,omitempty"` // TODO: Convert to boolean Firewall string `xml:"firewall,omitempty"` Hostname string `xml:"hostname,omitempty"` // TODO: Investigate correct type and format MemoryAmount string `xml:"memory_amount,omitempty"` Plan string `xml:"plan,omitempty"` TimeZone string `xml:"timezone,omitempty"` Title string `xml:"title,omitempty"` VideoModel string `xml:"video_model,omitempty"` // TODO: Convert to boolean VNC string `xml:"vnc,omitempty"` VNCPassword string `xml:"vnc_password,omitempty"` }
ModifyServerRequest represents a request to modify a server
func (*ModifyServerRequest) RequestURL ¶
func (r *ModifyServerRequest) RequestURL() string
RequestURL implements the Request interface
type ModifyStorageRequest ¶
type ModifyStorageRequest struct { XMLName xml.Name `xml:"storage"` UUID string `xml:"-"` Title string `xml:"title,omitempty"` Size int `xml:"size,omitempty"` BackupRule *upcloud.BackupRule `xml:"backup_rule,omitempty"` }
ModifyStorageRequest represents a request to modify a storage device
func (*ModifyStorageRequest) RequestURL ¶
func (r *ModifyStorageRequest) RequestURL() string
RequestURL implements the Request interface
type ModifyTagRequest ¶
ModifyTagRequest represents a request to modify an existing tag. The Name is the name of the current tag, the Tag is the new values for the tag.
func (*ModifyTagRequest) RequestURL ¶
func (r *ModifyTagRequest) RequestURL() string
RequestURL implements the Request interface
type Network ¶
type Network struct { Name string `json:"name,omitempty"` Zone string `json:"zone,omitempty"` IPNetworks IPNetworks `json:"ip_networks"` }
type ReleaseIPAddressRequest ¶
type ReleaseIPAddressRequest struct {
IPAddress string
}
ReleaseIPAddressRequest represents a request to remove a specific IP address from server
func (*ReleaseIPAddressRequest) RequestURL ¶
func (r *ReleaseIPAddressRequest) RequestURL() string
RequestURL implements the Request interface
type Request ¶
type Request interface { // RequestURL returns the relative API URL for the request, excluding the API version. RequestURL() string }
Request is the interface for request objects
type RestartServerRequest ¶
type RestartServerRequest struct { XMLName xml.Name `xml:"restart_server"` UUID string `xml:"-"` StopType string `xml:"stop_type,omitempty"` Timeout time.Duration `xml:"timeout,omitempty"` TimeoutAction string `xml:"timeout_action,omitempty"` }
RestartServerRequest represents a request to restart a server
func (*RestartServerRequest) MarshalXML ¶
func (r *RestartServerRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements a custom marshaller for RestartServerRequest which converts the timeout to seconds
func (*RestartServerRequest) RequestURL ¶
func (r *RestartServerRequest) RequestURL() string
RequestURL implements the Request interface
type RestoreBackupRequest ¶
type RestoreBackupRequest struct {
UUID string
}
RestoreBackupRequest represents a request to restore a storage from the specified backup
func (*RestoreBackupRequest) RequestURL ¶
func (r *RestoreBackupRequest) RequestURL() string
RequestURL implements the Request interface
type StartServerRequest ¶
type StartServerRequest struct { UUID string // TODO: Start server requests have no timeout in the API Timeout time.Duration }
StartServerRequest represents a request to start a server
func (*StartServerRequest) RequestURL ¶
func (r *StartServerRequest) RequestURL() string
RequestURL implements the Request interface
type StopServerRequest ¶
type StopServerRequest struct { XMLName xml.Name `xml:"stop_server"` UUID string `xml:"-"` StopType string `xml:"stop_type,omitempty"` Timeout time.Duration `xml:"timeout,omitempty"` }
StopServerRequest represents a request to stop a server
func (*StopServerRequest) MarshalXML ¶
func (r *StopServerRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements a custom marshaller for StopServerRequest which converts the timeout to seconds
func (*StopServerRequest) RequestURL ¶
func (r *StopServerRequest) RequestURL() string
RequestURL implements the Request interface
type TagServerRequest ¶
TagServerRequest represents a request to tag a server with one or more tags
func (*TagServerRequest) RequestURL ¶
func (r *TagServerRequest) RequestURL() string
RequestURL implements the Request interface
type TemplatizeStorageRequest ¶
type TemplatizeStorageRequest struct { XMLName xml.Name `xml:"storage"` UUID string `xml:"-"` Title string `xml:"title"` }
TemplatizeStorageRequest represents a request to templatize a storage device
func (*TemplatizeStorageRequest) RequestURL ¶
func (r *TemplatizeStorageRequest) RequestURL() string
RequestURL implements the Request interface
type UntagServerRequest ¶
UntagServerRequest represents a request to remove one or more tags from a server
func (*UntagServerRequest) RequestURL ¶
func (r *UntagServerRequest) RequestURL() string
RequestURL implements the Request interface