This operation is not supported for directory buckets.
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 isenabled
, the bucket owner must use an authentication device to change the versioning state of the bucket.
The following operations are related toGetBucketVersioning
:
GET /?versioning HTTP/1.1Host:Bucket
.s3.amazonaws.comx-amz-expected-bucket-owner:ExpectedBucketOwner
The request uses the following URI parameters.
The name of the bucket for which to get the versioning information.
Required: Yes
The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code403 Forbidden
(access denied).
The request does not have a request body.
HTTP/1.1 200<?xml version="1.0" encoding="UTF-8"?><VersioningConfiguration> <Status>string</Status> <MfaDelete>string</MfaDelete></VersioningConfiguration>
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in XML format by the service.
Root level tag for the VersioningConfiguration parameters.
Required: Yes
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.
Type: String
Valid Values:Enabled | Disabled
The versioning state of the bucket.
Type: String
Valid Values:Enabled | Suspended
This example returns the versioning state ofamzn-s3-demo-bucket
.
GET /?versioning HTTP/1.1 Host:amzn-s3-demo-bucket.s3.<Region>.amazonaws.com Date: Wed, 12 Oct 2009 17:50:00 GMT Authorization: authorization string Content-Type: text/plain
There are three versioning states:
If you enabled versioning on a bucket, the response is:
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Status>Enabled</Status> </VersioningConfiguration>
If you suspended versioning on a bucket, the response is:
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Status>Suspended</Status> </VersioningConfiguration>
If you never enabled (or suspended) versioning on a bucket, the response is:
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"/>
For more information about using this API in one of the language-specific AWS SDKs, see the following: