b2sdk._internal.sync.policy_manager
- class b2sdk._internal.sync.policy_manager.SyncPolicyManager[source]
Bases:
object
Policy manager; implement a logic to get a correct policy class and create a policy object based on various parameters.
- get_policy(sync_type, source_path, source_folder, dest_path, dest_folder, now_millis, delete, keep_days, newer_file_mode, compare_threshold, compare_version_mode, encryption_settings_provider, upload_mode, absolute_minimum_part_size)[source]
Return a policy object.
- Parameters:
sync_type (
str
) – synchronization typesource_path (
Optional
[AbstractPath
]) – source filesource_folder (
AbstractFolder
) – a source folder pathdest_path (
Optional
[AbstractPath
]) – destination filedest_folder (
AbstractFolder
) – a destination folder pathnow_millis (
int
) – current time in millisecondsdelete (
bool
) – delete policykeep_days (
int
) – keep for days policynewer_file_mode (
NewerFileSyncMode
) – setting which determines handling for destination files newer than on the sourcecompare_threshold (
int
) – difference between file modification time or file sizecompare_version_mode (
CompareVersionMode
) – setting which determines how to compare source and destination filesencryption_settings_provider (
AbstractSyncEncryptionSettingsProvider
) – an object which decides which encryption to use (if any)upload_mode (
UploadMode
) – determines how file uploads are handledabsolute_minimum_part_size (
int
) – minimum file part size for large files
- Return type:
- Returns:
a policy object