upcloud

package
v4.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 4 Imported by: 1

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"
	IPAddressAccessUtility = "utility"
)

Constants

View Source
const (
	LoadBalancerModeHTTP LoadBalancerMode = "http"
	LoadBalancerModeTCP  LoadBalancerMode = "tcp"

	LoadBalancerBackendMemberTypeStatic  LoadBalancerBackendMemberType = "static"
	LoadBalancerBackendMemberTypeDynamic LoadBalancerBackendMemberType = "dynamic"

	LoadBalancerConfiguredStatusStarted LoadBalancerConfiguredStatus = "started"
	LoadBalancerConfiguredStatusStopped LoadBalancerConfiguredStatus = "stopped"

	LoadBalancerCertificateBundleTypeManual  LoadBalancerCertificateBundleType = "manual"
	LoadBalancerCertificateBundleTypeDynamic LoadBalancerCertificateBundleType = "dynamic"

	LoadBalancerOperationalStatePending       LoadBalancerOperationalState = "pending"
	LoadBalancerOperationalStateSetupAgent    LoadBalancerOperationalState = "setup-agent"
	LoadBalancerOperationalStateSetupServer   LoadBalancerOperationalState = "setup-server"
	LoadBalancerOperationalStateSetupNetwork  LoadBalancerOperationalState = "setup-network"
	LoadBalancerOperationalStateSetupLB       LoadBalancerOperationalState = "setup-lb"
	LoadBalancerOperationalStateSetupDNS      LoadBalancerOperationalState = "setup-dns"
	LoadBalancerOperationalStateCheckup       LoadBalancerOperationalState = "checkup"
	LoadBalancerOperationalStateRunning       LoadBalancerOperationalState = "running"
	LoadBalancerOperationalStateDeleteDNS     LoadBalancerOperationalState = "delete-dns"
	LoadBalancerOperationalStateDeleteNetwork LoadBalancerOperationalState = "delete-network"
	LoadBalancerOperationalStateDeleteServer  LoadBalancerOperationalState = "delete-server"
	LoadBalancerOperationalStateDeleteService LoadBalancerOperationalState = "delete-service"

	LoadBalancerCertificateBundleOperationalStateIdle              LoadBalancerCertificateBundleOperationalState = "idle"
	LoadBalancerCertificateBundleOperationalStatePending           LoadBalancerCertificateBundleOperationalState = "pending"
	LoadBalancerCertificateBundleOperationalStateSetupChallenge    LoadBalancerCertificateBundleOperationalState = "setup-challenge"
	LoadBalancerCertificateBundleOperationalStateCompleteChallenge LoadBalancerCertificateBundleOperationalState = "complete-challenge"

	LoadBalancerMatcherTypeSrcIP        LoadBalancerMatcherType = "src_ip"
	LoadBalancerMatcherTypeSrcPort      LoadBalancerMatcherType = "src_port"
	LoadBalancerMatcherTypeBodySize     LoadBalancerMatcherType = "body_size"
	LoadBalancerMatcherTypePath         LoadBalancerMatcherType = "path"
	LoadBalancerMatcherTypeURL          LoadBalancerMatcherType = "url"
	LoadBalancerMatcherTypeURLQuery     LoadBalancerMatcherType = "url_query"
	LoadBalancerMatcherTypeHost         LoadBalancerMatcherType = "host"
	LoadBalancerMatcherTypeHTTPMethod   LoadBalancerMatcherType = "http_method"
	LoadBalancerMatcherTypeCookie       LoadBalancerMatcherType = "cookie"
	LoadBalancerMatcherTypeHeader       LoadBalancerMatcherType = "header"
	LoadBalancerMatcherTypeURLParam     LoadBalancerMatcherType = "url_param"
	LoadBalancerMatcherTypeNumMembersUp LoadBalancerMatcherType = "num_members_up"

	LoadBalancerActionTypeUseBackend   LoadBalancerActionType = "use_backend"
	LoadBalancerActionTypeTCPReject    LoadBalancerActionType = "tcp_reject"
	LoadBalancerActionTypeHTTPReturn   LoadBalancerActionType = "http_return"
	LoadBalancerActionTypeHTTPRedirect LoadBalancerActionType = "http_redirect"

	LoadBalancerStringMatcherMethodExact     LoadBalancerStringMatcherMethod = "exact"
	LoadBalancerStringMatcherMethodSubstring LoadBalancerStringMatcherMethod = "substring"
	LoadBalancerStringMatcherMethodRegexp    LoadBalancerStringMatcherMethod = "regexp"
	LoadBalancerStringMatcherMethodStarts    LoadBalancerStringMatcherMethod = "starts"
	LoadBalancerStringMatcherMethodEnds      LoadBalancerStringMatcherMethod = "ends"
	LoadBalancerStringMatcherMethodDomain    LoadBalancerStringMatcherMethod = "domain"
	LoadBalancerStringMatcherMethodIP        LoadBalancerStringMatcherMethod = "ip"
	LoadBalancerStringMatcherMethodExists    LoadBalancerStringMatcherMethod = "exists"

	LoadBalancerHTTPMatcherMethodGet     LoadBalancerHTTPMatcherMethod = "GET"
	LoadBalancerHTTPMatcherMethodHead    LoadBalancerHTTPMatcherMethod = "HEAD"
	LoadBalancerHTTPMatcherMethodPost    LoadBalancerHTTPMatcherMethod = "POST"
	LoadBalancerHTTPMatcherMethodPut     LoadBalancerHTTPMatcherMethod = "PUT"
	LoadBalancerHTTPMatcherMethodPatch   LoadBalancerHTTPMatcherMethod = "PATCH"
	LoadBalancerHTTPMatcherMethodDelete  LoadBalancerHTTPMatcherMethod = "DELETE"
	LoadBalancerHTTPMatcherMethodConnect LoadBalancerHTTPMatcherMethod = "CONNECT"
	LoadBalancerHTTPMatcherMethodOptions LoadBalancerHTTPMatcherMethod = "OPTIONS"
	LoadBalancerHTTPMatcherMethodTrace   LoadBalancerHTTPMatcherMethod = "TRACE"

	LoadBalancerIntegerMatcherMethodEqual          LoadBalancerIntegerMatcherMethod = "equal"
	LoadBalancerIntegerMatcherMethodGreaterOrEqual LoadBalancerIntegerMatcherMethod = "greater_or_equal"
	LoadBalancerIntegerMatcherMethodGreater        LoadBalancerIntegerMatcherMethod = "greater"
	LoadBalancerIntegerMatcherMethodLessOrEqual    LoadBalancerIntegerMatcherMethod = "less_or_equal"
	LoadBalancerIntegerMatcherMethodLess           LoadBalancerIntegerMatcherMethod = "less"
	LoadBalancerIntegerMatcherMethodRange          LoadBalancerIntegerMatcherMethod = "range"

	LoadBalancerProxyProtocolVersion1 LoadBalancerProxyProtocolVersion = "v1"
	LoadBalancerProxyProtocolVersion2 LoadBalancerProxyProtocolVersion = "v2"

	LoadBalancerHealthCheckTypeTCP  LoadBalancerHealthCheckType = "tcp"
	LoadBalancerHealthCheckTypeHTTP LoadBalancerHealthCheckType = "http"
)
View Source
const (
	// ManagedDatabaseComponentRoutePublic component can be reached over public internet
	ManagedDatabaseComponentRoutePublic ManagedDatabaseComponentRoute = "public"
	// ManagedDatabaseComponentRouteDynamic component can be only reached over utility network
	ManagedDatabaseComponentRouteDynamic ManagedDatabaseComponentRoute = "dynamic"

	// ManagedDatabaseComponentUsagePrimary component is a primary (writable) instance in a cluster
	ManagedDatabaseComponentUsagePrimary ManagedDatabaseComponentUsage = "primary"
	// ManagedDatabaseComponentUsageReplica component is a standby (read-only) instance in a cluster
	ManagedDatabaseComponentUsageReplica ManagedDatabaseComponentUsage = "replica"
)
View Source
const (
	NetworkTypePrivate = "private"
	NetworkTypePublic  = "public"
	NetworkTypeUtility = "utility"
)

Constants

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

	VideoModelVGA    = "vga"
	VideoModelCirrus = "cirrus"

	StopTypeSoft = "soft"
	StopTypeHard = "hard"

	RemoteAccessTypeVNC   = "vnc"
	RemoteAccessTypeSPICE = "spice"
)

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"
	StorageStateSyncing     = "syncing"

	BackupRuleIntervalDaily     = "daily"
	BackupRuleIntervalMonday    = "mon"
	BackupRuleIntervalTuesday   = "tue"
	BackupRuleIntervalWednesday = "wed"
	BackupRuleIntervalThursday  = "thu"
	BackupRuleIntervalFriday    = "fri"
	BackupRuleIntervalSaturday  = "sat"
	BackupRuleIntervalSunday    = "sun"

	StorageImportSourceDirectUpload = "direct_upload"
	StorageImportSourceHTTPImport   = "http_import"

	StorageImportStatePrepared   = "prepared"
	StorageImportStatePending    = "pending"
	StorageImportStateImporting  = "importing"
	StorageImportStateFailed     = "failed"
	StorageImportStateCancelling = "cancelling"
	StorageImportStateCancelled  = "cancelled"
	StorageImportStateCompleted  = "completed"
)

Constants

Variables

This section is empty.

Functions

func BoolPtr added in v4.4.0

