GetBucketLifecycle

Last update:2022-03-01 18:22:23

The interface is used to get lifecycle of the bucket.IAM wos:GetBucketLifecycle permission is required.

Request syntax

GET /?lifecycle HTTP/1.1
Host: Bucket.Endpoint
Date: date
Authorization: authorization string

URI request parameters

None

Request header

Please use Common Request Headers .

Request body

None.

Response syntax

HTTP/1.1 200 OK
x-wos-request-id:
Date:
Server: WCS-Web-Server
Content-Length: 358
 
<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration xmlns=" https://www.wangsu.com/document "
<Rule>
<ID>id</ID>
<Filter>
<Prefix> </Prefix>
</Filter>
<Status>Enabled</Status>
<Expiration>
<Days>365</Days>
</Expiration>
<Transition>
  <Days>30</Days>
  <StorageClass>IA</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>

Response header

Please use Common Response Headers .

Response body

Field name Description
LifecycleConfiguration Define a list of lifecycle configurations.
Type: XML
Child node: Rule
Parent node: empty
Rule Define a specific lifecycle configuration.
Type: XML
Parent node: LifecycleConfigurationChild node: Filter
ID Define a unique ID for each rule.
Type: String
Parent node: Rule
Filter Defines a subset of objects that conform to lifecycle rules.The filter is only able to filt objects by prefix. If filter is not defined () then the lifecycle rule will be applied to all objects in the bucket.
Type: XML
Child node: Prefix
Parent node: Rule
Prefix Defines the rule for the filter. This life cycle configuration will take effect only for objects that match this prefix in the bucket.
Type: String
Parent node: Filter
Status Lifecycle configuration status. Enable indicating that the configuration doesn’t take effect.
Type: String
Parent node: Rule
Expiration Defines the expiration time for objects which match the filter rule.
Type: XML
Child node: Days|Date
Parent node: Rule
Days Define the relative expiration days of the object. For example, the value is 13 indicating that the object will expire after 13 days from the last modification time.
Type: Positive integer
Parent node: Expiration

Example

GET /?lifecycle HTTP/1.1
Host: bucket.s3-cn-east-1.wcsapi.com
x-wos-date: Thu, 15 Nov 2016 00:17:21 GMT
Authorization: signatureValue

HTTP/1.1 200 OK
x-wos-request-id: 51991C342C575321
Date: Thu, 15 Nov 2016 00:17:23 GMT
Server: WCS-Web-Serve
Content-Length: 358
<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration xmlns=" https://www.wangsu.com/document ">
<Rule>
<ID>Archive and then delete rule</ID>
<Filter>
    <Prefix>projectdocs/</Prefix>
</Filter>
<Status>Enabled</Status>
<Expiration>
    <Days>365</Days>
</Expiration>
<Transition>
  <Days>30</Days>
  <StorageClass>IA</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!