Source code for models_v2.file_lock_config

# -*- coding: utf-8 -*-


[docs]class FileLockConfig(object): """Implementation of the 'FileLockConfig' model. Optional config that enables file locking for this view. It cannot be disabled during the edit of a view, if it has been enabled during the creation of the view. Also, it cannot be enabled if it was disabled during the creation of the view. Attributes: auto_lock_after_duration_idle_msecs (int): Specifies the duration to lock a file that has not been accessed or modified (ie. has been idle) for a certain duration of time in milliseconds. Do not set if it is required to disable auto lock. default_retention_duration_msecs (long|int): Specifies a global default retention duration for files in this view, if file lock is enabled for this view. Also, it is a required field if file lock is enabled. Set to -1 if the required default retention period is forever. expiry_timestamp_msecs (int): Specifies a definite timestamp in milliseconds for retaining the file. locking_protocol (LockingProtocolEnum): Specifies the supported mechanisms to explicity lock a file from NFS/SMB interface. Supported locking protocols: SetReadOnly, SetAtime. 'SetReadOnly' is compatible with Isilon/Netapp behaviour. This locks the file and the retention duration is determined in this order: 1) atime, if set by user/application and within min and max retention duration. 2) Min retention duration, if set. 3) Otherwise, file is switched to expired data automatically. 'SetAtime' is compatible with Data Domain behaviour. max_retention_duration_msecs (long|int): Specifies a maximum duration in milliseconds for which any file in this view can be retained for. Set to -1 if the required retention duration is forever. If set, it should be greater than or equal to the default retention period as well as the min retention period. min_retention_duration_msecs (long|int): Specifies a minimum retention duration in milliseconds after a file gets locked. The file cannot be modified or deleted during this timeframe. Set to -1 if the required retention duration is forever. This should be set less than or equal to the default retention duration. mode (Mode2Enum): Specifies the mode of file level datalock. Enterprise mode can be upgraded to Compliance mode, but Compliance mode cannot be downgraded to Enterprise mode. Compliance: This mode would disallow all user to delete/modify file or view under any condition when it 's in locked status except for deleting view when the view is empty. Enterprise: This mode would follow the rules as compliance mode for normal users. But it would allow the storage admin (1) to delete view or file anytime no matter it is in locked status or expired. (2) to rename the view (3) to bring back the retention period when it's in locked mode A lock mode of a file in a view can be in one of the following: 'Compliance': Default mode of datalock, in this mode, Data Security Admin cannot modify/delete this view when datalock is in effect. Data Security Admin can delete this view when datalock is expired. 'kEnterprise' : In this mode, Data Security Admin can change view name or delete view when datalock is in effect. Datalock in this mode can be upgraded to 'Compliance' mode. """ # Create a mapping from Model property names to API property names _names = { "auto_lock_after_duration_idle_msecs":'autoLockAfterDurationIdleMsecs', "default_retention_duration_msecs":'defaultRetentionDurationMsecs', "expiry_timestamp_msecs":'expiryTimestampMsecs', "locking_protocol":'lockingProtocol', "max_retention_duration_msecs":'maxRetentionDurationMsecs', "min_retention_duration_msecs":'minRetentionDurationMsecs', "mode":'mode' } def __init__(self, auto_lock_after_duration_idle_msecs=None, default_retention_duration_msecs=None, expiry_timestamp_msecs=None, locking_protocol=None, max_retention_duration_msecs=None, min_retention_duration_msecs=None, mode=None): """Constructor for the FileLockConfig class""" # Initialize members of the class self.auto_lock_after_duration_idle_msecs = auto_lock_after_duration_idle_msecs self.default_retention_duration_msecs = default_retention_duration_msecs self.expiry_timestamp_msecs = expiry_timestamp_msecs self.locking_protocol = locking_protocol self.max_retention_duration_msecs = max_retention_duration_msecs self.min_retention_duration_msecs = min_retention_duration_msecs self.mode = mode
[docs] @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the server's response. The keys MUST match property names in the API description. Returns: object: An instance of this structure class. """ if dictionary is None: return None # Extract variables from the dictionary auto_lock_after_duration_idle_msecs = dictionary.get('autoLockAfterDurationIdleMsecs') default_retention_duration_msecs = dictionary.get('defaultRetentionDurationMsecs') expiry_timestamp_msecs = dictionary.get('expiryTimestampMsecs') locking_protocol = dictionary.get('lockingProtocol') max_retention_duration_msecs = dictionary.get('maxRetentionDurationMsecs') min_retention_duration_msecs = dictionary.get('minRetentionDurationMsecs') mode = dictionary.get('mode') # Return an object of this model return cls(auto_lock_after_duration_idle_msecs, default_retention_duration_msecs, expiry_timestamp_msecs, locking_protocol, max_retention_duration_msecs, min_retention_duration_msecs, mode)