func BoolPtr(v bool) *bool

func IntPtr added in v4.4.0

func IntPtr(v int) *int

func StringPtr added in v4.4.0

func StringPtr(v string) *string

Types

type Account

type Account struct {
	Credits        float64        `json:"credits"`
	UserName       string         `json:"username"`
	ResourceLimits ResourceLimits `json:"resource_limits"`
}

Account represents an account

func (*Account) UnmarshalJSON

func (s *Account) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type AccountCampaigns added in v4.1.3

type AccountCampaigns struct {
	Campaign []string `json:"campaign"`
}

AccountCampaigns represents campaigns associated to account

type AccountDetails added in v4.1.3

type AccountDetails struct {
	MainAccount string      `json:"main_account"`
	Type        AccountType `json:"type"`
	Username    string      `json:"username"`
	FirstName   string      `json:"first_name"`
	LastName    string      `json:"last_name"`
	Company     string      `json:"company"`
	Address     string      `json:"address"`
	PostalCode  string      `json:"postal_code"`
	City        string      `json:"city"`
	Email       string      `json:"email"`

	// Phone number in international format, country code and national part separated by a period
	Phone string `json:"phone"`

	// U.S. state if applicable
	State string `json:"state"`

	// ISO 3166-1 three character country code
	Country       string               `json:"country"`
	Currency      string               `json:"currency"`
	Language      string               `json:"language"`
	VATNnumber    string               `json:"vat_number"`
	Timezone      string               `json:"timezone"`
	AllowAPI      Boolean              `json:"allow_api"`
	AllowGUI      Boolean              `json:"allow_gui"`
	SimpleBackup  Boolean              `json:"simple_backup"`
	TagAccess     AccountTagAccess     `json:"tag_access"`
	Campaigns     AccountCampaigns     `json:"campaigns"`
	Roles         AccountRoles         `json:"roles"`
	ServerAccess  AccountServerAccess  `json:"server_access"`
	StorageAccess AccountStorageAccess `json:"storage_access"`
	NetworkAccess AccountNetworkAccess `json:"network_access"`
	IPFilters     AccountIPFilters     `json:"ip_filters"`

	// Whether 3rd party services are allowed in the account's context when logged in the UpCloud control panel.
	// Consult the complete description in the control panel.
	Enable3rdPartyServices Boolean `json:"enable_3rd_party_services"`
}

AccountDetails represents detailed information about an account

func (AccountDetails) IsSubaccount added in v4.1.3

func (a AccountDetails) IsSubaccount() bool

IsSubaccount checks if account is subaccount

func (*AccountDetails) UnmarshalJSON added in v4.1.3

func (a *AccountDetails) UnmarshalJSON(b []byte) error

type AccountIPFilters added in v4.1.3

type AccountIPFilters struct {
	IPFilter []string `json:"ip_filter"`
}

AccountIPFilters represents IP address restrictions on API access; if set, allowed only from the specified ranges. Ranges can be specified in CIDR format, ranges separated by a dash, or as single IP addresses

type AccountList added in v4.1.3

type AccountList []AccountListItem

AccountList represents account list

func (*AccountList) UnmarshalJSON added in v4.1.3

func (a *AccountList) UnmarshalJSON(b []byte) error

type AccountListItem added in v4.1.3

type AccountListItem struct {
	Type     AccountType  `json:"type"`
	Username string       `json:"username"`
	Roles    AccountRoles `json:"roles"`
}

AccountListItem represents account list item

type AccountNetworkAccess added in v4.1.3

type AccountNetworkAccess struct {
	Network []string `json:"network"`
}

AccountNetworkAccess represents UUIDs of networks the account is allowed to manage, * means all

type AccountRoles added in v4.1.3

type AccountRoles struct {
	Role []string `json:"role"`
}

AccountRoles represents roles associated to account Roles for the account; billing, aux_billing, or technical.

type AccountServer added in v4.1.3

type AccountServer struct {
	UUID    string  `json:"uuid"`
	Storage Boolean `json:"storage"`
}

AccountServer represents server (UUID) and storage access permisission

type AccountServerAccess added in v4.1.3

type AccountServerAccess struct {
	Server []AccountServer `json:"server"`
}

AccountServerAccess represents servers the account is allowed to manage

type AccountStorageAccess added in v4.1.3

type AccountStorageAccess struct {
	Storage []string `json:"storage"`
}

AccountStorageAccess represents UUIDs of storages the account is allowed to manage, or * for all

type AccountTag added in v4.1.3

type AccountTag struct {
	Name    string  `json:"name"`
	Storage Boolean `json:"storage"`
}

AccountTag represents tag and storage access permisission

type AccountTagAccess added in v4.1.3

type AccountTagAccess struct {
	Tag []AccountTag `json:"tag"`
}

AccountTagAccess represents tags associated to account

type AccountType added in v4.1.3

type AccountType string
const (
	AccountTypeMain       AccountType = "main"
	AccountTypeSubaccount AccountType = "sub"
)

type BackupRule

type BackupRule struct {
	Interval string `json:"interval,omitempty"`
	// Time should be in the format "hhmm", e.g. "0430"
	Time      string `json:"time,omitempty"`
	Retention int    `json:"retention,string,omitempty"`
}

BackupRule represents a backup rule

type BackupUUIDSlice

type BackupUUIDSlice []string

BackupUUIDSlice is a slice of string. It exists to allow for a custom JSON unmarshaller.

func (*BackupUUIDSlice) UnmarshalJSON

