Baidu AI Cloud
中国站

百度智能云

Object Storage

Get Lifecycle Management Rules of Bucket

Interface Description

This interface is used to get the defined lifecycle management rule details.

Considerations

  • If the requested source bucket does not exist, this interface returns “Error 404: NoSuchBucket”.
  • If the requested source bucket is not configured with the lifecycle, this interface returns “Error 404: NoLifecycleConfiguration”.

Request URI

GET /v1/{bucketName}/?lifecycle

Parameter Name Parameter Type Required Description Example Value Parameter Position
bucketName String Yes Bucket name "bucketName_example" Path

Request Body Parameters

Instructions for Data Structure of Request Body Field

Response Body Parameters

Description of Data Structure for Response Body Field

Parameter Name Parameter Type Description Example Value
rule List List of all rules

Description of Data Structure for Rule Field

Parameter Name Parameter type Description Example value
id String Rule ID sample-rule-abort-multiupload-prefix
status String Rule status enabled
resource List For which resources the rule is effective?
condition Condition Rule dependent conditions
action Action Action performed on the resource

Description of Data Structure for Condition Field

Parameter Name Parameter Type Description Example Value
time Time Time constraint

Description of Data Structure for Time Field

Parameter Name Parameter type Description Example value
dateGreaterThan String Time relation description $(lastModified)+P7D

Instructions for Data Structure of Action Field

Parameter Name Parameter Type Description Example Value
name String AbortMultipartUpload
storageClass String STANDARD_IA

Request Example

GET /v1/bucketName_example/?lifecycle
Common Request Header


{ }

Response Example

HTTP/1.1 200 OK
<Common response header>

{
  "rule" : [ {
    "condition" : {
      "time" : {
        "dateGreaterThan" : "$(lastModified)+P7D"
      }
    },
    "resource" : [ "bucket/prefix/*", "bucket/prefix/*" ],
    "action" : {
      "storageClass" : "STANDARD_IA",
      "name" : "AbortMultipartUpload"
    },
    "id" : "sample-rule-abort-multiupload-prefix",
    "status" : "enabled"
  }, {
    "condition" : {
      "time" : {
        "dateGreaterThan" : "$(lastModified)+P7D"
      }
    },
    "resource" : [ "bucket/prefix/*", "bucket/prefix/*" ],
    "action" : {
      "storageClass" : "STANDARD_IA",
      "name" : "AbortMultipartUpload"
    },
    "id" : "sample-rule-abort-multiupload-prefix",
    "status" : "enabled"
  } ]
}

Error Code

Refer to the universal error code.

Previous
Delete Lifecycle Management Rules of Bucket
Next
Set Lifecycle of Bucket