S3 Get Lifecycle Configuration
    • Dark
      Light

    S3 Get Lifecycle Configuration

    • Dark
      Light

    Article summary

    GEThttps://s3.<your-region>.backblazeb2.com/<your-bucket-name>?lifecycle

    Returns the lifecycle configuration information set on a bucket. For information about lifecycle configuration, see Lifecycle Rules.

    AUTHORIZATION AWS Signature

    This request is using AWS Signature from collection Backblaze B2 Cloud Storage S3 Compatible API.

    URI REQUEST PARAMETERS

    Bucket

    Required.

    The name of the bucket for which to get the lifecycle information. The bucket must have versioning enabled.

    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).

    B2 COMPATIBILITY NOTES

    Backblaze B2 lifecycle rules are mapped to S3 lifecycle rules as follows:

    B2 Lifecycle Action

    S3 Lifecycle Action

    hide

    Expiration

    delete

    NoncurrentVersionExpiration

    daysFromStartingToCancelingUnfinishedLargeFiles

    AbortIncompleteMultipartUpload

    B2 lifecycle rules always remove orphan delete markers (delete markers with no remaining object versions). When retrieving lifecycle rules via this API, each B2 lifecycle rule with a "hide" action is returned as two S3 rules with the same prefix: one Expiration rule with Days specified, and one Expiration rule with ExpiredObjectDeleteMarker set to true.

    Example Response

    200 OK

    HTTP/1.1 200
    <?xml version="1.0" encoding="UTF-8"?>
    <LifecycleConfiguration>
       <Rule>
          <ID>string</ID>
          <Filter>
             <Prefix>string</Prefix>
          </Filter>
          <Status>Enabled</Status>
          <Expiration>
             <Days>integer</Days>
          </Expiration>
       </Rule>
       <Rule>
          <ID>string</ID>
          <Filter>
             <Prefix>string</Prefix>
          </Filter>
          <Status>Enabled</Status>
          <Expiration>
             <ExpiredObjectDeleteMarker>true</ExpiredObjectDeleteMarker>
          </Expiration>
       </Rule>
       <Rule>
          <ID>string</ID>
          <Filter>
             <Prefix>string</Prefix>
          </Filter>
          <Status>Enabled</Status>
          <NoncurrentVersionExpiration>
             <NoncurrentDays>integer</NoncurrentDays>
          </NoncurrentVersionExpiration>
       </Rule>
       <Rule>
          <ID>string</ID>
          <Filter>
             <Prefix>string</Prefix>
          </Filter>
          <Status>Enabled</Status>
          <AbortIncompleteMultipartUpload>
             <DaysAfterInitiation>integer</DaysAfterInitiation>
          </AbortIncompleteMultipartUpload>
       </Rule>
    </LifecycleConfiguration>


    404 Not Found

    HTTP/1.1 404 Not Found
    <?xml version="1.0" encoding="UTF-8"?>
    <Error>
       <Code>NoSuchLifecycleConfiguration</Code>
       <Message>The lifecycle configuration does not exist.</Message>
    </Error>



    Was this article helpful?