Logo Search packages:      
Sourcecode: s3ql version File versions  Download package

def s3ql::backends::boto::s3::bucket::Bucket::configure_versioning (   self,
  versioning,
  mfa_delete = False,
  mfa_token = None,
  headers = None 
)
Configure versioning for this bucket.
Note: This feature is currently in beta release and is available
      only in the Northern California region.

:type versioning: bool
:param versioning: A boolean indicating whether version is
           enabled (True) or disabled (False).

:type mfa_delete: bool
:param mfa_delete: A boolean indicating whether the Multi-Factor
           Authentication Delete feature is enabled (True)
           or disabled (False).  If mfa_delete is enabled
           then all Delete operations will require the
           token from your MFA device to be passed in
           the request.

:type mfa_token: tuple or list of strings
:param mfa_token: A tuple or list consisting of the serial number
          from the MFA device and the current value of
          the six-digit token associated with the device.
          This value is required when you are changing
          the status of the MfaDelete property of
          the bucket.

Definition at line 672 of file bucket.py.

                                                          :
        """
        Configure versioning for this bucket.
        Note: This feature is currently in beta release and is available
              only in the Northern California region.

        :type versioning: bool
        :param versioning: A boolean indicating whether version is
                           enabled (True) or disabled (False).

        :type mfa_delete: bool
        :param mfa_delete: A boolean indicating whether the Multi-Factor
                           Authentication Delete feature is enabled (True)
                           or disabled (False).  If mfa_delete is enabled
                           then all Delete operations will require the
                           token from your MFA device to be passed in
                           the request.

        :type mfa_token: tuple or list of strings
        :param mfa_token: A tuple or list consisting of the serial number
                          from the MFA device and the current value of
                          the six-digit token associated with the device.
                          This value is required when you are changing
                          the status of the MfaDelete property of
                          the bucket.
        """
        if versioning:
            ver = 'Enabled'
        else:
            ver = 'Suspended'
        if mfa_delete:
            mfa = 'Enabled'
        else:
            mfa = 'Disabled'
        body = self.VersioningBody % (ver, mfa)
        if mfa_token:
            if not headers:
                headers = {}
            headers['x-amz-mfa'] = ' '.join(mfa_token)
        response = self.connection.make_request('PUT', self.name, data=body,
                query_args='versioning', headers=headers)
        body = response.read()
        if response.status == 200:
            return True
        else:
            raise S3ResponseError(response.status, response.reason, body)
        

Generated by  Doxygen 1.6.0   Back to index