S3.Client.
get_bucket_versioning
(**kwargs)¶Returns the versioning state of a bucket.
To retrieve the versioning state of a bucket, you must be the bucket owner.
This implementation also returns the MFA Delete status of the versioning state. If the MFA Delete status is enabled
, the bucket owner must use an authentication device to change the versioning state of the bucket.
The following operations are related to GetBucketVersioning
:
See also: AWS API Documentation
Request Syntax
response = client.get_bucket_versioning(
Bucket='string',
ExpectedBucketOwner='string'
)
[REQUIRED]
The name of the bucket for which to get the versioning information.
403 Forbidden
(access denied).dict
Response Syntax
{
'Status': 'Enabled'|'Suspended',
'MFADelete': 'Enabled'|'Disabled'
}
Response Structure
(dict) --
Status (string) --
The versioning state of the bucket.
MFADelete (string) --
Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is only returned if the bucket has been configured with MFA delete. If the bucket has never been so configured, this element is not returned.
Examples
The following example retrieves bucket versioning configuration.
response = client.get_bucket_versioning(
Bucket='examplebucket',
)
print(response)
Expected Output:
{
'MFADelete': 'Disabled',
'Status': 'Enabled',
'ResponseMetadata': {
'...': '...',
},
}