Get Lifecycle Management Rules for a Bucket
Updated at:2025-11-03
API description
This API retrieves detailed information about configured lifecycle management rules.
Notes
- If the source bucket specified in the request does not exist, a 404 error will be returned with the code "NoSuchBucket.\
- If the requested source bucket lacks a lifecycle configuration, a 404 error with the code NoLifecycleConfiguration will be returned.
Request URI
GET /v1/{bucketName}/?lifecycle
| Parameter name | Parameter type | Required or not | Description | Example value | Parameter location |
|---|---|---|---|---|---|
| bucketName | String | Yes | Bucket name | "bucketName_example" | Path |
Parameters of request body
Description of the data structure of request body fields
Response body parameters
Description of the data structure of response body fields
| Parameter name | Parameter type | Description | Example value |
|---|---|---|---|
| rule | List |
List of all rules |
Description of Rule field data structure
| Parameter name | Parameter type | Description | Example value |
|---|---|---|---|
| id | String | Rule identifier | sample-rule-abort-multiupload-prefix |
| status | String | Status of the rule. | enabled |
| resource | List |
The resources to which the rules will apply. | |
| condition | Condition | The conditions on which the rule depends. | |
| action | Action | Actions executed on the specified resource. |
Description of Condition field data structure
| Parameter name | Parameter type | Description | Example value |
|---|---|---|---|
| time | Time | Time-related constraints. |
Description of Time field data structure
| Parameter name | Parameter type | Description | Example value |
|---|---|---|---|
| dateGreaterThan | String | Describe relationships related to time. | $(lastModified)+P7D |
Description of Action field data structure
| Parameter name | Parameter type | Description | Example value |
|---|---|---|---|
| name | String | AbortMultipartUpload | |
| storageClass | String | STANDARD_IA |
Request example
JSON
1GET /v1/bucketName_example/?lifecycle
2 <Common request headers>
3{ }
Response example
JSON
1HTTP/1.1 200 OK
2 <Common response headers>
3{
4 "rule" : [ {
5 "condition" : {
6 "time" : {
7 "dateGreaterThan" : "$(lastModified)+P7D"
8 }
9 },
10 "resource" : [ "bucket/prefix/*", "bucket/prefix/*" ],
11 "action" : {
12 "storageClass" : "STANDARD_IA",
13 "name" : "AbortMultipartUpload"
14 },
15 "id" : "sample-rule-abort-multiupload-prefix",
16 "status" : "enabled"
17 }, {
18 "condition" : {
19 "time" : {
20 "dateGreaterThan" : "$(lastModified)+P7D"
21 }
22 },
23 "resource" : [ "bucket/prefix/*", "bucket/prefix/*" ],
24 "action" : {
25 "storageClass" : "STANDARD_IA",
26 "name" : "AbortMultipartUpload"
27 },
28 "id" : "sample-rule-abort-multiupload-prefix",
29 "status" : "enabled"
30 } ]
31}
Error code
Please refer to the general error codes
