Skip to main content

GetBucketVersioning

Returns the versioning state of a bucket.

Description​

The GetBucketVersioning operation returns the versioning state of a bucket. To retrieve the versioning state of a bucket, you must be the bucket owner.

A bucket's versioning state can be one of the following:

  • Enabled - Versioning is enabled for the bucket
  • Suspended - Versioning was previously enabled but is currently suspended
  • Unversioned - Versioning has never been enabled on the bucket

For more information about versioning, see Object Versioning.

note
  • To use this operation, you must have permission to perform the s3:GetBucketVersioning action.
  • You must be the bucket owner to use this operation.
  • The return format is XML

Request Syntax​

GET /?versioning HTTP/1.1
Host: BucketName.qstorage.quilibrium.com
x-amz-expected-bucket-owner: OwnerAccountId
Values in italics indicate user input and should be replaced with actual values.

This operation does not have a request body.

Request Parameters​

Headers​

NameDescriptionRequiredType
x-amz-expected-bucket-ownerThe account ID of the expected bucket ownerNotext

Examples​

Example 1: Get bucket versioning when versioning is enabled​

GET /?versioning HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
<?xml version="1.0" encoding="UTF-8"?> <VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Status>Enabled</Status> </VersioningConfiguration>
Values in italics indicate variable response values.

Example 2: Get bucket versioning when versioning is suspended​

GET /?versioning HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
<?xml version="1.0" encoding="UTF-8"?> <VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Status>Suspended</Status> </VersioningConfiguration>
Values in italics indicate variable response values.

Response Syntax​

HTTP/1.1 200 OK
x-amz-id-2: RequestId
x-amz-request-id: AmazonRequestId
Date: ISO8601Date
<?xml version="1.0" encoding="UTF-8"?> <VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Status>Status</Status> <MFADelete>MFADeleteStatus</MFADelete> </VersioningConfiguration>
Values in italics indicate variable response values.

Response Elements​

Response Headers​

NameDescriptionRequiredType
x-amz-id-2An identifier for the requestNoString
x-amz-request-idA unique identifier for the requestNoString
DateThe date and time at which the response was sentNoString

Response Body Elements​

NameDescriptionRequiredType
VersioningConfigurationContainer for versioning configuration. See VersioningConfiguration for details.NoString
StatusThe versioning state of the bucket.

Valid values: Enabled | Suspended
NoString
MFADeleteSpecifies whether MFA delete is enabled in the bucket versioning configuration.

Valid values: Enabled | Disabled.

This element is only returned if the bucket has been configured with MFA delete.
NoString

Special Errors​

Error CodeDescription
NoSuchBucketThe specified bucket does not exist
403Forbidden. Authentication failed or you do not have permission to get the bucket versioning configuration

Permissions​

You must have the s3:GetBucketVersioning permission.

Try It Out​

Test GetBucketVersioning

Get the versioning state of a bucket.

Coming Soon

This feature is currently under development and will be available soon.