backupstorage

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PackageDiskFilename     = "disk"
	PackageMetadataFilename = "metadata"
)

Variables

View Source
var ErrorBackupStorageOffline error = errors.Error(api.BackupStorageOffline)

Functions

func RegisterFactory

func RegisterFactory(factory IBackupStorageFactory)

Types

type IBackupStorage

type IBackupStorage interface {
	// 从指定路径拷贝磁盘文件到备份存储
	SaveBackupFrom(ctx context.Context, srcFilename string, bakcupId string) error
	// 将备份backupId对应的备份文件拷贝到指定的文件路径
	RestoreBackupTo(ctx context.Context, targetFilename string, backupId string) error
	// 删除备份
	RemoveBackup(ctx context.Context, backupId string) error
	// 备份是否存在
	IsBackupExists(backupId string) (bool, error)

	// 从指定路径拷贝主机备份文件到备份存储
	SaveBackupInstanceFrom(ctx context.Context, srcFilename string, bakcupInstanceId string) error
	// 将备份backupId对应的备份文件拷贝到指定的文件路径
	RestoreBackupInstanceTo(ctx context.Context, targetFilename string, backupInstanceId string) error
	// 删除备份
	RemoveBackupInstance(ctx context.Context, backupInstanceId string) error
	// 备份是否存在
	IsBackupInstanceExists(backupInstanceId string) (bool, error)

	// 存储是否在线
	IsOnline() (bool, string, error)
}

func GetBackupStorage

func GetBackupStorage(backupStroageId string, backupStorageAccessInfo *jsonutils.JSONDict) (IBackupStorage, error)

type IBackupStorageFactory

type IBackupStorageFactory interface {
	NewBackupStore(storeId string, backupStorageAccessInfo *jsonutils.JSONDict) (IBackupStorage, error)
}

type SNFSBackupStorage

type SNFSBackupStorage struct {
	BackupStorageId string
	Path            string
	NfsHost         string
	NfsSharedDir    string
	// contains filtered or unexported fields
}

func NewNFSBackupStorage

func NewNFSBackupStorage(backupStorageId, nfsHost, nfsSharedDir string) *SNFSBackupStorage

func (*SNFSBackupStorage) ConvertFrom

func (s *SNFSBackupStorage) ConvertFrom(srcPath string, format qemuimgfmt.TImageFormat, backupId string) (int, error)

func (*SNFSBackupStorage) ConvertTo

func (s *SNFSBackupStorage) ConvertTo(destPath string, format qemuimgfmt.TImageFormat, backupId string) error

func (*SNFSBackupStorage) CopyBackupFrom

func (s *SNFSBackupStorage) CopyBackupFrom(srcFilename string, backupId string) error

func (*SNFSBackupStorage) CopyBackupTo

func (s *SNFSBackupStorage) CopyBackupTo(targetFilename string, backupId string) error

func (*SNFSBackupStorage) GetBackupPath

func (s *SNFSBackupStorage) GetBackupPath(backupId string) string

func (*SNFSBackupStorage) InstancePack

func (s *SNFSBackupStorage) InstancePack(ctx context.Context, packageName string, backupIds []string, metadata *api.InstanceBackupPackMetadata) (string, error)

func (*SNFSBackupStorage) InstanceUnpack

func (s *SNFSBackupStorage) InstanceUnpack(ctx context.Context, packageName string, metadataOnly bool) ([]string, *api.InstanceBackupPackMetadata, error)

func (*SNFSBackupStorage) IsExists

func (s *SNFSBackupStorage) IsExists(backupId string) (bool, error)

func (*SNFSBackupStorage) IsOnline

func (s *SNFSBackupStorage) IsOnline() (bool, string, error)

func (*SNFSBackupStorage) RemoveBackup

func (s *SNFSBackupStorage) RemoveBackup(backupId string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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