Amazon Simple Storage Service
Developer Guide (API Version 2006-03-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Enabling Versioning

Objects stored in your bucket before you set the versioning state have a version ID of null. When you enable versioning the objects in your bucket do not change, as shown in the following figure.

What changes is how Amazon S3 handles the objects in future requests in that bucket.

To enable object versioning

  1. In a PUT Bucket request, include the versioning sub-resource.

  2. In the body of the request, use Enabled for the value of the Status request element.

Example Enabling Versioning

The following request enables versioning on the bucket, bucketName.

PUT /?versioning HTTP/1.1
Host: bucketName.s3.amazonaws.com
Date: Wed, 12 Oct 2009 17:50:00 GMT
Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE=
Content-Type: text/plain
Content-Length: 124
			
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Status>Enabled</Status>
</VersioningConfiguration>