对象存储BOS

    GetBucketLifecycle

    接口描述

    此接口用于获取定义的生命周期管理规则详细信息。

    请求(Request)

    • 请求语法

      GET /?lifecycle HTTP/1.1
      Host: <BucketName>.bj.bcebos.com
      Date: date
      Authorization: AuthorizationString
    • 请求头域

      无特殊参数

    • 请求参数

      无特殊参数

    响应(Response)

    • 响应元素

      无特殊元素

    • 响应头域

      无特殊头域

    注意事项

    • 如果请求的源Bucket不存在,返回404错误,错误码为NoSuchBucket。
    • 如果请求的源Bucket没有配置lifecycle,返回404错误,错误码为NoLifecycleConfiguration。

    示例

    • 请求示例

       GET /?lifecycle HTTP/1.1
       Host: bucket.bj.bcebos.com
       Date: Thu, 15 Sep 2016 00:16:26 GMT
       Authorization: AuthorizationString
    • 响应示例

           HTTP/1.1 200 OK
           Date: Thu, 15 Sep 2016 00:17:23 GMT
           Server: BceBos
           x-bce-request-id: 1a5fd81e-626b-45b3-a885-15fff9cd106c
           Connection: keep-alive
           Content-Length: 358
      
           {
               "rule": [
                   {
                       "id": "sample-rule-delete-prefix", 
                       "status": "enabled", 
                       "resource": [
                           "bucket/prefix/*"
                       ], 
                       "condition": {
                           "time": {
                               "dateGreaterThan": "2016-09-07T00:00:00Z"
                           }
                       }, 
                       "action": {
                           "name": "DeleteObject"
                       }
                   },
                   {
                       "id": "sample-rule-transition-prefix", 
                       "status": "enabled", 
                       "resource": [
                           "bucket/prefix/*"
                       ], 
                       "condition": {
                           "time": {
                               "dateGreaterThan": "$(lastModified)+P7D"
                           }
                       }, 
                       "action": {
                           "name": "Transition"
                           "storageClass": "STANDARD_IA"
                       }
                   },
                   {
                       "id": "sample-rule-abort-multiupload-prefix", 
                       "status": "enabled", 
                       "resource": [
                           "bucket/prefix/*"
                       ], 
                       "condition": {
                           "time": {
                               "dateGreaterThan": "$(lastModified)+P7D"
                           }
                       }, 
                       "action": {
                           "name": "AbortMultipartUpload"
                       }
                   }
               ]
           }  
    上一篇
    PutBucketLifecycle
    下一篇
    DeleteBucketLifecycle