GetBucketVersioning

Returns the versioning state of a bucket

To retrieve the versioning state of a bucket, you must be the bucket owner.

Request Syntax

GET /?versioning HTTP/1.1
Host: Bucket.s3.petabox.io
x-amz-expected-bucket-owner: ExpectedBucketOwner

URI Request Parameters

The request uses the following URI parameters.

Bucket

The name of the bucket for which to get the versioning information.

Required: Yes

x-amz-expected-bucket-owner

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<VersioningConfiguration>
   <Status>string</Status>
   <MfaDelete>string</MfaDelete>
</VersioningConfiguration>

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in XML format by the service.

VersioningConfiguration

Root level tag for the VersioningConfiguration parameters.

Required: Yes

Status

The versioning state of the bucket.

Type: String

Valid Values: Enabled | Suspended

Examples

Example

This example returns the versioning state of myBucket.

GET /?versioning HTTP/1.1
Host: myBucket.s3.<Region>.petabox.io
Date: Wed, 12 Oct 2009 17:50:00 GMT
Authorization: authorization string
Content-Type: text/plain       

Example

There are three versioning states:

If you enabled versioning on a bucket, the response is:

<VersioningConfiguration xmlns="http://s3.petabox.io/doc/2006-03-01/">
   <Status>Enabled</Status>
</VersioningConfiguration>  

Example

If you suspended versioning on a bucket, the response is:

<VersioningConfiguration xmlns="http://s3.petabox.io/doc/2006-03-01/">
   <Status>Suspended</Status>
</VersioningConfiguration>    

Example

If you never enabled (or suspended) versioning on a bucket, the response is:

<VersioningConfiguration xmlns="http://s3.petabox.io/doc/2006-03-01/"/>    

Last updated