driver

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func CredentialsFromEnv added in v1.9.0

func CredentialsFromEnv(username, password, token string) (credentials.Credentials, error)

Types

type Driver

Driver combines all management interfaces.

func NewDriver

func NewDriver(c *DriverConfig) Driver

type DriverConfig

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

type ServerManager added in v1.7.0

type ServerManager interface {
	CreateServer(ctx context.Context, opts *ServerOpts) (*upcloud.ServerDetails, error)
	DeleteServer(ctx context.Context, serverUUID string) error
	StopServer(ctx context.Context, serverUUID string) error
	// TODO: rename method or split into two separate method GetStorageByUUID and GetTemplateByName
	GetServerStorage(ctx context.Context, serverUUID string) (*upcloud.ServerStorageDevice, error)
}

ServerManager handles server lifecycle operations.

type ServerOpts

type ServerOpts struct {
	StorageUUID  string
	StorageSize  int
	Zone         string
	SSHPublicKey string
	Networking   []request.CreateServerInterface
	StorageTier  string
}

type StorageManager added in v1.7.0

type StorageManager interface {
	GetStorage(ctx context.Context, storageUUID, templateName string) (*upcloud.Storage, error)
	RenameStorage(ctx context.Context, storageUUID, name string) (*upcloud.Storage, error)
	CloneStorage(ctx context.Context, storageUUID, zone, title string) (*upcloud.Storage, error)
	CreateTemplateStorage(ctx context.Context, title, zone string, size int, tier string) (*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)
	DeleteStorage(ctx context.Context, storageUUID string) error
}

StorageManager handles storage operations.

type TemplateManager added in v1.7.0

type TemplateManager interface {
	GetTemplateByName(ctx context.Context, name, zone string) (*upcloud.Storage, error)
	CreateTemplate(ctx context.Context, storageUUID, templateTitle string) (*upcloud.Storage, error)
	DeleteTemplate(ctx context.Context, templateUUID string) error
}

TemplateManager handles template operations.

type ZoneManager added in v1.7.0

type ZoneManager interface {
	GetAvailableZones(ctx context.Context) []string
}

ZoneManager handles zone operations.

Jump to

Keyboard shortcuts

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