文档中心 > GetBucketLifecycle
GetBucketLifecycle

最近更新时间:2021-10-08

获取存储桶内的生命周期配置。


请求

请求语法

GET /?lifecycle HTTP/1.1
Host: examplebucket.region.unicloudsrv.com


响应

HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<GetBucketLifecycleConfigurationOutput>
  <Rule>
      <AbortIncompleteMultipartUpload>
          <DaysAfterInitiation>integer</DaysAfterInitiation>
      </AbortIncompleteMultipartUpload>
      <Expiration>
          <Date>timestamp</Date>
          <Days>integer</Days>
          <ExpiredObjectDeleteMarker>boolean</ExpiredObjectDeleteMarker>
      </Expiration>
      <Filter>
          <And>
              <Prefix>string</Prefix>
              <Tag>
              <Key>string</Key>
              <Value>string</Value>
              </Tag>
              ...
          </And>
          <Prefix>string</Prefix>
          <Tag>
              <Key>string</Key>
              <Value>string</Value>
          </Tag>
      </Filter>
      <ID>string</ID>
      <NoncurrentVersionExpiration>
          <NoncurrentDays>integer</NoncurrentDays>
      </NoncurrentVersionExpiration>
      <NoncurrentVersionTransition>
          <NoncurrentDays>integer</NoncurrentDays>
          <StorageClass>string</StorageClass>
      </NoncurrentVersionTransition>
      ...
      <Prefix>string</Prefix>
      <Status>string</Status>
      <Transition>
          <Date>timestamp</Date>
          <Days>integer</Days>
          <StorageClass>string</StorageClass>
      </Transition>
      ...
  </Rule>
  ...
</GetBucketLifecycleConfigurationOutput>

响应元素

参数详情请参考“PutBucketLifecycle”。


示例

请求示例

GET /?lifecycle HTTP/1.1
Host: test.oss-cn-north-1.unicloudsrv.com
Date: Tue, 13 Dec 2011 19:14:42 GMT
Authorization: authorization string


返回示例

HTTP/1.1 200 OK

x-amz-id-2: 0FmFIWsh/PpBuzZ0JFRC55ZGVmQW4SHJ7xVDqKwhEdJmf3q63RtrvH8ZuxW1Bol5
x-amz-request-id: 0CF038E9BCF63097
Date: Tue, 13 Dec 2011 19:14:42 GMT
Server: los
Content-Length: 280

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
  <Rule>
      <ID>Archive and then delete rule</ID>
      <Status>Enabled</Status>
      <Transition>
              <Days>30</Days>
              <StorageClass>STANDARD_IA</StorageClass>
      </Transition>
      <Transition>
          <Days>365</Days>
          <StorageClass>GLACIER</StorageClass>
      </Transition>
          <Expiration>
          <Days>3650</Days>
          </Expiration>
  </Rule>
</LifecycleConfiguration>