service

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStorageNotFound       = errors.New("upcloud: storage not found")
	ErrServerNotFound        = errors.New("upcloud: server not found")
	ErrServerStorageNotFound = errors.New("upcloud: server storage not found")
	ErrBackupInProgress      = errors.New("upcloud: cannot take snapshot while storage is in state backup")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	GetServerByHostname(context.Context, string) (*upcloud.ServerDetails, error)
	GetStorageByUUID(context.Context, string) (*upcloud.StorageDetails, error)
	GetStorageByName(context.Context, string) ([]*upcloud.StorageDetails, error)
	ListStorage(context.Context, string) ([]upcloud.Storage, error)
	GetStorageBackupByName(context.Context, string) (*upcloud.Storage, error)
	ListStorageBackups(ctx context.Context, uuid string) ([]upcloud.Storage, error)
	RequireStorageOnline(ctx context.Context, s *upcloud.Storage) error
	CreateStorage(context.Context, *request.CreateStorageRequest) (*upcloud.StorageDetails, error)
	CloneStorage(context.Context, *request.CloneStorageRequest, ...upcloud.Label) (*upcloud.StorageDetails, error)
	DeleteStorage(context.Context, string) error
	AttachStorage(context.Context, string, string) error
	DetachStorage(context.Context, string, string) error
	ResizeStorage(ctx context.Context, uuid string, newSize int, deleteBackup bool) (*upcloud.StorageDetails, error)
	ResizeBlockDevice(ctx context.Context, uuid string, newSize int) (*upcloud.StorageDetails, error)
	CreateStorageBackup(ctx context.Context, uuid, title string) (*upcloud.StorageDetails, error)
	DeleteStorageBackup(ctx context.Context, uuid string) error
}

type UpCloudService

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

func NewUpCloudService

func NewUpCloudService(svc upCloudClient) *UpCloudService

func NewUpCloudServiceFromCredentials

func NewUpCloudServiceFromCredentials(username, password string) (*UpCloudService, error)

func (*UpCloudService) AttachStorage

func (u *UpCloudService) AttachStorage(ctx context.Context, storageUUID, serverUUID string) error

func (*UpCloudService) CloneStorage

func (*UpCloudService) CreateStorage

func (*UpCloudService) CreateStorageBackup

func (u *UpCloudService) CreateStorageBackup(ctx context.Context, uuid, title string) (*upcloud.StorageDetails, error)

func (*UpCloudService) DeleteStorage

func (u *UpCloudService) DeleteStorage(ctx context.Context, storageUUID string) error

func (*UpCloudService) DeleteStorageBackup

func (u *UpCloudService) DeleteStorageBackup(ctx context.Context, uuid string) error

func (*UpCloudService) DetachStorage

func (u *UpCloudService) DetachStorage(ctx context.Context, storageUUID, serverUUID string) error

func (*UpCloudService) GetServerByHostname

func (u *UpCloudService) GetServerByHostname(ctx context.Context, hostname string) (*upcloud.ServerDetails, error)

func (*UpCloudService) GetStorageBackupByName

func (u *UpCloudService) GetStorageBackupByName(ctx context.Context, name string) (*upcloud.Storage, error)

func (*UpCloudService) GetStorageByName

func (u *UpCloudService) GetStorageByName(ctx context.Context, storageName string) ([]*upcloud.StorageDetails, error)

func (*UpCloudService) GetStorageByUUID

func (u *UpCloudService) GetStorageByUUID(ctx context.Context, storageUUID string) (*upcloud.StorageDetails, error)

func (*UpCloudService) ListStorage

func (u *UpCloudService) ListStorage(ctx context.Context, zone string) ([]upcloud.Storage, error)

func (*UpCloudService) ListStorageBackups

func (u *UpCloudService) ListStorageBackups(ctx context.Context, originUUID string) ([]upcloud.Storage, error)

listStorageBackups lists strage backups. If `originUUID` is empty all backups are retured.

func (*UpCloudService) RequireStorageOnline

func (u *UpCloudService) RequireStorageOnline(ctx context.Context, s *upcloud.Storage) error

func (*UpCloudService) ResizeBlockDevice

func (u *UpCloudService) ResizeBlockDevice(ctx context.Context, uuid string, newSize int) (*upcloud.StorageDetails, error)

func (*UpCloudService) ResizeStorage

func (u *UpCloudService) ResizeStorage(ctx context.Context, uuid string, newSize int, deleteBackup bool) (*upcloud.StorageDetails, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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