def delete_key(self, key_name, headers=None, version_id=None,
mfa_token=None):
"""
Deletes a key from the bucket. If a version_id is provided,
only that version of the key will be deleted.
:type key_name: string
:param key_name: The key name to delete
:type version_id: string
:param version_id: The version ID (optional)
: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 anytime you are deleting versioned objects from a
bucket that has the MFADelete option on the bucket.
:rtype: :class:`boto.s3.key.Key` or subclass
:returns: A key object holding information on what was
deleted. The Caller can see if a delete_marker was
created or removed and what version_id the delete created
or removed.
"""
if not key_name:
raise ValueError('Empty key names are not allowed')
return self._delete_key_internal(key_name, headers=headers,
version_id=version_id,
mfa_token=mfa_token,
query_args_l=None)
评论列表
文章目录