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...

Determining the Versioning State

You can use the versioning sub-resource to retrieve the versioning state of a bucket.

To retrieve the versioning state of a bucket

  1. In the header of a GET Bucket request, include the versioning sub-resource.

    GET /?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
  2. In the response, check the value of the response element Status. There are three possible results:

    • If Versioning on a bucket is enabled, the response is:

      <VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
        <Status>Enabled</Status>
      </VersioningConfiguration>
    • If Versioning on a bucket is suspended, the response is:

      <VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
        <Status>Suspended</Status>
      </VersioningConfiguration>
    • If Versioning on a bucket has never been enabled, the response doesn't retrieve a status element:

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