Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterFactory(factory IBackupStorageFactory)
- type IBackupStorage
- type IBackupStorageFactory
- type SNFSBackupStorage
- func (s *SNFSBackupStorage) ConvertFrom(srcPath string, format qemuimgfmt.TImageFormat, backupId string) (int, error)
- func (s *SNFSBackupStorage) ConvertTo(destPath string, format qemuimgfmt.TImageFormat, backupId string) error
- func (s *SNFSBackupStorage) CopyBackupFrom(srcFilename string, backupId string) error
- func (s *SNFSBackupStorage) CopyBackupTo(targetFilename string, backupId string) error
- func (s *SNFSBackupStorage) GetBackupPath(backupId string) string
- func (s *SNFSBackupStorage) InstancePack(ctx context.Context, packageName string, backupIds []string, ...) (string, error)
- func (s *SNFSBackupStorage) InstanceUnpack(ctx context.Context, packageName string, metadataOnly bool) ([]string, *api.InstanceBackupPackMetadata, error)
- func (s *SNFSBackupStorage) IsExists(backupId string) (bool, error)
- func (s *SNFSBackupStorage) IsOnline() (bool, string, error)
- func (s *SNFSBackupStorage) RemoveBackup(backupId string) error
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 // 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) RemoveBackup ¶
func (s *SNFSBackupStorage) RemoveBackup(backupId string) error
Click to show internal directories.
Click to hide internal directories.