upcloud

package
v0.0.0-...-63077c5 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPlan = "1xCPU-2GB"
)

Variables

This section is empty.

Functions

func ConvertNetworkTypes

func ConvertNetworkTypes(rawNetworking []NetworkInterface) []request.CreateServerInterface

func GetNowString

func GetNowString() string

func GetServerIp

func GetServerIp(details *upcloud.ServerDetails) (string, error)

parse public ip from server details

func SshHostCallback

func SshHostCallback(state multistep.StateBag) (string, error)

SshHostCallback retrieves the public IPv4 address of the server

func StepHaltWithError

func StepHaltWithError(state multistep.StateBag, err error) multistep.StepAction

wraps error logic

Types

type Driver

type Driver interface {
	CreateServer(*ServerOpts) (*upcloud.ServerDetails, error)
	DeleteServer(string) error
	StopServer(string) error
	GetStorage(string, string) (*upcloud.Storage, error)
	GetServerStorage(string) (*upcloud.ServerStorageDevice, error)
	CloneStorage(string, string, string) (*upcloud.Storage, error)
	CreateTemplate(string, string) (*upcloud.Storage, error)
	DeleteTemplate(string) error
}

func NewDriver

func NewDriver(c *DriverConfig) Driver

type DriverConfig

type DriverConfig struct {
	Username    string
	Password    string
	Timeout     time.Duration
	SSHUsername string
}

type IPAddress

type IPAddress struct {
	Family  string `mapstructure:"family"`
	Address string `mapstructure:"address,omitempty"`
}

type NetworkInterface

type NetworkInterface struct {
	IPAddresses []IPAddress `mapstructure:"ip_addresses"`
	Type        string      `mapstructure:"type"`
	Network     string      `mapstructure:"network,omitempty"`
}

for config type convertion

type ServerOpts

type ServerOpts struct {
	StorageUuid    string
	StorageSize    int
	Zone           string
	TemplatePrefix string
	SshPublicKey   string
	Networking     []request.CreateServerInterface
}

Jump to

Keyboard shortcuts

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