PutBucketLifecycleConfiguration

Creates a new lifecycle configuration for the bucket, or replaces an existing lifecycle configuration.

Rules

Specify the lifecycle configuration in your request body. The lifecycle configuration is specified as XML consisting of one or more rules. Each rule consists of the following:

  • Filter identifying a subset of objects to which the rule applies. The filter is based on a key name prefix.

  • Status – whether the rule is in effect.

You must have Full ACL to be able to call this action.

The following operations are related to PutBucketLifecycleConfiguration:

Request Syntax

 1PUT /?lifecycle HTTP/1.1
 2Host: <BUCKET>.s3.tebi.io
 3
 4<?xml version="1.0" encoding="UTF-8"?>
 5<LifecycleConfiguration>
 6    <Rule>
 7        <Prefix>string</Prefix>
 8        <Status>string</Status>
 9        <AbortIncompleteMultipartUpload>
10            <DaysAfterInitiation>integer</DaysAfterInitiation>
11        </AbortIncompleteMultipartUpload>
12        <Expiration>
13            <Days>integer</Days>
14        </Expiration>
15        <Filter>
16            <Prefix>string</Prefix>
17        </Filter>
18        <ID>string</ID>
19    </Rule>
20    ...
21</LifecycleConfiguration>

The request uses the following URI parameters:

  • <BUCKET>: Name of the bucket for which to set the configuration. Required.

The request accepts the following data in XML format:

  • LifecycleConfiguration: Root level tag for the LifecycleConfiguration parameters.

  • Rule: Container for a lifecycle rule.

Response Syntax

1HTTP/1.1 200
2Content-Length: 0

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

See Also

Refer here for more information.