GetBucketLifecycleConfiguration
Returns the lifecycle configuration information set on a bucket.
Description
The GetBucketLifecycleConfiguration
operation returns the lifecycle configuration information set on a bucket. Lifecycle configuration enables you to specify the lifecycle management of objects in a bucket. The configuration is a set of one or more rules, where each rule defines an action for QStorage to apply to a group of objects.
note
- To use this operation, you must have permission to perform the
s3:GetLifecycleConfiguration
action. - You must be the bucket owner to use this operation.
- If the bucket does not have a lifecycle configuration, QStorage returns a
NoSuchLifecycleConfiguration
error. - Bucket lifecycle configuration supports specifying a lifecycle rule using:
- Object key name prefix
- One or more object tags
- Object size
- Any combination of the above
Request Syntax
GET /?lifecycle 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
Name | Description | Required | Type |
---|---|---|---|
x-amz-expected-bucket-owner | The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied). | No | text |
Examples
Example 1: Get lifecycle configuration from a bucket
GET /?lifecycle 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
x-amz-transition-default-minimum-object-size: variesbystorage_class
<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ID>ExampleRule</ID>
<Filter>
<And>
<Prefix>logs/</Prefix>
<ObjectSizeGreaterThan>500</ObjectSizeGreaterThan>
<ObjectSizeLessThan>64000</ObjectSizeLessThan>
</And>
</Filter>
<Status>Enabled</Status>
<Expiration>
<Days>30</Days>
</Expiration>
<Transition>
<Days>90</Days>
<StorageClass>STANDARD_IA</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>
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
x-amz-transition-default-minimum-object-size: TransitionDefaultMinimumObjectSize
<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ID>RuleId</ID>
<Filter>
<And>
<Prefix>Prefix</Prefix>
<ObjectSizeGreaterThan>SizeGreaterThan</ObjectSizeGreaterThan>
<ObjectSizeLessThan>SizeLessThan</ObjectSizeLessThan>
<Tag>
<Key>TagKey</Key>
<Value>TagValue</Value>
</Tag>
</And>
</Filter>
<Status>Status</Status>
<Expiration>
<Days>Days</Days>
<ExpiredObjectDeleteMarker>Boolean</ExpiredObjectDeleteMarker>
</Expiration>
<Transition>
<Days>Days</Days>
<StorageClass>StorageClass</StorageClass>
</Transition>
<AbortIncompleteMultipartUpload>
<DaysAfterInitiation>Days</DaysAfterInitiation>
</AbortIncompleteMultipartUpload>
</Rule>
</LifecycleConfiguration>
Values in italics indicate variable response values.
Response Elements
Response Headers
Name | Description | Required | Type |
---|---|---|---|
x-amz-id-2 | An identifier for the request | No | String |
x-amz-request-id | A unique identifier for the request | No | String |
x-amz-transition-default-minimum-object-size | Indicates which default minimum object size behavior is applied to the lifecycle configuration. Valid values: varies_by_storage_class | all_storage_classes_128K | No | String |
Date | The date and time at which the response was sent | No | String |
Response Body Elements
Name | Description |
---|---|
LifecycleConfiguration | Root level tag for the LifecycleConfiguration parameters. |
Rule | Container for a lifecycle rule. See LifecycleRule for details. |
Special Errors
Error Code | Description |
---|---|
NoSuchBucket | The specified bucket does not exist |
NoSuchLifecycleConfiguration | The lifecycle configuration does not exist |
403 | Forbidden. Authentication failed or you do not have permission to get the lifecycle configuration |
Permissions
You must have the s3:GetLifecycleConfiguration
permission.
Try It Out
Test GetBucketLifecycleConfiguration
Get the lifecycle configuration of a bucket.
Coming Soon
This feature is currently under development and will be available soon.