Documentation ¶
Index ¶
- Constants
- Variables
- type AccessPoint
- type AsyncBR
- type BackupResult
- type Callbacks
- type DataPathError
- type FSBRInitParam
- type FSBRStartParam
- type Manager
- func (m *Manager) CreateFileSystemBR(jobName string, requestorType string, ctx context.Context, ...) (AsyncBR, error)
- func (m *Manager) CreateMicroServiceBRWatcher(ctx context.Context, client client.Client, kubeClient kubernetes.Interface, ...) (AsyncBR, error)
- func (m *Manager) GetAsyncBR(jobName string) AsyncBR
- func (m *Manager) RemoveAsyncBR(jobName string)
- type RestoreResult
- type Result
Constants ¶
const ( TaskTypeBackup = "backup" TaskTypeRestore = "restore" ErrCancelled = "data path is canceled" EventReasonStarted = "Data-Path-Started" EventReasonCompleted = "Data-Path-Completed" EventReasonFailed = "Data-Path-Failed" EventReasonCancelled = "Data-Path-Canceled" EventReasonProgress = "Data-Path-Progress" EventReasonCancelling = "Data-Path-Canceling" EventReasonStopped = "Data-Path-Stopped" )
Variables ¶
var ConcurrentLimitExceed error = errors.New("Concurrent number exceeds")
var FSBRCreator = newFileSystemBR
var MicroServiceBRWatcherCreator = newMicroServiceBRWatcher
Functions ¶
This section is empty.
Types ¶
type AccessPoint ¶
type AccessPoint struct { ByPath string `json:"byPath"` VolMode uploader.PersistentVolumeMode `json:"volumeMode"` }
AccessPoint represents an access point that has been exposed to a data path instance
type AsyncBR ¶
type AsyncBR interface { // Init initializes an asynchronous data path instance Init(ctx context.Context, param interface{}) error // StartBackup starts an asynchronous data path instance for backup StartBackup(source AccessPoint, dataMoverConfig map[string]string, param interface{}) error // StartRestore starts an asynchronous data path instance for restore StartRestore(snapshotID string, target AccessPoint, dataMoverConfig map[string]string) error // Cancel cancels an asynchronous data path instance Cancel() // Close closes an asynchronous data path instance Close(ctx context.Context) }
AsyncBR is the interface for asynchronous data path methods
type BackupResult ¶
type BackupResult struct { SnapshotID string `json:"snapshotID"` EmptySnapshot bool `json:"emptySnapshot"` Source AccessPoint `json:"source,omitempty"` }
BackupResult represents the result of a backup
type Callbacks ¶
type Callbacks struct { OnCompleted func(context.Context, string, string, Result) OnFailed func(context.Context, string, string, error) OnCancelled func(context.Context, string, string) OnProgress func(context.Context, string, string, *uploader.Progress) }
Callbacks defines the collection of callbacks during backup/restore
type DataPathError ¶ added in v1.14.0
type DataPathError struct {
// contains filtered or unexported fields
}
DataPathError represents an error that occurred during a backup or restore operation
func (DataPathError) Error ¶ added in v1.14.0
func (e DataPathError) Error() string
Error implements error.
func (DataPathError) GetSnapshotID ¶ added in v1.14.0
func (e DataPathError) GetSnapshotID() string
GetSnapshotID returns the snapshot ID for the error.
type FSBRInitParam ¶ added in v1.15.0
type FSBRInitParam struct { BSLName string SourceNamespace string UploaderType string RepositoryType string RepoIdentifier string RepositoryEnsurer *repository.Ensurer CredentialGetter *credentials.CredentialGetter Filesystem filesystem.Interface }
FSBRInitParam define the input param for FSBR init
type FSBRStartParam ¶ added in v1.15.0
type FSBRStartParam struct { RealSource string ParentSnapshot string ForceFull bool Tags map[string]string }
FSBRStartParam define the input param for FSBR start
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
NewManager creates the data path manager to manage concurrent data path instances
func (*Manager) CreateFileSystemBR ¶
func (m *Manager) CreateFileSystemBR(jobName string, requestorType string, ctx context.Context, client client.Client, namespace string, callbacks Callbacks, log logrus.FieldLogger) (AsyncBR, error)
CreateFileSystemBR creates a new file system backup/restore data path instance
func (*Manager) CreateMicroServiceBRWatcher ¶ added in v1.15.0
func (m *Manager) CreateMicroServiceBRWatcher(ctx context.Context, client client.Client, kubeClient kubernetes.Interface, mgr manager.Manager, taskType string, taskName string, namespace string, podName string, containerName string, associatedObject string, callbacks Callbacks, resume bool, log logrus.FieldLogger) (AsyncBR, error)
CreateMicroServiceBRWatcher creates a new micro service watcher instance
func (*Manager) GetAsyncBR ¶
GetAsyncBR returns the file system backup/restore data path instance for the specified job name
func (*Manager) RemoveAsyncBR ¶
RemoveAsyncBR removes a file system backup/restore data path instance
type RestoreResult ¶
type RestoreResult struct {
Target AccessPoint `json:"target,omitempty"`
}
RestoreResult represents the result of a restore
type Result ¶
type Result struct { Backup BackupResult Restore RestoreResult }
Result represents the result of a backup/restore