upcloud

package module
v0.0.0-...-053a64e Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Username string `json:"username"`
}

type CreateIPNetwork

type CreateIPNetwork struct {
	Address string
	DHCP    bool
	Family  string
}

func (CreateIPNetwork) MarshalJSON

func (r CreateIPNetwork) MarshalJSON() ([]byte, error)

type CreateNetworkRequest

type CreateNetworkRequest struct {
	Name       string
	Zone       string
	IPNetworks []CreateIPNetwork
}

func (CreateNetworkRequest) MarshalJSON

func (r CreateNetworkRequest) MarshalJSON() ([]byte, error)

func (CreateNetworkRequest) Path

func (r CreateNetworkRequest) Path() string

func (CreateNetworkRequest) Validate

func (r CreateNetworkRequest) Validate() []client.FieldError

type CreateServerIPAddress

type CreateServerIPAddress struct {
	Family string `json:"family"`
}

type CreateServerIPAddresses

type CreateServerIPAddresses struct {
	IPAddress []CreateServerIPAddress `json:"ip_address"`
}

type CreateServerInterface

type CreateServerInterface struct {
	IPAddresses CreateServerIPAddresses `json:"ip_addresses"`
	Type        string                  `json:"type"`
	Network     string                  `json:"network,omitempty"`
}

type CreateServerInterfaces

type CreateServerInterfaces struct {
	Interfaces CreateServerInterfacesInner `json:"interfaces"`
}

type CreateServerInterfacesInner

type CreateServerInterfacesInner struct {
	Interfaces []CreateServerInterface `json:"interface"`
}

type CreateServerRequest

type CreateServerRequest struct {
	// The zone in which the server will be hosted, e.g. fi-hel1. See Zones.
	//
	// A valid zone identifierA valid zone identifier.
	Zone string `json:"zone"`
	// A short, informational description.
	//
	// 0-64 characters
	Title string `json:"title"`
	// A valid domain name, e.g. host.example.com. The maximum length is 128 characters.
	Hostname string `json:"hostname"`
	// The storage_devices block contains storage_device blocks that define the
	// attached storages.
	//
	// 1-8 storage_device blocks
	StorageDevices CreateServerStorageDevices `json:"storage_devices"`
	// All interfaces wanted for the server.
	//
	// An array of 1-10 interface objects.
	Interfaces CreateServerInterfaces `json:"networking"`
}

func (CreateServerRequest) MarshalJSON

func (r CreateServerRequest) MarshalJSON() ([]byte, error)

func (CreateServerRequest) Path

func (r CreateServerRequest) Path() string

func (CreateServerRequest) Validate

func (r CreateServerRequest) Validate() []client.FieldError

type CreateServerStorageDevice

type CreateServerStorageDevice struct {
	// The method used to create or attach the specified storage.
	//
	// create / clone / attach
	Action string `json:"action"`
	// if action is create The size of the storage device in gigabytes. This attribute is applicable only if action is create or clone.
	//
	// 10-1024
	Size int `json:"size"`
	// if action is clone or attach The UUID of the storage device to be attached or cloned. Applicable only if action is attach or clone.
	//
	// A valid storage UUID
	Storage string `json:"storage,omitempty"`
	// A short, informational description for the storage.
	//
	// 0-64 characters
	Title string `json:"title"`
}

type CreateServerStorageDevices

type CreateServerStorageDevices struct {
	Devices []CreateServerStorageDevice `json:"storage_device"`
}

type DeleteNetworkRequest

type DeleteNetworkRequest struct {
	UUID string
}

func (DeleteNetworkRequest) Path

func (r DeleteNetworkRequest) Path() string

type DeleteServerRequest

type DeleteServerRequest struct {
	UUID string
}

func (DeleteServerRequest) Path

func (r DeleteServerRequest) Path() string

type GetAccountRequest

type GetAccountRequest struct{}

func (GetAccountRequest) Path

func (r GetAccountRequest) Path() string

type GetNetworkDetailsRequest

type GetNetworkDetailsRequest struct {
	UUID string
}

func (GetNetworkDetailsRequest) Path

type GetServerDetailsRequest

type GetServerDetailsRequest struct {
	UUID string
}

func (GetServerDetailsRequest) Path

type IPNetwork

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

type IPNetworks

type IPNetworks struct {
	Networks []IPNetwork `json:"ip_network"`
}

type ListNetworksInZoneRequest

type ListNetworksInZoneRequest struct {
	Zone string
}

func (ListNetworksInZoneRequest) Path

type Network

type Network struct {
	IPNetworks IPNetworks `json:"ip_networks"`
	Name       string     `json:"name"`
	Type       string     `json:"type"`
	UUID       string     `json:"uuid"`
	Zone       string     `json:"zone"`
}

type Server

type Server struct {
	State string `json:"state"`
	UUID  string `json:"uuid"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(client *client.Client) *Service

func (*Service) CreateNetwork

func (s *Service) CreateNetwork(req CreateNetworkRequest) (*Network, error)

func (*Service) CreateServer

func (s *Service) CreateServer(req CreateServerRequest) (*Server, error)

func (*Service) DeleteNetwork

func (s *Service) DeleteNetwork(req DeleteNetworkRequest) error

func (*Service) DeleteServer

func (s *Service) DeleteServer(req DeleteServerRequest) error

func (*Service) GetAccount

func (s *Service) GetAccount() (*Account, error)

func (*Service) GetNetworkDetails

func (s *Service) GetNetworkDetails(req GetNetworkDetailsRequest) (*Network, error)

func (*Service) GetServerDetails

func (s *Service) GetServerDetails(req GetServerDetailsRequest) (*Server, error)

func (*Service) ListNetworksInZone

func (s *Service) ListNetworksInZone(req ListNetworksInZoneRequest) ([]Network, error)

func (*Service) StopServer

func (s *Service) StopServer(req StopServerRequest) error

func (*Service) WaitForServerState

func (s *Service) WaitForServerState(req WaitForServerStateRequest) (*Server, error)

type StopServerRequest

type StopServerRequest struct {
	Timeout time.Duration
	Type    string
	UUID    string
}

func (StopServerRequest) MarshalJSON

func (r StopServerRequest) MarshalJSON() ([]byte, error)

func (StopServerRequest) Path

func (r StopServerRequest) Path() string

func (StopServerRequest) Validate

func (r StopServerRequest) Validate() []client.FieldError

type WaitForServerStateRequest

type WaitForServerStateRequest struct {
	Timeout    time.Duration
	UUID       string
	WaitStates []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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