Amazon Simple Storage Service
API Reference (API Version 2006-03-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

GET Bucket versioning

Description

This implementation of the GET operation uses the versioning subresource 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: authorization string (see Authenticating Requests (AWS Signature Version 4))

Request Parameters

This implementation of the operation does not use request parameters.

Request Headers

This implementation of the operation uses only request headers that are common to all operations. For more information, see Common Request Headers.

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. This element is only returned if the bucket has been configured with MfaDelete. If the bucket has never been so configured, this element is not returned.

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 Status response element.

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: authorization string
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>