driver

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 11 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(context.Context, *ServerOpts) (*upcloud.ServerDetails, error)
	DeleteServer(context.Context, string) error
	StopServer(context.Context, string) error
	// TODO: rename method or split into two separate method GetStorageByUUID and GetTemplateByName
	GetStorage(ctx context.Context, storageUUID, templateName string) (*upcloud.Storage, error)
	RenameStorage(ctx context.Context, storageUUID, name string) (*upcloud.Storage, error)
	GetServerStorage(context.Context, string) (*upcloud.ServerStorageDevice, error)
	CloneStorage(ctx context.Context, storageUUID, zone, title string) (*upcloud.Storage, error)
	GetTemplateByName(ctx context.Context, name, zone string) (*upcloud.Storage, error)
	CreateTemplate(ctx context.Context, storageUUID, templateTitle string) (*upcloud.Storage, error)
	CreateTemplateStorage(ctx context.Context, title, zone string, size int) (*upcloud.Storage, error)
	ImportStorage(ctx context.Context, storageUUID, contentType string, f io.Reader) (*upcloud.StorageImportDetails, error)
	WaitStorageOnline(ctx context.Context, storageUUID string) (*upcloud.Storage, error)
	DeleteTemplate(context.Context, string) error
	DeleteStorage(ctx context.Context, storageUUID string) error
	GetAvailableZones(context.Context) []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