Skip to main content

GetBucketVersioning

GetBucketVersioning returns a bucket's versioning state - whether overwriting or deleting an object keeps the earlier versions. Every STRG bucket is versioned from the moment it is created and stays that way, so the answer is always Enabled and there is nothing to set up first. PutBucketVersioning is its counterpart.

Good to know on STRG
  • Status is always Enabled, for a bucket that was never configured too. It is never Suspended and never absent, so a client always gets the same clear answer.
  • MfaDelete is never part of the answer: STRG has no MFA delete.
  • x-amz-expected-bucket-owner is welcome and has nothing to check.

Because every bucket keeps every version, overwriting or deleting an object leaves its earlier versions in place: a delete writes a delete marker, and every version stays billed as stored data until it is permanently deleted or a lifecycle policy removes it.

When you'd use it​

  • Backup tools often check that a bucket is versioned before they write to it, since versioning is what lets a backup be rolled back. STRG answers Enabled, so they carry on as usual.
  • Infrastructure-as-code tools read a bucket's versioning state to compare it with the configuration they manage. With versioning described as Enabled, the bucket matches from the start.
  • An agent about to overwrite a file in a bucket can call GetBucketVersioning to confirm the previous version stays recoverable, and tell the person it is working for so.

Request​

GET /?versioning HTTP/1.1
Host: my-bucket.s3.eu-central-1.strg.com
Authorization: AWS4-HMAC-SHA256 Credential=...
x-amz-date: 20260926T120000Z
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Path-style, the same request is GET /my-bucket?versioning on s3.eu-central-1.strg.com. Addressing describes both styles.

Permissions​

The access key needs Read bucket settings (buckets:read-config). Every access key holds it: the dashboard shows it among the permissions always included in a key, rather than as a choice. A key limited to certain buckets reaches only those buckets. Access keys has the details.

URI parameters​

NameTypeRequiredDescription
BucketStringYesThe bucket whose versioning state is read.
versioningFlagYesSelects the versioning subresource. Sent without a value.

Any other query parameter is answered 501 NotImplemented, so a client knows straight away that it has no effect here.

Request headers​

NameTypeRequiredDescription
x-amz-expected-bucket-ownerStringNoWelcome, and has nothing to check: an access key only ever reaches its own account's buckets.

Request body​

None.

Response​

A successful request answers 200 OK with the versioning configuration as XML.

Response headers​

NameDescription
x-amz-request-idThe request ID, for support requests.

Response body​

The configuration is short, and its elements are these.

ElementTypeDescription
VersioningConfigurationContainerThe root element.
StatusStringAlways Enabled.
MfaDeleteStringNever returned: STRG has no MFA delete.
<?xml version="1.0" encoding="UTF-8"?>
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Status>Enabled</Status>
</VersioningConfiguration>

Errors​

These are the errors this operation can answer, and the situation behind each.

CodeHTTP statusWhen
NoSuchBucket404The bucket does not exist, it is in a region other than the endpoint's, or your account has no storage in this endpoint's region yet.
AccessDenied403The access key is limited to buckets that do not include this one, or your account is not active.
InvalidAccessKeyId403The access key does not exist, has expired or been revoked, or was created so recently that it is not yet usable in this endpoint's region - a moment later it is.
SignatureDoesNotMatch403The request signature is wrong.
RequestTimeTooSkewed403The request time is more than 15 minutes from the server's.
AuthorizationHeaderMalformed400The signature's credential scope names a region other than the endpoint's.
NotImplemented501The request carries a query parameter this operation does not accept.
SlowDown503Too many requests at once; a retry after the Retry-After interval goes through.
ServiceUnavailable503A temporary failure; a retry usually succeeds.

Differences from Amazon S3​

A few things work a little differently on STRG, each listed here with what it means for your requests.

AspectAmazon S3STRG
New bucketUnversioned: Status is absent until versioning is first enabledVersioned from creation: Status is Enabled straight away, with nothing to turn on
SuspendedReturned after versioning is suspendedNever returned: versioning stays on for good - PutBucketVersioning has the details
MfaDeleteReturned if the bucket was ever configured with MFA deleteNever returned: STRG has no MFA delete
PermissionBucket owner onlyAny access key that reaches the bucket
Bucket in another region301 redirect with x-amz-bucket-region404 NoSuchBucket, also from a region where your account stores nothing yet. Each bucket answers on its own regional endpoint
x-amz-expected-bucket-ownerChecked against the bucket ownerWelcome, with nothing to check: a key only ever reaches buckets of its own account

Examples​

Each example reads the versioning state of my-bucket; the SDK examples print its status.

aws s3api get-bucket-versioning \
--bucket my-bucket \
--endpoint-url https://s3.eu-central-1.strg.com \
--region eu-central-1
View as Markdown