driver

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPlan             string = "1xCPU-2GB"
	DefaultHostname         string = "custom"
	EnvConfigUsername       string = "UPCLOUD_USERNAME"
	EnvConfigPassword       string = "UPCLOUD_PASSWORD"
	EnvConfigUsernameLegacy string = "UPCLOUD_API_USER"
	EnvConfigPasswordLegacy string = "UPCLOUD_API_PASSWORD"
)

Variables

This section is empty.

Functions

func PasswordFromEnv added in v1.5.0

func PasswordFromEnv() string

func UsernameFromEnv added in v1.5.0

func UsernameFromEnv() string

Types

type Driver

type Driver interface {
	CreateServer(*ServerOpts) (*upcloud.ServerDetails, error)
	DeleteServer(string) error
	StopServer(string) error
	// TODO: rename method or split into two separate method GetStorageByUUID and GetTemplateByName
	GetStorage(storageUUID, templateName string) (*upcloud.Storage, error)
	RenameStorage(storageUUID, name string) (*upcloud.Storage, error)
	GetServerStorage(string) (*upcloud.ServerStorageDevice, error)
	CloneStorage(storageUUID, zone, title string) (*upcloud.Storage, error)
	GetTemplateByName(name, zone string) (*upcloud.Storage, error)
	CreateTemplate(storageUUID, templateTitle string) (*upcloud.Storage, error)
	CreateTemplateStorage(title, zone string, size int) (*upcloud.Storage, error)
	ImportStorage(storageUUID, contentType string, f io.Reader) (*upcloud.StorageImportDetails, error)
	WaitStorageOnline(storageUUID string) (*upcloud.Storage, error)
	DeleteTemplate(string) error
	DeleteStorage(storageUUID string) error
	GetAvailableZones() []string
}

func NewDriver

func NewDriver(c *DriverConfig) Driver

type DriverConfig

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

type ServerOpts

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

Jump to

Keyboard shortcuts

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