GET Bucket versioning
Description
This implementation of the GET
operation uses the versioning
sub-resource to return 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, i.e.,
if the MFA Delete status is enabled
, the bucket owner must use an
authentication device to change the versioning state of the bucket.
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/"/>
Requests
Syntax
GET /?versioning HTTP/1.1 Host:BucketName
.s3.amazonaws.com Content-Length:length
Date:date
Authorization:signatureValue
Request Parameters
This implementation of the operation does not use request parameters.
Request Headers
This implementation of the operation only uses request headers common to all operations. For more information, see
Request Elements
This implementation of the operation does not use request elements.
Responses
Response Headers
This implementation of the operation uses only response headers that are common to most responses. For more information, see Common Response Headers.
Response Elements
This implementation of GET
returns the following response
elements.
Name | Description |
---|---|
MfaDelete
|
Specifies whether MFA delete is enabled in the bucket versioning configuration Type: Enum Valid Values: Disabled | Enabled Ancestor: VersioningConfiguration |
Status
|
The versioning state of the bucket. Type: Enum Valid Values: Suspended | Enabled Ancestor: VersioningConfiguration |
VersioningConfiguration
|
Container for the Type: Container Ancestor: None |
Special Errors
This implementation of the operation does not return special errors. For general information about Amazon S3 errors and a list of error codes, see Error Responses.
Examples
Sample Request
This example returns the versioning state of myBucket
.
GET /?versioning HTTP/1.1 Host: myBucket.s3.amazonaws.com Date: Wed, 12 Oct 2009 17:50:00 GMT Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE= Content-Type: text/plain
Sample Response
The following is a sample of the response body (only) that shows bucket versioning is enabled.
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Status>Enabled</Status> </VersioningConfiguration>