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

def s3ql::backends::boto::s3::key::Key::copy (   self,
  dst_bucket,
  dst_key,
  metadata = None,
  reduced_redundancy = False,
  preserve_acl = False 
)
Copy this Key to another bucket.

:type dst_bucket: string
:param dst_bucket: The name of the destination bucket

:type dst_key: string
:param dst_key: The name of the destination key

:type metadata: dict
:param metadata: Metadata to be associated with new key.
         If metadata is supplied, it will replace the
         metadata of the source key being copied.
         If no metadata is supplied, the source key's
         metadata will be copied to the new key.

:type reduced_redundancy: bool
:param reduced_redundancy: If True, this will force the storage
                   class of the new Key to be
                   REDUCED_REDUNDANCY regardless of the
                   storage class of the key being copied.
                   The Reduced Redundancy Storage (RRS)
                   feature of S3, provides lower
                   redundancy at lower storage cost.

:type preserve_acl: bool
:param preserve_acl: If True, the ACL from the source key
             will be copied to the destination
             key.  If False, the destination key
             will have the default ACL.
             Note that preserving the ACL in the
             new key object will require two
             additional API calls to S3, one to
             retrieve the current ACL and one to
             set that ACL on the new object.  If
             you don't care about the ACL, a value
             of False will be significantly more
             efficient.

:rtype: :class:`boto.s3.key.Key` or subclass
:returns: An instance of the newly created key object

Definition at line 211 of file key.py.

                                                          :
        """
        Copy this Key to another bucket.

        :type dst_bucket: string
        :param dst_bucket: The name of the destination bucket

        :type dst_key: string
        :param dst_key: The name of the destination key
        
        :type metadata: dict
        :param metadata: Metadata to be associated with new key.
                         If metadata is supplied, it will replace the
                         metadata of the source key being copied.
                         If no metadata is supplied, the source key's
                         metadata will be copied to the new key.

        :type reduced_redundancy: bool
        :param reduced_redundancy: If True, this will force the storage
                                   class of the new Key to be
                                   REDUCED_REDUNDANCY regardless of the
                                   storage class of the key being copied.
                                   The Reduced Redundancy Storage (RRS)
                                   feature of S3, provides lower
                                   redundancy at lower storage cost.

        :type preserve_acl: bool
        :param preserve_acl: If True, the ACL from the source key
                             will be copied to the destination
                             key.  If False, the destination key
                             will have the default ACL.
                             Note that preserving the ACL in the
                             new key object will require two
                             additional API calls to S3, one to
                             retrieve the current ACL and one to
                             set that ACL on the new object.  If
                             you don't care about the ACL, a value
                             of False will be significantly more
                             efficient.

        :rtype: :class:`boto.s3.key.Key` or subclass
        :returns: An instance of the newly created key object
        """
        dst_bucket = self.bucket.connection.lookup(dst_bucket)
        if reduced_redundancy:
            storage_class = 'REDUCED_REDUNDANCY'
        else:
            storage_class = self.storage_class
        return dst_bucket.copy_key(dst_key, self.bucket.name,
                                   self.name, metadata,
                                   storage_class=storage_class,
                                   preserve_acl=preserve_acl)


Generated by  Doxygen 1.6.0   Back to index