Petabox
  • Introduction
  • Petabox FAQ
  • Concepts
    • Bucket versioning
    • Logging actions with a bucket
    • Object Lock
  • Tools
    • Supported tools
      • CyberDuck S3 Client
      • Mountain Duck
      • S3 Browser
      • RClone
      • AWS CLI Console client
      • SDKs for different languages
        • JavaScript SDK
        • AWS SDK for Java
        • Python SDK (boto)
  • S3 Compatible API
    • How to use the API
    • Signing Requests
    • API Reference
      • Bucket
        • HeadBucket
        • ListObjects/ListObjectsV2
        • PutBucketVersioning
        • PutBucketLogging
        • ListBuckets
        • RenameBucket
        • GetBucketLocation
      • Object
        • PutObject
        • GetObject
        • HeadObject
        • RenameObject
        • PutObjectAcl
      • Multipart upload
        • General multipart upload order
        • CreateMultipartUpload
        • UploadPart
        • CompleteMultipartUpload
        • ListMultipartUploads
      • Analytics
        • GetStatistics
        • GetBandwidthAnalytics
        • GetStorageAnalytics
      • Common request headers
      • Common response headers
      • Responses
      • GetObjectTagging
      • GetObjectAcl
      • GetBucketAcl
      • ListObjectVersions
      • GetBucketRequestPayment
      • GetBucketReplication
      • GetBucketTagging
      • GetBucketLocation
      • GetBucketVersioning
      • GetBucketLifecycle
      • GetObjectLockConfiguration
      • PutObjectLockConfiguration
      • GetObjectRetention
      • GetObjectLegalHold
      • PutObjectRetention
      • PutObjectLegalHold
      • PutObjectAcl
      • PutBucketAcl
      • PutBucketVersioning
      • CopyObject
      • DeleteObjects
      • AbortMultipartUpload
      • DeleteObject
      • DeleteBucket
      • PutBucketTagging
      • PutObjectTagging
      • DeleteBucketTagging
      • DeleteObjectTagging
      • PutBucketLogging
      • GetBucketLogging
      • ListParts
      • UploadPartCopy
      • PutBucketPolicy
      • GetBucketPolicy
      • DeleteBucketPolicy
Powered by GitBook
On this page
  • Request Syntax
  • URI Request Parameters
  • Request Body
  • Response Syntax
  • Response Elements
  • Examples
  • Sample Request: Retrieve a lifecycle subresource
  • Sample Response
  1. S3 Compatible API
  2. API Reference

GetBucketLifecycle

Returns the lifecycle configuration information set on the bucket

To use this operation, you must have permission to perform the s3:GetLifecycleConfiguration action. The bucket owner has this permission by default. The bucket owner can grant this permission to others.

GetBucketLifecycle has the following special error:

  • Error code: NoSuchLifecycleConfiguration

    • Description: The lifecycle configuration does not exist.

    • HTTP Status Code: 404 Not Found

    • SOAP Fault Code Prefix: Client

Request Syntax

GET /?lifecycle HTTP/1.1
Host: Bucket.s3.petabox.io
x-amz-expected-bucket-owner: ExpectedBucketOwner

URI Request Parameters

The request uses the following URI parameters.

Bucket

The name of the bucket for which to get the lifecycle information.

Required: Yes

x-amz-expected-bucket-owner

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
   <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>

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.

LifecycleConfiguration

Root level tag for the LifecycleConfiguration parameters.

Required: Yes

Rule

Container for a lifecycle rule.

Type: Array of Rule data types

Examples

Sample Request: Retrieve a lifecycle subresource

This example is a GET request to retrieve the lifecycle subresource from the specified bucket, and an example response with the returned lifecycle configuration.

GET /?lifecycle HTTP/1.1
Host: examplebucket.s3.<Region>.petabox.io
x-amz-date: Thu, 15 Nov 2012 00:17:21 GMT
Authorization: signatureValue         

Sample Response

This example illustrates one usage of GetBucketLifecycle.

HTTP/1.1 200 OK
x-amz-id-2: ITnGT1y4RyTmXa3rPi4hklTXouTf0hccUjo0iCPjz6FnfIutBj3M7fPGlWO2SEWp
x-amz-request-id: 51991C342C575321
Date: Thu, 15 Nov 2012 00:17:23 GMT
Server: Petabox
Content-Length: 358

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration xmlns="http://s3.petabox.io/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>
PreviousGetBucketVersioningNextGetObjectLockConfiguration

Last updated 1 year ago