Bucket Operations¶
ListBuckets¶
Lists all buckets owned by the authenticated user.
Request:
Response:
<?xml version="1.0" encoding="UTF-8"?>
<ListAllMyBucketsResult>
<Owner>
<ID>user-id</ID>
<DisplayName>username</DisplayName>
</Owner>
<Buckets>
<Bucket>
<n>my-bucket</n>
<CreationDate>2024-01-01T00:00:00.000Z</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>
CreateBucket¶
Creates a new bucket.
Request:
With region:
<CreateBucketConfiguration>
<LocationConstraint>eu-west-1</LocationConstraint>
</CreateBucketConfiguration>
Response: 200 OK
DeleteBucket¶
Deletes an empty bucket.
Request:
Response: 204 No Content
Warning
Bucket must be empty. Delete all objects first.
HeadBucket¶
Checks if a bucket exists and you have access.
Request:
Response: 200 OK or 404 Not Found
GetBucketLocation¶
Returns the region of a bucket.
Request:
Response:
GetBucketVersioning¶
Gets versioning state.
Request:
Response:
PutBucketVersioning¶
Enables or suspends versioning.
Request:
PUT /my-bucket?versioning HTTP/1.1
<VersioningConfiguration>
<Status>Enabled</Status>
</VersioningConfiguration>
GetBucketPolicy¶
Gets bucket policy.
Request:
Response: JSON policy document
PutBucketPolicy¶
Sets bucket policy.
Request: