Documentation ¶
Index ¶
- Variables
- type Service
- type UpCloudService
- func (u *UpCloudService) AttachStorage(ctx context.Context, storageUUID, serverUUID string) error
- func (u *UpCloudService) CloneStorage(ctx context.Context, r *request.CloneStorageRequest, label ...upcloud.Label) (*upcloud.StorageDetails, error)
- func (u *UpCloudService) CreateStorage(ctx context.Context, csr *request.CreateStorageRequest) (*upcloud.StorageDetails, error)
- func (u *UpCloudService) CreateStorageBackup(ctx context.Context, uuid, title string) (*upcloud.StorageDetails, error)
- func (u *UpCloudService) DeleteStorage(ctx context.Context, storageUUID string) error
- func (u *UpCloudService) DeleteStorageBackup(ctx context.Context, uuid string) error
- func (u *UpCloudService) DetachStorage(ctx context.Context, storageUUID, serverUUID string) error
- func (u *UpCloudService) GetServerByHostname(ctx context.Context, hostname string) (*upcloud.ServerDetails, error)
- func (u *UpCloudService) GetStorageBackupByName(ctx context.Context, name string) (*upcloud.Storage, error)
- func (u *UpCloudService) GetStorageByName(ctx context.Context, storageName string) ([]*upcloud.StorageDetails, error)
- func (u *UpCloudService) GetStorageByUUID(ctx context.Context, storageUUID string) (*upcloud.StorageDetails, error)
- func (u *UpCloudService) ListStorage(ctx context.Context, zone string) ([]upcloud.Storage, error)
- func (u *UpCloudService) ListStorageBackups(ctx context.Context, originUUID string) ([]upcloud.Storage, error)
- func (u *UpCloudService) RequireStorageOnline(ctx context.Context, s *upcloud.Storage) error
- func (u *UpCloudService) ResizeBlockDevice(ctx context.Context, uuid string, newSize int) (*upcloud.StorageDetails, error)
- func (u *UpCloudService) ResizeStorage(ctx context.Context, uuid string, newSize int, deleteBackup bool) (*upcloud.StorageDetails, error)
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 (u *UpCloudService) CloneStorage(ctx context.Context, r *request.CloneStorageRequest, label ...upcloud.Label) (*upcloud.StorageDetails, error)
func (*UpCloudService) CreateStorage ¶
func (u *UpCloudService) CreateStorage(ctx context.Context, csr *request.CreateStorageRequest) (*upcloud.StorageDetails, error)
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 (*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 (*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 (*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)
Click to show internal directories.
Click to hide internal directories.