GetBucketVersioning
Returns the versioning state of a bucket.
To retrieve the versioning state of a bucket, you must be the bucket owner.
The following operations are related to GetBucketVersioning
:
Request Syntax
GET /Bucket?versioning HTTP/1.1
Host: <partition>.s3.astran.io
URI Request Parameters
The request uses the following URI parameters.
The name of the bucket for which to get the versioning information.
Required: Yes
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>
</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.
Root level tag for the VersioningConfiguration parameters.
Required: Yes
The versioning state of the bucket.
Type: String
Valid Values: Enabled
| Suspended
Examples
This example returns the versioning state of mybucket
.
GET /mybucket?versioning HTTP/1.1
Host: <partition>.s3.astran.io
Date: Mon, 25 Sep 2024 09:09:17 GMT
Authorization: authorization string
There are three versioning states:
If you enabled versioning on a bucket, the response is:
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Status>Enabled</Status>
</VersioningConfiguration>
If you suspended versioning on a bucket, the response is:
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Status>Suspended</Status>
</VersioningConfiguration>
If you never enabled (or suspended) versioning on a bucket, the response is:
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"/>
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: