AutoArchive._services.archiver¶
Provides services for creating the backup.
Modules¶
archiver_service_creator¶
ArchiverServiceProviders enum and ArchiverServiceCreator class.
-
class
AutoArchive._services.archiver.archiver_service_creator.ArchiverServiceCreator[source]¶ Bases:
objectCreator of archiver service instances.
-
classmethod
destroyServices()[source]¶ Removes all existing archiver service instances.
Existing instances of all services will be forgotten. Subsequent request to
getOrCreateArchiverService()will result in creation of a new instance.
-
classmethod
getOrCreateArchiverService(archiverServiceProvider, workDir)[source]¶ Gets existing or creates the new archiver service instance.
See also:
destroyServices().Parameters: - archiverServiceProvider (
ArchiverServiceProviders) – The requested service provider. - workDir (
str) – Path to a directory which can be used to persistently store data.
Returns: Instance of an archiver service.
Return type: Raises: RuntimeError – If creation of the service provider failed.
- archiverServiceProvider (
-
classmethod
getSupportedBackupTypes(archiverServiceProvider)[source]¶ Returns a set of backup types supported by the given archiver service provider.
Parameters: archiverServiceProvider ( ArchiverServiceProviders) – Service provider for which the backup types shall be returned.Returns: Set of supported backup types. Return type: set<BackupTypes>
-
classmethod
getSupportedFeatures(archiverServiceProvider, backupType=None)[source]¶ Returns a set of features supported by the given archiver service provider.
Parameters: - archiverServiceProvider (
ArchiverServiceProviders) – Service provider for which the backup types shall be returned. - backupType (
BackupTypes) – The backup type for which the features shall be returned orNoneif all supported features shall be returned.
Returns: Set of supported features.
Return type: set<ArchiverFeatures>Raises: ValueError – If the given
backupTypeis not supported by thearchiverServiceProvider- archiverServiceProvider (
-
classmethod
_tar_archiver_provider_base¶
_TarArchiverProviderBase class.
-
class
AutoArchive._services.archiver._tar_archiver_provider_base._TarArchiverProviderBase(workDir)[source]¶ Bases:
AutoArchive._archiving.iarchiver.IArchiverBase class for tar archiver service providers.
Abstract constructor of this class, should be called from derived constructors. It initializes the
workDir_property.Parameters: workDir ( str) – Path to a writable directory. The service will use it as persistent storage.-
backupFiles(backupDefinition, compressionStrength=None)[source]¶ Performs basic checks before the backup creation.
Note
Derived classes should call this base method on the beginning of the overridden method.
See also:
IArchiver.backupFiles().
-
backupFilesIncrementally(backupDefinition, compressionStrength=None, level=None)[source]¶ Performs basic checks before the incremental backup creation.
Note
Derived classes should call this base method on the beginning of the overridden method.
See also:
IArchiver.backupFilesIncrementally().
-
static
getBackupFilePath_(backupId, backupType, destination, level=None)[source]¶ Assembles the backup file name and returns a path to it.
Parameters: - backupId (
str) – ID of the backup for which the path shall be returned. - backupType (
BackupTypes) – Type of the backup. - destination (
str) – Path to the directory where the to the backup shall be created. - level (
int) – Backup level.
Returns: Path to the backup file.
Return type: str- backupId (
-
classmethod
raiseIfUnsupportedBackupType_(backupType)[source]¶ Raises an exception if the passed
backupTypeis not supported by the implementation.See also:
IArchiver.supportedBackupTypes.Parameters: backupType ( BackupTypes) – The backup type that shall be checked.Raises: ValueError – If the passed backupTypeis not supported by the concrete implementation.
-
removeBackup(backupDefinition)[source]¶ See:
IArchiver.removeBackup().
-
backupOperationError= <AutoArchive._py_additions.event object>¶
-
fileAdd= <AutoArchive._py_additions.event object>¶
-
workDir_¶ Gets path to the working directory.
Return type: str
-
_external_tar_archiver_provider¶
_ExternalTarArchiverProvider class.
-
class
AutoArchive._services.archiver._external_tar_archiver_provider._ExternalTarArchiverProvider(workDir)[source]¶ Bases:
AutoArchive._services.archiver._tar_archiver_provider_base._TarArchiverProviderBaseExternal archiver service provider.
See also:
_TarArchiverProviderBase.Raises: OSError – If creation of the snapshot directory failed. -
supportedBackupTypes= frozenset({0, 1, 2, 3})¶
-
_internal_tar_archiver_provider¶
_InternalTarArchiverProvider class.
-
class
AutoArchive._services.archiver._internal_tar_archiver_provider._InternalTarArchiverProvider(workDir)[source]¶ Bases:
AutoArchive._services.archiver._tar_archiver_provider_base._TarArchiverProviderBaseInternal archiver service provider.
See also:
_TarArchiverProviderBase.-
supportedBackupTypes= frozenset({0, 1, 2})¶
-