Skip to main content

GetBucketLifecycle

Deprecated

For an updated version of this API, see GetBucketLifecycleConfiguration. If you configured a bucket lifecycle using the filter element, you should use the updated version. This topic is provided for backward compatibility.

Returns the lifecycle configuration information set on the bucket.

Description

The GetBucketLifecycle operation returns the lifecycle configuration information set on the bucket. To use this operation, you must have s3:GetLifecycleConfiguration permissions on the bucket, or be the bucket owner.

note
  • If the bucket doesn't have a lifecycle configuration, this operation returns an empty LifecycleConfiguration element.
  • This operation is not supported for directory buckets.

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

NameDescriptionRequiredType
x-amz-expected-bucket-ownerThe 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).Notext

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
<?xml version="1.0" encoding="UTF-8"?> <LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Rule> <ID>Archive and then delete rule</ID> <Prefix>projectdocs/</Prefix> <Status>Enabled</Status> <Transition> <Days>30</Days> <StorageClass>STANDARD_IA</StorageClass> </Transition> <Transition> <Days>365</Days> <StorageClass>GLACIER</StorageClass> </Transition> <Expiration> <Days>3650</Days> </Expiration> </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
<?xml version="1.0" encoding="UTF-8"?> <LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Rule> <AbortIncompleteMultipartUpload> <DaysAfterInitiation>integer</DaysAfterInitiation> </AbortIncompleteMultipartUpload> <Expiration> <Date>timestamp</Date> <Days>integer</Days> <ExpiredObjectDeleteMarker>boolean</ExpiredObjectDeleteMarker> </Expiration> <ID>string</ID> <NoncurrentVersionExpiration> <NewerNoncurrentVersions>integer</NewerNoncurrentVersions> <NoncurrentDays>integer</NoncurrentDays> </NoncurrentVersionExpiration> <NoncurrentVersionTransition> <NewerNoncurrentVersions>integer</NewerNoncurrentVersions> <NoncurrentDays>integer</NoncurrentDays> <StorageClass>string</StorageClass> </NoncurrentVersionTransition> <Prefix>string</Prefix> <Status>string</Status> <Transition> <Date>timestamp</Date> <Days>integer</Days> <StorageClass>string</StorageClass> </Transition> </Rule> </LifecycleConfiguration>
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
LifecycleConfigurationContainer for the bucket's lifecycle rulesYesContainer
RuleContainer for a lifecycle rule. The bucket can have zero or more lifecycle rules.YesRule

For details about the elements within the Rule type, see Rule. The response format follows the AWS S3 GetBucketLifecycle API specification.

Special Errors

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

Permissions

You must have the s3:GetLifecycleConfiguration permission.

Try It Out

Test GetBucketLifecycle

Get the lifecycle configuration of a bucket.

Coming Soon

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