File locks
- class b2sdk.v2.LegalHold[source]
Enum holding information about legalHold switch in a file.
- ON = 'on'
legal hold set to “on”
- OFF = 'off'
legal hold set to “off”
- UNSET = None
server default, as for now it is functionally equivalent to OFF
- UNKNOWN = 'unknown'
the client is not authorized to read legal hold settings
- class b2sdk.v2.FileRetentionSetting(mode, retain_until=None)[source]
Represent file retention settings, i.e. whether the file is retained, in which mode and until when
- Parameters:
mode (
RetentionMode
) –
- __init__(mode, retain_until=None)[source]
- Parameters:
mode (
RetentionMode
) –
- class b2sdk.v2.RetentionMode[source]
Enum class representing retention modes set in files and buckets
- GOVERNANCE = 'governance'
retention settings for files in this mode can be modified by clients with appropriate application key capabilities
- COMPLIANCE = 'compliance'
retention settings for files in this mode can only be modified by extending the retention dates by clients with appropriate application key capabilities
- NONE = None
retention not set
- UNKNOWN = 'unknown'
the client is not authorized to read retention settings
- class b2sdk.v2.BucketRetentionSetting(mode, period=None)[source]
Represent bucket’s default file retention settings, i.e. whether the files should be retained, in which mode and for how long
- Parameters:
mode (
RetentionMode
) –period (
Optional
[RetentionPeriod
]) –
- __init__(mode, period=None)[source]
- Parameters:
mode (
RetentionMode
) –period (
Optional
[RetentionPeriod
]) –
- class b2sdk.v2.RetentionPeriod(years=None, days=None)[source]
Represent a time period (either in days or in years) that is used as a default for bucket retention
- KNOWN_UNITS = ['days', 'years']
- __init__(years=None, days=None)[source]
Create a retention period, provide exactly one of: days, years
- class b2sdk.v2.FileLockConfiguration(default_retention, is_file_lock_enabled)[source]
Represent bucket’s file lock configuration, i.e. whether the file lock mechanism is enabled and default file retention
- Parameters:
default_retention (
BucketRetentionSetting
) –
- __init__(default_retention, is_file_lock_enabled)[source]
- Parameters:
default_retention (
BucketRetentionSetting
) –
- b2sdk.v2.UNKNOWN_BUCKET_RETENTION
alias of BucketRetentionSetting(‘unknown’, None)
- b2sdk.v2.UNKNOWN_FILE_LOCK_CONFIGURATION
alias of FileLockConfiguration(BucketRetentionSetting(‘unknown’, None), None)
- b2sdk.v2.NO_RETENTION_BUCKET_SETTING
alias of BucketRetentionSetting(None, None)
- b2sdk.v2.NO_RETENTION_FILE_SETTING
alias of FileRetentionSetting(None, None)
- b2sdk.v2.UNKNOWN_FILE_RETENTION_SETTING
alias of FileRetentionSetting(‘unknown’, None)