func (s *BackupUUIDSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Boolean

type Boolean int

Boolean is a custom boolean type that allows for custom marshalling and unmarshalling and for an empty value that isn't false so we can distinguish between true, false and not set.

const (
	True  Boolean = 1
	False Boolean = -1
	Empty Boolean = 0
)

Constants

func FromBool

func FromBool(v bool) Boolean

FromBool converts from a standard bool values

func (*Boolean) Bool

func (b *Boolean) Bool() bool

Bool converts to a standard bool value

func (*Boolean) Empty

func (b *Boolean) Empty() bool

Empty checks if this bool is empty

func (*Boolean) MarshalJSON

func (b *Boolean) MarshalJSON() ([]byte, error)

MarshalJSON is a custom unmarshaller that deals with deeply embedded values.

func (*Boolean) String

func (b *Boolean) String() string

String returns a string representation

func (*Boolean) UnmarshalJSON

func (b *Boolean) UnmarshalJSON(buf []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Error

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

Error represents an error

func (*Error) Error

func (e *Error) Error() string

Error implements the Error interface

func (*Error) UnmarshalJSON

func (e *Error) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type FirewallRule

type FirewallRule struct {
	Action                  string `json:"action"`
	Comment                 string `json:"comment,omitempty"`
	DestinationAddressStart string `json:"destination_address_start,omitempty"`
	DestinationAddressEnd   string `json:"destination_address_end,omitempty"`
	DestinationPortStart    string `json:"destination_port_start,omitempty"`
	DestinationPortEnd      string `json:"destination_port_end,omitempty"`
	Direction               string `json:"direction"`
	Family                  string `json:"family,omitempty"`
	ICMPType                string `json:"icmp_type,omitempty"`
	Position                int    `json:"position,string,omitempty"`
	Protocol                string `json:"protocol,omitempty"`
	SourceAddressStart      string `json:"source_address_start,omitempty"`
	SourceAddressEnd        string `json:"source_address_end,omitempty"`
	SourcePortStart         string `json:"source_port_start,omitempty"`
	SourcePortEnd           string `json:"source_port_end,omitempty"`
}

FirewallRule represents a single firewall rule. Note that most integer values are represented as strings

func (*FirewallRule) UnmarshalJSON

func (s *FirewallRule) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type FirewallRules

type FirewallRules struct {
	FirewallRules []FirewallRule `json:"firewall_rules"`
}

FirewallRules represents a list of firewall rules

func (*FirewallRules) UnmarshalJSON

func (s *FirewallRules) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Host

type Host struct {
	ID             int       `json:"id"`
	Description    string    `json:"description"`
	Zone           string    `json:"zone"`
	WindowsEnabled Boolean   `json:"windows_enabled"`
	Stats          StatSlice `json:"stats"`
}

Host represents an individual Host in a response

func (*Host) UnmarshalJSON

func (s *Host) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Hosts

type Hosts struct {
	Hosts []Host `json:"hosts"`
}

Hosts represents a GetHosts response

func (*Hosts) UnmarshalJSON

func (n *Hosts) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type IPAddress

type IPAddress struct {
	Access     string  `json:"access"`
	Address    string  `json:"address"`
	Family     string  `json:"family"`
	PartOfPlan Boolean `json:"part_of_plan"`
	PTRRecord  string  `json:"ptr_record"`
	ServerUUID string  `json:"server"`
	MAC        string  `json:"mac"`
	Floating   Boolean `json:"floating"`
	Zone       string  `json:"zone"`
}

IPAddress represents an IP address

func (*IPAddress) UnmarshalJSON

func (s *IPAddress) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type IPAddressSlice

type IPAddressSlice []IPAddress

IPAddressSlice is a slice of IPAddress. It exists to allow for a custom JSON unmarshaller.

func (*IPAddressSlice) UnmarshalJSON

func (i *IPAddressSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type IPAddresses

type IPAddresses struct {
	IPAddresses []IPAddress `json:"ip_addresses"`
}

IPAddresses represents a /ip_address response

func (*IPAddresses) UnmarshalJSON

func (s *IPAddresses) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type IPNetwork

type IPNetwork struct {
	Address          string   `json:"address,omitempty"`
	DHCP             Boolean  `json:"dhcp"`
	DHCPDefaultRoute Boolean  `json:"dhcp_default_route"`
	DHCPDns          []string `json:"dhcp_dns,omitempty"`
	Family           string   `json:"family,omitempty"`
	Gateway          string   `json:"gateway,omitempty"`
}

IPNetwork represents an IP network in a response.

type IPNetworkSlice

type IPNetworkSlice []IPNetwork

IPNetworkSlice is a slice of IPNetworks It exists to allow for a custom unmarshaller.

func (IPNetworkSlice) MarshalJSON

func (t IPNetworkSlice) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshaller that deals with deeply embedded values.

func (*IPNetworkSlice) UnmarshalJSON

func (t *IPNetworkSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Interface

type Interface struct {
	Index             int            `json:"index"`
	IPAddresses       IPAddressSlice `json:"ip_addresses"`
	MAC               string         `json:"mac"`
	Network           string         `json:"network"`
	Type              string         `json:"type"`
	Bootable          Boolean        `json:"bootable"`
	SourceIPFiltering Boolean        `json:"source_ip_filtering"`
}

Interface represents a network interface in a response

func (*Interface) UnmarshalJSON

func (s *Interface) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type LoadBalancer added in v4.4.0

type LoadBalancer struct {
	UUID             string                       `json:"uuid,omitempty"`
	Name             string                       `json:"name,omitempty"`
	Zone             string                       `json:"zone,omitempty"`
	Plan             string                       `json:"plan,omitempty"`
	NetworkUUID      string                       `json:"network_uuid,omitempty"`
	DNSName          string                       `json:"dns_name,omitempty"`
	ConfiguredStatus LoadBalancerConfiguredStatus `json:"configured_status,omitempty"`
	OperationalState LoadBalancerOperationalState `json:"operational_state,omitempty"`
	Frontends        []LoadBalancerFrontend       `json:"frontends,omitempty"`
	Backends         []LoadBalancerBackend        `json:"backends,omitempty"`
	Resolvers        []LoadBalancerResolver       `json:"resolvers,omitempty"`
	CreatedAt        time.Time                    `json:"created_at,omitempty"`
	UpdatedAt        time.Time                    `json:"updated_at,omitempty"`
}

LoadBalancer service

type LoadBalancerAction added in v4.4.0

type LoadBalancerAction struct {
	Type         LoadBalancerActionType          `json:"type,omitempty"`
	UseBackend   *LoadBalancerActionUseBackend   `json:"action_use_backend,omitempty"`
	TCPReject    *LoadBalancerActionTCPReject    `json:"action_tcp_reject,omitempty"`
	HTTPReturn   *LoadBalancerActionHTTPReturn   `json:"action_http_return,omitempty"`
	HTTPRedirect *LoadBalancerActionHTTPRedirect `json:"action_http_redirect,omitempty"`
}

LoadBalancerAction represents rule action

type LoadBalancerActionHTTPRedirect added in v4.4.0

type LoadBalancerActionHTTPRedirect struct {
	Location string `json:"location,omitempty"`
}

LoadBalancerActionHTTPRedirect represents 'http_redirect' action

type LoadBalancerActionHTTPReturn added in v4.4.0

type LoadBalancerActionHTTPReturn struct {
	Status      int    `json:"status,omitempty"`
	ContentType string `json:"content_type,omitempty"`
	Payload     string `json:"payload,omitempty"`
}

LoadBalancerActionHTTPReturn represents 'http_return' action

type LoadBalancerActionTCPReject added in v4.4.0

type LoadBalancerActionTCPReject struct {
}

LoadBalancerActionTCPReject represents 'tcp_reject' action

type LoadBalancerActionType added in v4.4.0

type LoadBalancerActionType string

type LoadBalancerActionUseBackend added in v4.4.0

type LoadBalancerActionUseBackend struct {
	Backend string `json:"backend,omitempty"`
}

LoadBalancerActionUseBackend represents 'use_backend' action

type LoadBalancerBackend added in v4.4.0

type LoadBalancerBackend struct {
	Name       string                         `json:"name"`
	Members    []LoadBalancerBackendMember    `json:"members"`
	Resolver   string                         `json:"resolver,omitempty"`
	Properties *LoadBalancerBackendProperties `json:"properties,omitempty"`
	CreatedAt  time.Time                      `json:"created_at,omitempty"`
	UpdatedAt  time.Time                      `json:"updated_at,omitempty"`
}

LoadBalancerBackend represents service backend

type LoadBalancerBackendMember added in v4.4.0

type LoadBalancerBackendMember struct {
	Name        string                        `json:"name"`
	IP          string                        `json:"ip"`
	Port        int                           `json:"port"`
	Weight      int                           `json:"weight"`
	MaxSessions int                           `json:"max_sessions"`
	Type        LoadBalancerBackendMemberType `json:"type"`
	Enabled     bool                          `json:"enabled"`
	CreatedAt   time.Time                     `json:"created_at,omitempty"`
	UpdatedAt   time.Time                     `json:"updated_at,omitempty"`
}

LoadBalancerBackendMember represents backend member

type LoadBalancerBackendMemberType added in v4.4.0

type LoadBalancerBackendMemberType string

type LoadBalancerBackendProperties added in v4.7.0

type LoadBalancerBackendProperties struct {
	TimeoutServer             int                              `json:"timeout_server,omitempty"`
	TimeoutTunnel             int                              `json:"timeout_tunnel,omitempty"`
	HealthCheckType           LoadBalancerHealthCheckType      `json:"health_check_type,omitempty"`
	HealthCheckInterval       int                              `json:"health_check_interval,omitempty"`
	HealthCheckFall           int                              `json:"health_check_fall,omitempty"`
	HealthCheckRise           int                              `json:"health_check_rise,omitempty"`
	HealthCheckURL            string                           `json:"health_check_url,omitempty"`
	HealthCheckExpectedStatus int                              `json:"health_check_expected_status,omitempty"`
	StickySessionCookieName   string                           `json:"sticky_session_cookie_name,omitempty"`
	OutboundProxyProtocol     LoadBalancerProxyProtocolVersion `json:"outbound_proxy_protocol,omitempty"`
}

LoadBalancerBackendProperties represents backend properties

type LoadBalancerCertificateBundle added in v4.4.0

type LoadBalancerCertificateBundle struct {
	UUID          string    `json:"uuid,omitempty"`
	Certificate   string    `json:"certificate,omitempty"`
	Intermediates string    `json:"intermediates,omitempty"`
	Hostnames     []string  `json:"hostnames,omitempty"`
	KeyType       string    `json:"key_type,omitempty"`
	Name          string    `json:"name,omitempty"`
	NotAfter      time.Time `json:"not_after,omitempty"`
	NotBefore     time.Time `json:"not_before,omitempty"`
	CreatedAt     time.Time `json:"created_at,omitempty"`
	UpdatedAt     time.Time `json:"updated_at,omitempty"`

	Type             LoadBalancerCertificateBundleType             `json:"type,omitempty"`
	OperationalState LoadBalancerCertificateBundleOperationalState `json:"operational_state,omitempty"`
}

LoadBalancerCertificateBundle represents certificate bundle

type LoadBalancerCertificateBundleOperationalState added in v4.4.0

type LoadBalancerCertificateBundleOperationalState string

type LoadBalancerCertificateBundleType added in v4.4.0

type LoadBalancerCertificateBundleType string

type LoadBalancerConfiguredStatus added in v4.4.0

type LoadBalancerConfiguredStatus string

type LoadBalancerFrontend added in v4.4.0

type LoadBalancerFrontend struct {
	Name           string                          `json:"name,omitempty"`
	Mode           LoadBalancerMode                `json:"mode,omitempty"`
	Port           int                             `json:"port,omitempty"`
	DefaultBackend string                          `json:"default_backend,omitempty"`
	Rules          []LoadBalancerFrontendRule      `json:"rules,omitempty"`
	TLSConfigs     []LoadBalancerFrontendTLSConfig `json:"tls_configs,omitempty"`
	Properties     *LoadBalancerFrontendProperties `json:"properties,omitempty"`
	CreatedAt      time.Time                       `json:"created_at,omitempty"`
	UpdatedAt      time.Time                       `json:"updated_at,omitempty"`
}

LoadBalancerFrontend represents service frontend

type LoadBalancerFrontendProperties added in v4.7.0

type LoadBalancerFrontendProperties struct {
	TimeoutClient        int  `json:"timeout_client,omitempty"`
	InboundProxyProtocol bool `json:"inbound_proxy_protocol"`
}

LoadBalancerFrontendProperties represents frontend properties

type LoadBalancerFrontendRule added in v4.4.0

type LoadBalancerFrontendRule struct {
	Name      string                `json:"name,omitempty"`
	Priority  int                   `json:"priority,omitempty"`
	Matchers  []LoadBalancerMatcher `json:"matchers,omitempty"`
	Actions   []LoadBalancerAction  `json:"actions,omitempty"`
	CreatedAt time.Time             `json:"created_at,omitempty"`
	UpdatedAt time.Time             `json:"updated_at,omitempty"`
}

LoadBalancerFrontendRule represents frontend rule

type LoadBalancerFrontendTLSConfig added in v4.4.0

type LoadBalancerFrontendTLSConfig struct {
	Name                  string    `json:"name,omitempty"`
	CertificateBundleUUID string    `json:"certificate_bundle_uuid,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
}

LoadBalancerFrontendTLSConfig represents TLS configuration

type LoadBalancerHTTPMatcherMethod added in v4.4.0

type LoadBalancerHTTPMatcherMethod string

type LoadBalancerHealthCheckType added in v4.7.0

type LoadBalancerHealthCheckType string

type LoadBalancerIntegerMatcherMethod added in v4.4.0

type LoadBalancerIntegerMatcherMethod string

type LoadBalancerMatcher added in v4.4.0

type LoadBalancerMatcher struct {
	Type         LoadBalancerMatcherType                `json:"type,omitempty"`
	SrcIP        *LoadBalancerMatcherSourceIP           `json:"match_src_ip,omitempty"`
	SrcPort      *LoadBalancerMatcherInteger            `json:"match_src_port,omitempty"`
	BodySize     *LoadBalancerMatcherInteger            `json:"match_body_size,omitempty"`
	Path         *LoadBalancerMatcherString             `json:"match_path,omitempty"`
	URL          *LoadBalancerMatcherString             `json:"match_url,omitempty"`
	URLQuery     *LoadBalancerMatcherString             `json:"match_url_query,omitempty"`
	Host         *LoadBalancerMatcherHost               `json:"match_host,omitempty"`
	HTTPMethod   *LoadBalancerMatcherHTTPMethod         `json:"match_http_method,omitempty"`
	Cookie       *LoadBalancerMatcherStringWithArgument `json:"match_cookie,omitempty"`
	Header       *LoadBalancerMatcherStringWithArgument `json:"match_header,omitempty"`
	URLParam     *LoadBalancerMatcherStringWithArgument `json:"match_url_param,omitempty"`
	NumMembersUp *LoadBalancerMatcherNumMembersUp       `json:"match_num_members_up,omitempty"`
}

LoadBalancerMatcher represents rule matcher

type LoadBalancerMatcherHTTPMethod added in v4.4.0

type LoadBalancerMatcherHTTPMethod struct {
	Value LoadBalancerHTTPMatcherMethod `json:"value,omitempty"`
}

LoadBalancerMatcherHTTPMethod represents 'http_method' matcher

type LoadBalancerMatcherHost added in v4.4.0

type LoadBalancerMatcherHost struct {
	Value string `json:"value,omitempty"`
}

LoadBalancerMatcherHost represents represents 'host' matcher

type LoadBalancerMatcherInteger added in v4.4.0

type LoadBalancerMatcherInteger struct {
	Method     LoadBalancerIntegerMatcherMethod `json:"method,omitempty"`
	Value      int                              `json:"value,omitempty"`
	RangeStart int                              `json:"range_start,omitempty"`
	RangeEnd   int                              `json:"range_end,omitempty"`
}

LoadBalancerMatcherInteger represents integer matcher

type LoadBalancerMatcherNumMembersUp added in v4.4.1

type LoadBalancerMatcherNumMembersUp struct {
	Method  LoadBalancerIntegerMatcherMethod `json:"method,omitempty"`
	Value   int                              `json:"value,omitempty"`
	Backend string                           `json:"backend,omitempty"`
}

LoadBalancerMatcherNumMembersUp represents 'num_members_up' matcher

type LoadBalancerMatcherSourceIP added in v4.4.0

type LoadBalancerMatcherSourceIP struct {
	Value string `json:"value,omitempty"`
}

LoadBalancerMatcherSourceIP represents 'src_ip' matcher

type LoadBalancerMatcherString added in v4.4.0

type LoadBalancerMatcherString struct {
	Method     LoadBalancerStringMatcherMethod `json:"method,omitempty"`
	Value      string                          `json:"value,omitempty"`
	IgnoreCase *bool                           `json:"ignore_case,omitempty"`
}

LoadBalancerMatcherString represents string matcher

type LoadBalancerMatcherStringWithArgument added in v4.4.0

type LoadBalancerMatcherStringWithArgument struct {
	Method     LoadBalancerStringMatcherMethod `json:"method,omitempty"`
	Name       string                          `json:"name,omitempty"`
	Value      string                          `json:"value,omitempty"`
	IgnoreCase *bool                           `json:"ignore_case,omitempty"`
}

LoadBalancerMatcherStringWithArgument represents 'string with argument' matcher

type LoadBalancerMatcherType added in v4.4.0

type LoadBalancerMatcherType string

type LoadBalancerMode added in v4.4.0

type LoadBalancerMode string

type LoadBalancerOperationalState added in v4.4.0

type LoadBalancerOperationalState string

type LoadBalancerPlan added in v4.4.0

type LoadBalancerPlan struct {
	Name                 string `json:"name,omitempty"`
	PerServerMaxSessions int    `json:"per_server_max_sessions,omitempty"`
	ServerNumber         int    `json:"server_number,omitempty"`
}

LoadBalancerPlan represents load balancer plan details

type LoadBalancerProxyProtocolVersion added in v4.7.0

type LoadBalancerProxyProtocolVersion string

type LoadBalancerResolver added in v4.4.0

type LoadBalancerResolver struct {
	Name         string    `json:"name,omitempty"`
	Nameservers  []string  `json:"nameservers,omitempty"`
	Retries      int       `json:"retries,omitempty"`
	Timeout      int       `json:"timeout,omitempty"`
	TimeoutRetry int       `json:"timeout_retry,omitempty"`
	CacheValid   int       `json:"cache_valid,omitempty"`
	CacheInvalid int       `json:"cache_invalid,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
}

LoadBalancerResolver represents domain name resolver

type LoadBalancerStringMatcherMethod added in v4.4.0

type LoadBalancerStringMatcherMethod string

type ManagedDatabase

type ManagedDatabase struct {
	Backups          []ManagedDatabaseBackup         `json:"backups"`
	Components       []ManagedDatabaseComponent      `json:"components"`
	CreateTime       time.Time                       `json:"create_time"`
	Maintenance      ManagedDatabaseMaintenanceTime  `json:"maintenance"`
	Name             string                          `json:"name"`
	NodeCount        int                             `json:"node_count"`
	NodeStates       []ManagedDatabaseNodeState      `json:"node_states"`
	Plan             string                          `json:"plan"`
	Powered          bool                            `json:"powered"`
	Properties       ManagedDatabaseProperties       `json:"properties"`
	State            ManagedDatabaseState            `json:"state"`
	Title            string                          `json:"title"`
	Type             ManagedDatabaseServiceType      `json:"type"`
	UpdateTime       time.Time                       `json:"update_time"`
	ServiceURI       string                          `json:"service_uri"`
	ServiceURIParams ManagedDatabaseServiceURIParams `json:"service_uri_params"`
	Users            []ManagedDatabaseUser           `json:"users"`
	UUID             string                          `json:"uuid"`
	Zone             string                          `json:"zone"`
}

ManagedDatabase represents an existing managed database instance

type ManagedDatabaseBackup

type ManagedDatabaseBackup struct {
	BackupTime time.Time `json:"backup_time"`
	DataSize   int       `json:"data_size"`
}

ManagedDatabaseBackup represents a full backup taken at a point in time. It should be noted that both MySQL and PostgreSQL support restoring to any point in time between full backups.

type ManagedDatabaseBackupConfig added in v4.6.0

type ManagedDatabaseBackupConfig struct {
	Interval     int    `json:"interval"`
	MaxCount     int    `json:"max_count"`
	RecoveryMode string `json:"recovery_mode"`
}

ManagedDatabaseType represets backup configuration of a database service plan

type ManagedDatabaseComponent

type ManagedDatabaseComponent struct {
	Component string `json:"component"`
	Host      string `json:"host"`
	Port      int    `json:"port"`
	// Route describes how the component can be reached. See following:
	//	upcloud.ManagedDatabaseComponentRoutePublic
	//	upcloud.ManagedDatabaseComponentRouteDynamic
	Route ManagedDatabaseComponentRoute `json:"route"`
	// Usage describes the role of the component. See following:
	//	upcloud.ManagedDatabaseComponentUsagePrimary
	//	upcloud.ManagedDatabaseComponentUsageReplica
	Usage ManagedDatabaseComponentUsage `json:"usage"`
}

ManagedDatabaseComponent represents an accessible component within a service. The usage varies between service types

type ManagedDatabaseComponentRoute

type ManagedDatabaseComponentRoute string

ManagedDatabaseComponentRoute represents the access route a component is associated with

type ManagedDatabaseComponentUsage

type ManagedDatabaseComponentUsage string

ManagedDatabaseComponentUsage represents the logical usage for the component in question

type ManagedDatabaseConnection

type ManagedDatabaseConnection struct {
	ApplicationName string        `json:"application_name"`
	BackendStart    time.Time     `json:"backend_start"`
	BackendType     string        `json:"backend_type"`
	BackendXid      string        `json:"backend_xid"`
	BackendXmin     string        `json:"backend_xmin"`
	ClientAddr      string        `json:"client_addr"`
	ClientHostname  string        `json:"client_hostname"`
	ClientPort      int           `json:"client_port"`
	DatId           int           `json:"datid"`
	DatName         string        `json:"datname"`
	Pid             int           `json:"pid"`
	Query           string        `json:"query"`
	QueryDuration   time.Duration `json:"query_duration"`
	QueryStart      time.Time     `json:"query_start"`
	State           string        `json:"state"`
	StateChange     time.Time     `json:"state_change"`
	Username        string        `json:"usename"`
	UseSysId        int           `json:"usesysid"`
	WaitEvent       string        `json:"wait_event"`
	WaitEventType   string        `json:"wait_event_type"`
	XactStart       time.Time     `json:"xact_start"`
}

ManagedDatabaseConnection represents a connection to the managed database instance. The available fields vary between database types.

type ManagedDatabaseLogEntry

type ManagedDatabaseLogEntry struct {
	Hostname string    `json:"hostname"`
	Message  string    `json:"msg"`
	Time     time.Time `json:"time"`
	Service  string    `json:"service"`
}

type ManagedDatabaseLogOrder

type ManagedDatabaseLogOrder string

ManagedDatabaseLogOrder represents the order the logs are queried in

const (
	// ManagedDatabaseLogOrderAscending can be used to query logs in ascending order
	ManagedDatabaseLogOrderAscending ManagedDatabaseLogOrder = "asc"
	// ManagedDatabaseLogOrderDescending can be used to query logs in descending order
	ManagedDatabaseLogOrderDescending ManagedDatabaseLogOrder = "desc"
)

type ManagedDatabaseLogicalDatabase

type ManagedDatabaseLogicalDatabase struct {
	Name string `json:"name"`
	// LCCollate represents a default string sort order of a logical database
	LCCollate string `json:"lc_collate"`
	// LCCType represents a default character classification of a logical database
	LCCType string `json:"lc_ctype"`
}

ManagedDatabaseLogicalDatabase represents a logical database inside a managed database service instance

type ManagedDatabaseLogs

type ManagedDatabaseLogs struct {
	// Offset describes the next available offset. Use this to query more logs.
	Offset string `json:"offset"`
	Logs   []ManagedDatabaseLogEntry
}

type ManagedDatabaseMaintenanceTime

type ManagedDatabaseMaintenanceTime struct {
	DayOfWeek string `json:"dow"`
	Time      string `json:"time"`
}

ManagedDatabaseMaintenanceTime represents the set time of week when automatic maintenance operations are allowed

type ManagedDatabaseMetricPeriod

type ManagedDatabaseMetricPeriod string

ManagedDatabaseMetricPeriod represents the observation period of database metrics

const (
	// ManagedDatabaseMetricPeriodHour represents the observation period of an hour for metrics request
	ManagedDatabaseMetricPeriodHour ManagedDatabaseMetricPeriod = "hour"
	// ManagedDatabaseMetricPeriodDay represents the observation period of a day for metrics request
	ManagedDatabaseMetricPeriodDay ManagedDatabaseMetricPeriod = "day"
	// ManagedDatabaseMetricPeriodWeek represents the observation period of a week for metrics request
	ManagedDatabaseMetricPeriodWeek ManagedDatabaseMetricPeriod = "week"
	// ManagedDatabaseMetricPeriodMonth represents the observation period of a month for metrics request
	ManagedDatabaseMetricPeriodMonth ManagedDatabaseMetricPeriod = "month"
	// ManagedDatabaseMetricPeriodYear represents the observation period of a year for metrics request
	ManagedDatabaseMetricPeriodYear ManagedDatabaseMetricPeriod = "year"
)

type ManagedDatabaseMetrics

type ManagedDatabaseMetrics struct {
	CPUUsage       ManagedDatabaseMetricsChartFloat64 `json:"cpu_usage"`
	DiskUsage      ManagedDatabaseMetricsChartFloat64 `json:"disk_usage"`
	DiskIOReads    ManagedDatabaseMetricsChartInt     `json:"diskio_reads"`
	DiskIOWrite    ManagedDatabaseMetricsChartInt     `json:"diskio_writes"`
	LoadAverage    ManagedDatabaseMetricsChartFloat64 `json:"load_average"`
	MemoryUsage    ManagedDatabaseMetricsChartFloat64 `json:"mem_usage"`
	NetworkReceive ManagedDatabaseMetricsChartInt     `json:"net_receive"`
	NetworkSend    ManagedDatabaseMetricsChartInt     `json:"net_send"`
}

ManagedDatabaseMetrics represents managed database service metrics

Metrics are represented in chart form containing a set of columns and two-dimensional slice of rows. The inner slice index corresponds a column. If the service consists of multiple nodes, each node gets their own column in the chart.

The first column is always a timestamp which denotes the timestamp for the recorded metric

type ManagedDatabaseMetricsChartFloat64

type ManagedDatabaseMetricsChartFloat64 struct {
	ManagedDatabaseMetricsChartHeader
	// Rows contains a slice of values per row. The inner slice has the same indexing as the
	// ManagedDatabaseMetricsChartHeader.Columns
	Rows [][]float64
}

ManagedDatabaseMetricsChartFloat64 represents a metric chart with float64 row values

func (ManagedDatabaseMetricsChartFloat64) MarshalJSON

func (m ManagedDatabaseMetricsChartFloat64) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for the canonical form of metrics chart

func (*ManagedDatabaseMetricsChartFloat64) UnmarshalJSON

func (m *ManagedDatabaseMetricsChartFloat64) UnmarshalJSON(d []byte) error

UnmarshalJSON implements json.Unmarshaler for the canonical form of metrics chart

type ManagedDatabaseMetricsChartHeader

type ManagedDatabaseMetricsChartHeader struct {
	// Columns contains a set of columns that describe for what node the corresponding row element belongs to
	// as well as the type of the metric value
	Columns []ManagedDatabaseMetricsColumn
	// Timestamps contains the timestamps of the rows. Its indexing corresponds the rows.
	Timestamps []time.Time
	// Title contains a description of the metrics chart
	Title string
}

ManagedDatabaseMetricsChartHeader represents common fields of a metrics chart

type ManagedDatabaseMetricsChartInt

type ManagedDatabaseMetricsChartInt struct {
	ManagedDatabaseMetricsChartHeader
	// Rows contains a slice of values per row. The inner slice has the same indexing as the
	// ManagedDatabaseMetricsChartHeader.Columns
	Rows [][]int
}

ManagedDatabaseMetricsChartInt represents a metric chart with int row values

func (ManagedDatabaseMetricsChartInt) MarshalJSON

func (m ManagedDatabaseMetricsChartInt) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for the canonical form of metrics chart

func (*ManagedDatabaseMetricsChartInt) UnmarshalJSON

func (m *ManagedDatabaseMetricsChartInt) UnmarshalJSON(d []byte) error

UnmarshalJSON implements json.Unmarshaler for the canonical form of metrics chart

type ManagedDatabaseMetricsColumn

type ManagedDatabaseMetricsColumn struct {
	// Label describes the usage of chart's column
	Label string `json:"label"`
	// Type describes the type of values in chart's column
	Type string `json:"type"`
}

ManagedDatabaseMetricsColumn represents a single column of a metrics chart

type ManagedDatabaseNodeRole

type ManagedDatabaseNodeRole string

ManagedDatabaseNodeRole represents the role of a node implementing a service

const (
	// ManagedDatabaseNodeRoleMaster node serves read and write requests
	ManagedDatabaseNodeRoleMaster ManagedDatabaseNodeRole = "master"
	// ManagedDatabaseNodeRoleStandby node serves read-only requests and is ready to assume the master role during failure scenario
	ManagedDatabaseNodeRoleStandby ManagedDatabaseNodeRole = "standby"
)

type ManagedDatabaseNodeState

type ManagedDatabaseNodeState struct {
	// Name field is same as the ManagedDatabase.Name plus a dash plus an index value. The index represents the
	// generation of a node. Certain modifications require re-provisioning of a node.
	Name string `json:"name"`
	// Role represents the role of a node
	Role ManagedDatabaseNodeRole `json:"role"`
	// State represents the current state of a node
	State string `json:"state"`
}

ManagedDatabaseNodeState represents a database node that is part of the service instance

type ManagedDatabaseProperties

type ManagedDatabaseProperties map[ManagedDatabasePropertyKey]interface{}

ManagedDatabaseProperties is a Properties helper type for ManagedDatabase

func (*ManagedDatabaseProperties) Get

func (m *ManagedDatabaseProperties) Get(name ManagedDatabasePropertyKey) interface{}

Get returns a property value by name. The underlying map is initialised if it's nil

func (*ManagedDatabaseProperties) GetAutoUtilityIPFilter

func (m *ManagedDatabaseProperties) GetAutoUtilityIPFilter() bool

GetAutoUtilityIPFilter returns the state of automatic utility network IP filtering. See upcloud.ManagedDatabasePropertyAutoUtilityIPFilter for more information.

func (*ManagedDatabaseProperties) GetBool

GetBool returns a boolean property value. The underlying map is initialised if it's nil.

func (*ManagedDatabaseProperties) GetIPFilter

func (m *ManagedDatabaseProperties) GetIPFilter() []string

GetIPFilter returns a slice of allowed hosts or networks. See upcloud.ManagedDatabasePropertyIPFilter for more information.

func (*ManagedDatabaseProperties) GetInt

GetInt returns an integer property value. The underlying map is initialised if it's nil.

func (*ManagedDatabaseProperties) GetPublicAccess

func (m *ManagedDatabaseProperties) GetPublicAccess() bool

GetPublicAccess returns the state of public access to the service. See upcloud.ManagedDatabasePropertyPublicAccess for more information.

func (*ManagedDatabaseProperties) GetString

GetString returns a string property value. The underlying map is initialised if it's nil.

func (*ManagedDatabaseProperties) GetStringSlice

GetStringSlice returns a string-slice property value. The underlying map is initialised if it's nil.

type ManagedDatabasePropertyKey

type ManagedDatabasePropertyKey string

ManagedDatabasePropertyKey represents a property name of a service

const (
	// ManagedDatabasePropertyAutoUtilityIPFilter enables automatic ip filter generation from utility network
	// within the same zone.
	ManagedDatabasePropertyAutoUtilityIPFilter ManagedDatabasePropertyKey = "automatic_utility_network_ip_filter"
	// ManagedDatabasePropertyIPFilter allows adjusting the custom IP filter of a service. The value should
	// contain a slice of strings representing individual IP addresses or IP addresses with CIDR mask.
	// Currently IPv4 addresses or networks are supported.
	ManagedDatabasePropertyIPFilter ManagedDatabasePropertyKey = "ip_filter"
	// ManagedDatabasePropertyPublicAccess enables public access via internet to the service. A separate public
	// endpoint DNS name will be available under Components after enabling.
	ManagedDatabasePropertyPublicAccess ManagedDatabasePropertyKey = "public_access"

	// ManagedDatabaseAllIPv4 property value can be used together with ManagedDatabasePropertyIPFilter to allow access from all
	// IPv4 hosts.
	ManagedDatabaseAllIPv4 = "0.0.0.0/0"
)

type ManagedDatabaseQueryStatisticsMySQL

type ManagedDatabaseQueryStatisticsMySQL struct {
	AvgTimerWait            time.Duration `json:"avg_timer_wait"`
	CountStar               uint64        `json:"count_star"`
	Digest                  string        `json:"digest"`
	DigestText              string        `json:"digest_text"`
	FirstSeen               time.Time     `json:"first_seen"`
	LastSeen                time.Time     `json:"last_seen"`
	MaxTimerWait            time.Duration `json:"max_timer_wait"`
	MinTimerWait            time.Duration `json:"min_timer_wait"`
	Quantile95              time.Duration `json:"quantile_95"`
	Quantile99              time.Duration `json:"quantile_99"`
	Quantile999             time.Duration `json:"quantile_999"`
	QuerySampleSeen         time.Time     `json:"query_sample_seen"`
	QuerySampleText         string        `json:"query_sample_text"`
	QuerySampleTimerWait    time.Duration `json:"query_sample_timer_wait"`
	SchemaName              string        `json:"schema_name"`
	SumCreatedTmpDiskTables uint64        `json:"sum_created_tmp_disk_tables"`
	SumCreatedTmpTables     uint64        `json:"sum_created_tmp_tables"`
	SumErrors               uint64        `json:"sum_errors"`
	SumLockTime             uint64        `json:"sum_lock_time"`
	SumNoGoodIndexUsed      uint64        `json:"sum_no_good_index_used"`
	SumNoIndexUsed          uint64        `json:"sum_no_index_used"`
	SumRowsAffected         uint64        `json:"sum_rows_affected"`
	SumRowsExamined         uint64        `json:"sum_rows_examined"`
	SumRowsSent             uint64        `json:"sum_rows_sent"`
	SumSelectFullJoin       uint64        `json:"sum_select_full_join"`
	SumSelectFullRangeJoin  uint64        `json:"sum_select_full_range_join"`
	SumSelectRange          uint64        `json:"sum_select_range"`
	SumSelectRangeCheck     uint64        `json:"sum_select_range_check"`
	SumSelectScan           uint64        `json:"sum_select_scan"`
	SumSortMergePasses      uint64        `json:"sum_sort_merge_passes"`
	SumSortRange            uint64        `json:"sum_sort_range"`
	SumSortRows             uint64        `json:"sum_sort_rows"`
	SumSortScan             uint64        `json:"sum_sort_scan"`
	SumTimerWait            time.Duration `json:"sum_timer_wait"`
	SumWarnings             uint64        `json:"sum_warnings"`
}

ManagedDatabaseQueryStatisticsMySQL represents statistics reported by a MySQL server. Statistics are per Digest which is derived from DigestText

type ManagedDatabaseQueryStatisticsPostgreSQL

type ManagedDatabaseQueryStatisticsPostgreSQL struct {
	BlockReadTime       time.Duration `json:"blk_read_time"`
	BlockWriteTime      time.Duration `json:"blk_write_time"`
	Calls               uint64        `json:"calls"`
	DatabaseName        string        `json:"database_name"`
	LocalBlocksDirtied  uint64        `json:"local_blks_dirtied"`
	LocalBlocksHit      uint64        `json:"local_blks_hit"`
	LocalBlocksRead     uint64        `json:"local_blks_read"`
	LocalBlocksWritten  uint64        `json:"local_blks_written"`
	MaxTime             time.Duration `json:"max_time"`
	MeanTime            time.Duration `json:"mean_time"`
	MinTime             time.Duration `json:"min_time"`
	Query               string        `json:"query"`
	Rows                uint64        `json:"rows"`
	SharedBlocksDirtied uint64        `json:"shared_blks_dirtied"`
	SharedBlocksHit     uint64        `json:"shared_blks_hit"`
	SharedBlocksRead    uint64        `json:"shared_blks_read"`
	SharedBlocksWritten uint64        `json:"shared_blks_written"`
	StddevTime          time.Duration `json:"stddev_time"`
	TempBlocksRead      uint64        `json:"temp_blks_read"`
	TempBlocksWritten   uint64        `json:"temp_blks_written"`
	TotalTime           time.Duration `json:"total_time"`
	UserName            string        `json:"user_name"`
}

ManagedDatabaseQueryStatisticsPostgreSQL represents statistics reported by a PostgreSQL server. Statistics are per Query without parameters.

type ManagedDatabaseServicePlan added in v4.6.0

type ManagedDatabaseServicePlan struct {
	BackupConfig ManagedDatabaseBackupConfig     `json:"backup_config"`
	NodeCount    int                             `json:"node_count"`
	Plan         string                          `json:"plan"`
	CoreNumber   int                             `json:"core_number"`
	StorageSize  int                             `json:"storage_size"`
	MemoryAmount int                             `json:"memory_amount"`
	Zones        ManagedDatabaseServicePlanZones `json:"zones"`
}

ManagedDatabaseType represets details of a database service plan.

type ManagedDatabaseServicePlanZone added in v4.6.0

type ManagedDatabaseServicePlanZone struct {
	Name string `json:"name"`
}

ManagedDatabaseServicePlanZone represents zone where parent database plan is available

type ManagedDatabaseServicePlanZones added in v4.6.0

type ManagedDatabaseServicePlanZones []ManagedDatabaseServicePlanZone

ManagedDatabaseServicePlanZones is a helper for unmarshaling database plan zones

func (*ManagedDatabaseServicePlanZones) UnmarshalJSON added in v4.6.0

func (s *ManagedDatabaseServicePlanZones) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ManagedDatabaseServiceProperty added in v4.6.0

type ManagedDatabaseServiceProperty struct {
	CreateOnly  bool        `json:"createOnly,omitempty"`
	Default     interface{} `json:"default,omitempty"`
	Example     interface{} `json:"example,omitempty"`
	MaxLength   int         `json:"maxLength,omitempty"`
	MinLength   int         `json:"minLength,omitempty"`
	Pattern     string      `json:"pattern,omitempty"`
	Type        interface{} `json:"type"`
	Title       string      `json:"title"`
	Description string      `json:"description,omitempty"`
	Enum        interface{} `json:"enum,omitempty"`
	UserError   string      `json:"user_error,omitempty"`
}

ManagedDatabaseServiceProperty contains help for database property usage and validation

type ManagedDatabaseServiceType

type ManagedDatabaseServiceType string

ManagedDatabaseServiceType represents the type of the service. It mainly refers to the underlying database engine that is exposed by the service.

const (
	// ManagedDatabaseServiceTypePostgreSQL references a PostgreSQL type of database instance
	ManagedDatabaseServiceTypePostgreSQL ManagedDatabaseServiceType = "pg"
	// ManagedDatabaseServiceTypeMySQL references a MySQL type of database instance
	ManagedDatabaseServiceTypeMySQL ManagedDatabaseServiceType = "mysql"
)

type ManagedDatabaseServiceURIParams

type ManagedDatabaseServiceURIParams struct {
	DatabaseName string `json:"dbname"`
	Host         string `json:"host"`
	Password     string `json:"password"`
	Port         string `json:"port"`
	SSLMode      string `json:"ssl_mode"`
	User         string `json:"user"`
}

ManagedDatabaseServiceURIParams represents individual components of ServiceURI field

type ManagedDatabaseState

type ManagedDatabaseState string

ManagedDatabaseState represents a current state the service is in

const (
	// ManagedDatabaseStateRunning represents a managed database instance in running state
	ManagedDatabaseStateRunning ManagedDatabaseState = "running"
	// ManagedDatabaseStatePoweroff represents a managed database instance in powered off state
	ManagedDatabaseStatePoweroff ManagedDatabaseState = "poweroff"
)

type ManagedDatabaseType added in v4.6.0

type ManagedDatabaseType struct {
	Name                   string                                    `json:"name"`
	Description            string                                    `json:"description"`
	LatestAvailableVersion string                                    `json:"latest_available_version"`
	ServicePlans           []ManagedDatabaseServicePlan              `json:"service_plans"`
	Properties             map[string]ManagedDatabaseServiceProperty `json:"properties"`
}

ManagedDatabaseType represets details of a database service type.

type ManagedDatabaseUser

type ManagedDatabaseUser struct {
	// Authentication field represents an allowed authentication type for this user. For more information see:
	// 	upcloud.ManagedDatabaseUserAuthenticationCachingSHA2Password
	// 	upcloud.ManagedDatabaseUserAuthenticationMySQLNativePassword
	Authentication ManagedDatabaseUserAuthenticationType `json:"authentication,omitempty"`
	Type           ManagedDatabaseUserType               `json:"type"`
	// Password field is only visible when querying an individual user. It is omitted in main service view and in
	// get all users view.
	Password string `json:"password,omitempty"`
	Username string `json:"username"`
}

ManagedDatabaseUser represents a database internal user

type ManagedDatabaseUserAuthenticationType

type ManagedDatabaseUserAuthenticationType string

ManagedDatabaseUserAuthenticationType represents the type of an authentication method for an internal database user

const (
	// ManagedDatabaseUserAuthenticationCachingSHA2Password selects "caching_sha2_password" type of authentication type.
	// This type is only supported with MySQL services.
	//nolint:gosec // this is not actually a password but an authentication type
	ManagedDatabaseUserAuthenticationCachingSHA2Password ManagedDatabaseUserAuthenticationType = "caching_sha2_password"
	// ManagedDatabaseUserAuthenticationMySQLNativePassword selects "mysql_native_password" type of authentication type.
	// This type is only supported with MySQL services.
	//nolint:gosec // this is not actually a password but an authentication type
	ManagedDatabaseUserAuthenticationMySQLNativePassword ManagedDatabaseUserAuthenticationType = "mysql_native_password"
)

type ManagedDatabaseUserType

type ManagedDatabaseUserType string

ManagedDatabaseUserType represents the type of an internal database user

const (
	// ManagedDatabaseUserTypePrimary is a type of the primary user of a managed database service. There can be only
	// one primary user per service. The primary user has administrative privileges to manage logical databases and
	// users thru the database's native API.
	ManagedDatabaseUserTypePrimary ManagedDatabaseUserType = "primary"
	// ManagedDatabaseUserTypeNormal is a type of a normal database user of a managed database service. There can
	// be multiple normal users and the primary user can manage the privileges of these users thru the database's
	// native API.
	ManagedDatabaseUserTypeNormal ManagedDatabaseUserType = "normal"
)

type Network

type Network struct {
	IPNetworks IPNetworkSlice     `json:"ip_networks"`
	Name       string             `json:"name"`
	Type       string             `json:"type"`
	UUID       string             `json:"uuid"`
	Zone       string             `json:"zone"`
	Router     string             `json:"router"`
	Servers    NetworkServerSlice `json:"servers"`
}

Network represents a network in a networking response.

func (*Network) UnmarshalJSON

func (s *Network) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type NetworkServer

type NetworkServer struct {
	ServerUUID  string `json:"uuid"`
	ServerTitle string `json:"title"`
}

NetworkServer represents a server in a networking response

type NetworkServerSlice

type NetworkServerSlice []NetworkServer

NetworkServerSlice is a slice of NetworkServers. It exists to allow for a custom JSON unmarshaller.

func (*NetworkServerSlice) UnmarshalJSON

func (t *NetworkServerSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type NetworkSlice

type NetworkSlice []Network

NetworkSlice is a slice of Networks. It exists to allow for a custom JSON unmarshaller.

func (*NetworkSlice) UnmarshalJSON

func (t *NetworkSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Networking

type Networking struct {
	Interfaces ServerInterfaceSlice `json:"interfaces"`
}

Networking represents networking in a response

func (*Networking) UnmarshalJSON

func (s *Networking) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Networks

type Networks struct {
	Networks []Network `json:"networks"`
}

Networks represents multiple networks in a GetNetworks and GetNetworksInZone response.

func (*Networks) UnmarshalJSON

func (n *Networks) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ObjectStorage

type ObjectStorage struct {
	Created     string `json:"created"`
	Description string `json:"description"`
	Name        string `json:"name"`
	Size        int    `json:"size"`
	State       string `json:"state"`
	URL         string `json:"url"`
	UUID        string `json:"uuid"`
	Zone        string `json:"zone"`
}

ObjectStorage represents a Object Storage

type ObjectStorageDetails

type ObjectStorageDetails struct {
	ObjectStorage
	UsedSpace int `json:"used_space"`
}

ObjectStorageDetails represents details about a Object Storage

func (*ObjectStorageDetails) UnmarshalJSON

func (o *ObjectStorageDetails) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ObjectStorages

type ObjectStorages struct {
	ObjectStorages []ObjectStorage `json:"object_storages"`
}

ObjectStorages represent a /object-storage response

func (*ObjectStorages) UnmarshalJSON

func (o *ObjectStorages) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Plan

type Plan struct {
	CoreNumber       int    `json:"core_number"`
	MemoryAmount     int    `json:"memory_amount"`
	Name             string `json:"name"`
	PublicTrafficOut int    `json:"public_traffic_out"`
	StorageSize      int    `json:"storage_size"`
	StorageTier      string `json:"storage_tier"`
}

Plan represents a pre-configured server configuration plan

type Plans

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

Plans represents a /plan response

func (*Plans) UnmarshalJSON

func (s *Plans) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Price

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

Price represents a price

type PriceZone

type PriceZone struct {
	Name string `json:"name"`

	Firewall               *Price `json:"firewall"`
	IORequestBackup        *Price `json:"io_request_backup"`
	IORequestMaxIOPS       *Price `json:"io_request_maxiops"`
	IPv4Address            *Price `json:"ipv4_address"`
	IPv6Address            *Price `json:"ipv6_address"`
	PublicIPv4BandwidthIn  *Price `json:"public_ipv4_bandwidth_in"`
	PublicIPv4BandwidthOut *Price `json:"public_ipv4_bandwidth_out"`
	PublicIPv6BandwidthIn  *Price `json:"public_ipv6_bandwidth_in"`
	PublicIPv6BandwidthOut *Price `json:"public_ipv6_bandwidth_out"`
	ServerCore             *Price `json:"server_core"`
	ServerMemory           *Price `json:"server_memory"`
	ServerPlan1xCPU1GB     *Price `json:"server_plan_1xCPU-1GB"`
	ServerPlan2xCPU2GB     *Price `json:"server_plan_1xCPU-2GB"`
	ServerPlan4xCPU4GB     *Price `json:"server_plan_4xCPU-4GB"`
	ServerPlan6xCPU8GB     *Price `json:"server_plan_6xCPU-8GB"`
	StorageBackup          *Price `json:"storage_backup"`
	StorageMaxIOPS         *Price `json:"storage_maxiops"`
	StorageTemplate        *Price `json:"storage_template"`
}

PriceZone represents a price zone. A prize zone consists of multiple items that each have a price.

type PriceZones

type PriceZones struct {
	PriceZones []PriceZone `json:"prices"`
}

PriceZones represents a /price response

func (*PriceZones) UnmarshalJSON

func (s *PriceZones) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Problem added in v4.4.0

type Problem struct {
	// Type is the URI to a page describing the problem
	Type string `json:"type"`
	// Title is the human-readable description if the problem
	Title string `json:"title"`
	// InvalidParams if set, is a list of ProblemInvalidParam describing a specific part(s) of the request
	// that caused the problem
	InvalidParams []ProblemInvalidParam `json:"invalid_params,omitempty"`
	// CorrelationID is an unique string that identifies the request that caused the problem
	CorrelationID string `json:"correlation_id,omitempty"`
	// HTTP Status code
	Status int `json:"status"`
}

Problem is the type conforming to RFC7807 that represents an error or a problem associated with an HTTP request.

func (*Problem) Error added in v4.4.0

func (p *Problem) Error() string

type ProblemInvalidParam added in v4.4.0

type ProblemInvalidParam struct {
	Name   string `json:"name"`
	Reason string `json:"reason"`
}

ProblemInvalidParam is a type describing extra information in the Problem type's InvalidParams field.

type ResizeStorageFilesystemBackup added in v4.2.0

type ResizeStorageFilesystemBackup struct {
	Access  string          `json:"access"`
	Created time.Time       `json:"created"`
	License float64         `json:"license"`
	Origin  string          `json:"origin"`
	Servers ServerUUIDSlice `json:"servers"`
	Size    int             `json:"size"`
	State   string          `json:"state"`
	Title   string          `json:"title"`
	Type    string          `json:"type"`
	UUID    string          `json:"uuid"`
	Zone    string          `json:"zone"`
}

ResizeStorageFilesystemBackup represents the backup details taken before an resize operation.

func (*ResizeStorageFilesystemBackup) UnmarshalJSON added in v4.2.0

func (s *ResizeStorageFilesystemBackup) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ResourceLimits

type ResourceLimits struct {
	Cores               int `json:"cores,omitempty"`
	DetachedFloatingIps int `json:"detached_floating_ips,omitempty"`
	Memory              int `json:"memory,omitempty"`
	Networks            int `json:"networks,omitempty"`
	PublicIPv4          int `json:"public_ipv4,omitempty"`
	PublicIPv6          int `json:"public_ipv6,omitempty"`
	StorageHDD          int `json:"storage_hdd,omitempty"`
	StorageSSD          int `json:"storage_ssd,omitempty"`
}

ResourceLimits represents an account's resource limits

type Router

type Router struct {
	AttachedNetworks RouterNetworkSlice `json:"attached_networks"`
	Name             string             `json:"name"`
	Type             string             `json:"type"`
	UUID             string             `json:"uuid"`
}

Router represents a Router in a response

func (*Router) UnmarshalJSON

func (s *Router) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type RouterNetwork

type RouterNetwork struct {
	NetworkUUID string `json:"uuid"`
}

RouterNetwork represents the networks in a router response.

type RouterNetworkSlice

type RouterNetworkSlice []RouterNetwork

RouterNetworkSlice is a slice of RouterNetworks. It exists to allow for a custom unmarshaller.

func (*RouterNetworkSlice) UnmarshalJSON

func (t *RouterNetworkSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Routers

type Routers struct {
	Routers []Router `json:"routers"`
}

Routers represents a response to a GetRouters request

func (*Routers) UnmarshalJSON

func (n *Routers) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Server

type Server struct {
	CoreNumber   int            `json:"core_number,string"`
	Hostname     string         `json:"hostname"`
	License      float64        `json:"license"`
	MemoryAmount int            `json:"memory_amount,string"`
	Plan         string         `json:"plan"`
	Progress     int            `json:"progress,string"`
	State        string         `json:"state"`
	Tags         ServerTagSlice `json:"tags"`
	Title        string         `json:"title"`
	UUID         string         `json:"uuid"`
	Zone         string         `json:"zone"`
}

Server represents a server

type ServerConfiguration

type ServerConfiguration struct {
	CoreNumber   int `json:"core_number,string"`
	MemoryAmount int `json:"memory_amount,string"`
}

ServerConfiguration represents a server configuration

type ServerConfigurations

type ServerConfigurations struct {
	ServerConfigurations []ServerConfiguration `json:"server_sizes"`
}

ServerConfigurations represents a /server_size response

func (*ServerConfigurations) UnmarshalJSON

func (s *ServerConfigurations) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ServerDetails

type ServerDetails struct {
	Server

	BootOrder string `json:"boot_order"`
	// TODO: Convert to boolean
	Firewall             string                   `json:"firewall"`
	Host                 int                      `json:"host"`
	IPAddresses          IPAddressSlice           `json:"ip_addresses"`
	Metadata             Boolean                  `json:"metadata"`
	NICModel             string                   `json:"nic_model"`
	Networking           ServerNetworking         `json:"networking"`
	SimpleBackup         string                   `json:"simple_backup"`
	StorageDevices       ServerStorageDeviceSlice `json:"storage_devices"`
	Timezone             string                   `json:"timezone"`
	VideoModel           string                   `json:"video_model"`
	RemoteAccessEnabled  Boolean                  `json:"remote_access_enabled"`
	RemoteAccessType     string                   `json:"remote_access_type"`
	RemoteAccessHost     string                   `json:"remote_access_host"`
	RemoteAccessPassword string                   `json:"remote_access_password"`
	RemoteAccessPort     int                      `json:"remote_access_port,string"`
}

ServerDetails represents details about a server

func (*ServerDetails) StorageDevice

func (s *ServerDetails) StorageDevice(storageUUID string) *ServerStorageDevice

func (*ServerDetails) UnmarshalJSON

func (s *ServerDetails) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ServerGroup added in v4.5.0

type ServerGroup struct {
	UUID    string          `json:"uuid,omitempty"`
	Title   string          `json:"title,omitempty"`
	Members ServerUUIDSlice `json:"servers,omitempty"`
}

ServerGroup represents server group

func (*ServerGroup) UnmarshalJSON added in v4.5.0

func (s *ServerGroup) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ServerGroups added in v4.5.0

type ServerGroups []ServerGroup

ServerGroups represents list of server groups

func (*ServerGroups) UnmarshalJSON added in v4.5.0

func (s *ServerGroups) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ServerInterface

type ServerInterface Interface

ServerInterface represent a network interface on the server

type ServerInterfaceSlice

type ServerInterfaceSlice []ServerInterface

ServerInterfaceSlice is a slice of ServerInterfaces. It exists to allow for a custom JSON unmarshaller.

func (*ServerInterfaceSlice) UnmarshalJSON

func (s *ServerInterfaceSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ServerNetworking

type ServerNetworking Networking

ServerNetworking represents the networking on a server response. It is castable to a Networking struct.

type ServerStorageDevice

type ServerStorageDevice struct {
	Address string `json:"address"`
	// TODO: Convert to boolean
	PartOfPlan string `json:"part_of_plan"`
	UUID       string `json:"storage"`
	Size       int    `json:"storage_size"`
	Tier       string `json:"storage_tier"`
	Title      string `json:"storage_title"`
	Type       string `json:"type"`
	BootDisk   int    `json:"boot_disk,string"`
}

ServerStorageDevice represents a storage device in the context of server requests or server details

type ServerStorageDeviceSlice

type ServerStorageDeviceSlice []ServerStorageDevice

ServerStorageDeviceSlice is a slice of ServerStorageDevices. It exists to allow for a custom JSON unmarshaller.

func (*ServerStorageDeviceSlice) UnmarshalJSON

func (s *ServerStorageDeviceSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ServerTagSlice

type ServerTagSlice []string

ServerTagSlice is a slice of string. It exists to allow for a custom JSON unmarshaller.

func (*ServerTagSlice) UnmarshalJSON

func (t *ServerTagSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type ServerUUIDSlice

type ServerUUIDSlice []string

ServerUUIDSlice is a slice of string. It exists to allow for a custom JSON unmarshaller.

func (*ServerUUIDSlice) MarshalJSON added in v4.5.0

func (s *ServerUUIDSlice) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshaller that deals with deeply embedded values.

func (*ServerUUIDSlice) UnmarshalJSON

func (s *ServerUUIDSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Servers

type Servers struct {
	Servers []Server `json:"servers"`
}

Servers represents a /server response

func (*Servers) UnmarshalJSON

func (s *Servers) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Stat

type Stat struct {
	Name      string    `json:"name"`
	Timestamp time.Time `json:"timestamp"`
	Value     float64   `json:"value"`
}

Stat represents Host stats in a response

type StatSlice

type StatSlice []Stat

StatSlice is a slice of Stat structs This exsits to support a custom unmarshaller

func (*StatSlice) UnmarshalJSON

func (t *StatSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Storage

type Storage struct {
	Access  string  `json:"access"`
	License float64 `json:"license"`
	// TODO: Convert to boolean
	PartOfPlan string `json:"part_of_plan"`
	Size       int    `json:"size"`
	State      string `json:"state"`
	Tier       string `json:"tier"`
	Title      string `json:"title"`
	Type       string `json:"type"`
	UUID       string `json:"uuid"`
	Zone       string `json:"zone"`
	// Only for type "backup":
	Origin  string    `json:"origin"`
	Created time.Time `json:"created"`
}

Storage represents a storage device

type StorageDetails

type StorageDetails struct {
	Storage

	BackupRule  *BackupRule     `json:"backup_rule"`
	BackupUUIDs BackupUUIDSlice `json:"backups"`
	ServerUUIDs ServerUUIDSlice `json:"servers"`
}

StorageDetails represents detailed information about a piece of storage

func (*StorageDetails) UnmarshalJSON

func (s *StorageDetails) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type StorageImportDetails

type StorageImportDetails struct {
	ClientContentLength int       `json:"client_content_length"`
	ClientContentType   string    `json:"client_content_type"`
	Completed           time.Time `json:"completed"`
	Created             time.Time `json:"created"`
	DirectUploadURL     string    `json:"direct_upload_url"`
	ErrorCode           string    `json:"error_code"`
	ErrorMessage        string    `json:"error_message"`
	MD5Sum              string    `json:"md5sum"`
	ReadBytes           int       `json:"read_bytes"`
	SHA256Sum           string    `json:"sha256sum"`
	Source              string    `json:"source"`
	SourceLocation      string    `json:"source_location"`
	State               string    `json:"state"`
	UUID                string    `json:"uuid"`
	WrittenBytes        int       `json:"written_bytes"`
}

StorageImportDetails represents the details of an ongoing or completed storge import operation.

func (*StorageImportDetails) UnmarshalJSON

func (s *StorageImportDetails) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Storages

type Storages struct {
	Storages []Storage `json:"storages"`
}

Storages represents a /storage response

func (*Storages) UnmarshalJSON

func (s *Storages) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Tag

type Tag struct {
	Name        string         `json:"name"`
	Description string         `json:"description,omitempty"`
	Servers     TagServerSlice `json:"servers"`
}

Tag represents a server tag

func (*Tag) UnmarshalJSON

func (s *Tag) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type TagServerSlice

type TagServerSlice []string

TagServerSlice is a slice of string. It exists to allow for a custom JSON unmarshaller.

func (TagServerSlice) MarshalJSON

func (t TagServerSlice) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshaller that deals with deeply embedded values.

func (*TagServerSlice) UnmarshalJSON

func (t *TagServerSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Tags

type Tags struct {
	Tags []Tag
}

Tags represents a list of tags

func (*Tags) UnmarshalJSON

func (s *Tags) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type TimeZones

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

TimeZones represents a list of timezones

func (*TimeZones) UnmarshalJSON

func (s *TimeZones) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

type Zone

type Zone struct {
	ID          string  `json:"id"`
	Description string  `json:"description"`
	Public      Boolean `json:"public"`
}

Zone represents a zone

type Zones

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

Zones represents a /zone response

func (*Zones) UnmarshalJSON

func (s *Zones) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaller that deals with deeply embedded values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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