forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
369 lines
32 KiB
HTML
369 lines
32 KiB
HTML
<a name="EN-US_TOPIC_0125560423"></a><a name="EN-US_TOPIC_0125560423"></a>
|
|
|
|
<h1 class="topictitle1">PUT Bucket lifecycle</h1>
|
|
<div id="body15767494"><p class="msonormal" id="EN-US_TOPIC_0125560423__p3989940">OBS supports periodic transition and deletion of objects in a bucket based on a specified rule. This is implemented in lifecycle configuration. After the bucket lifecycle is set, OBS automatically deletes objects at the time specified in this operation. This operation can be used to delete:</p>
|
|
<ul id="EN-US_TOPIC_0125560423__ul35909463"><li id="EN-US_TOPIC_0125560423__li7689721">Periodically uploaded files: Some periodically uploaded files need to be retained for only one week or one month.</li><li id="EN-US_TOPIC_0125560423__li2098632">Documents that are seldom accessed after a certain period of time. These documents may be archived for another period of time and be deleted then.</li><li id="EN-US_TOPIC_0125560423__li11556151335620">The minimum time for the transition of the bucket storage to Warm or to Cold can be configured. The value ranges from <strong id="EN-US_TOPIC_0125560423__b842352706193456">24</strong> to <strong id="EN-US_TOPIC_0125560423__b84235270619350">8640</strong>.</li></ul>
|
|
<p class="msonormal" id="EN-US_TOPIC_0125560423__p54749715">This operation is used to create or update the lifecycle configuration of a bucket.</p>
|
|
<p class="msonormal" id="EN-US_TOPIC_0125560423__p22985394">Only users granted the <strong id="EN-US_TOPIC_0125560423__b215161710217">s3:PutLifecycleConfiguration</strong> permission can create or update the bucket lifecycle configuration. By default, only the bucket owner can set the bucket lifecycle configuration. The bucket owner can allow other users to set the bucket lifecycle configuration by granting them the permission.</p>
|
|
<p class="msonormal" id="EN-US_TOPIC_0125560423__p49877601">The lifecycle configuration supports periodic deletion and transition of objects. If you want to prevent a user from deleting and transitioning objects, disable the following permissions:</p>
|
|
<ul id="EN-US_TOPIC_0125560423__ul46245228"><li id="EN-US_TOPIC_0125560423__li39177514">s3:DeleteObject</li><li id="EN-US_TOPIC_0125560423__li17053313">s3:DeleteObjectVersion</li><li id="EN-US_TOPIC_0125560423__li19262089">s3:PutLifecycleConfiguration</li></ul>
|
|
<p class="msonormal" id="EN-US_TOPIC_0125560423__p13553869">If you want to prevent a user configuring a bucket lifecycle, revoke the <strong id="EN-US_TOPIC_0125560423__b39141076">s3:PutLifecycleConfiguration</strong> permission from the user.</p>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section66482253"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560423__screen28055508151547">PUT /?lifecycle HTTP/1.1
|
|
User-Agent: user-agent
|
|
Host: bucketname.obs.example.com
|
|
Content-Length: length
|
|
Date: date
|
|
Authorization: authorization
|
|
Content-MD5: MD5
|
|
Expect: expect
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<LifecycleConfiguration>
|
|
<Rule>
|
|
<ID>id</ID>
|
|
<Prefix>prefix</Prefix>
|
|
<Status>status</Status>
|
|
<Expiration>
|
|
<Days>365</Days>
|
|
</Expiration>
|
|
<NoncurrentVersionExpiration>
|
|
<NoncurrentDays>365</NoncurrentDays>
|
|
</NoncurrentVersionExpiration>
|
|
<Transition>
|
|
<Days>30</Days>
|
|
<StorageClass>STANDARD_IA</StorageClass>
|
|
</Transition>
|
|
<Transition>
|
|
<Days>60</Days>
|
|
<StorageClass>GLACIER</StorageClass>
|
|
</Transition>
|
|
<NoncurrentVersionTransition>
|
|
<NoncurrentDays>30</NoncurrentDays>
|
|
<StorageClass>STANDARD_IA</StorageClass>
|
|
</NoncurrentVersionTransition>
|
|
<NoncurrentVersionTransition>
|
|
<NoncurrentDays>60</NoncurrentDays>
|
|
<StorageClass>GLACIER</StorageClass>
|
|
</NoncurrentVersionTransition>
|
|
<AbortIncompleteMultipartUpload>
|
|
<DaysAfterInitiation>10</DaysAfterInitiation>
|
|
</AbortIncompleteMultipartUpload>
|
|
</Rule>
|
|
</LifecycleConfiguration></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section61469371"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560423__p49871633">This request involves no parameters.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section16353430"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560423__p13070512">The request uses one header, as described in <a href="#EN-US_TOPIC_0125560423__table16725372">Table 1</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560423__table16725372"></a><a name="table16725372"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560423__table16725372" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request header</caption><thead align="left"><tr id="EN-US_TOPIC_0125560423__row2055005"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.10.3.2.4.1.1"><p id="EN-US_TOPIC_0125560423__p32237730">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.10.3.2.4.1.2"><p id="EN-US_TOPIC_0125560423__p61119323">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.10.3.2.4.1.3"><p id="EN-US_TOPIC_0125560423__p51718129">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560423__row28418891"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.10.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p20228817">Content-MD5</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.10.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p27921517">The MD5 digest string of the message body is calculated according to the RFC 1864 standard. That is, calculate the 128-bit binary array (the message header data encrypted with MD5) first, and then use Base 64 encoding to convert the binary data to a character string.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p49967061">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560423__p47050372">Example: n58IG6hfM7vqI4K0vnWpog==</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.10.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p52983808">Mandatory</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row45891858237"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.10.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p862519620235">x-amz-security-token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.10.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p3625168237">Header field used to identify the request of a federated user. When the federal authentication function is enabled, users sending such requests are identified as federated users.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p10625268232">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.10.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p9625186202320">Optional. This parameter must be carried in the request sent by federated users.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section12963143"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0125560423__p37599894">In this request, you need to specify the lifecycle configuration in the request body using the elements described in <a href="#EN-US_TOPIC_0125560423__table26371793">Table 2</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560423__table26371793"></a><a name="table26371793"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560423__table26371793" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request elements for lifecycle configuration</caption><thead align="left"><tr id="EN-US_TOPIC_0125560423__row175293"><th align="left" class="cellrowborder" valign="top" width="33.333333333333336%" id="mcps1.3.11.3.2.4.1.1"><p id="EN-US_TOPIC_0125560423__p14198754">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.333333333333336%" id="mcps1.3.11.3.2.4.1.2"><p id="EN-US_TOPIC_0125560423__p9248440">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.333333333333336%" id="mcps1.3.11.3.2.4.1.3"><p id="EN-US_TOPIC_0125560423__p10926182">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560423__row12605589"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p14419821">Date</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p26479335418">Indicates when the specified rule takes effect (applicable to the latest object version).</p>
|
|
<p id="EN-US_TOPIC_0125560423__p43066942">The date value must conform to ISO 8601 format. The time is always midnight UTC.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p52058165">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560423__p65870306">Ancestor: Expiration, Transition</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p33894570">Mandatory if the <strong id="EN-US_TOPIC_0125560423__b2295423126">Days</strong> parameter is absent.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row61105663"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p50611656">Days</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p5903470">Indicates the number of days after object creation when the specified rule takes effect.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p53131231">Type: Positive integer</p>
|
|
<p id="EN-US_TOPIC_0125560423__p8419032">Ancestor: Expiration, Transition</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p10852974">Mandatory if the <strong id="EN-US_TOPIC_0125560423__b528416411634">Date</strong> parameter is absent.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row109861831211"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p1273253835015">StorageClass</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p128511633219">Indicates the new storage class of the object.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p7851103314118">Type: <strong id="EN-US_TOPIC_0125560423__b98516331414">STANDARD_IA</strong> or <strong id="EN-US_TOPIC_0125560423__b785115331216">GLACIER</strong></p>
|
|
<p id="EN-US_TOPIC_0125560423__p138515331111">Ancestor: <strong id="EN-US_TOPIC_0125560423__b2085123316117">Transition, NoncurrentVersionTransition</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p1485113336115">Mandatory if <strong id="EN-US_TOPIC_0125560423__b168511333212">Transition</strong> or <strong id="EN-US_TOPIC_0125560423__b1885103312112">NoncurrentVersionTransition</strong> is present.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row1445819212128"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p128181506518">Transition</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p194647501519">Indicates the element of the transition time and new storage class (applicable to the latest version of the object) in the lifecycle configuration.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p94640503114">Type: XML</p>
|
|
<p id="EN-US_TOPIC_0125560423__p846465011119">Children: Date or Days, StorageClass</p>
|
|
<p id="EN-US_TOPIC_0125560423__p11464350317">Ancestor: Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p1946417501118">Mandatory if <strong id="EN-US_TOPIC_0125560423__b546413501214">NoncurrentVersionTransition</strong>, <strong id="EN-US_TOPIC_0125560423__b11464175010117">Expiration</strong>, and <strong id="EN-US_TOPIC_0125560423__b24649501917">NoncurrentVersionExpiration</strong> are absent.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row6675738"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p3863873">Expiration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p44538317">Indicates the container for the object expiration rule.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p65300541">Type: XML</p>
|
|
<p id="EN-US_TOPIC_0125560423__p50833958">Children: Date or Days</p>
|
|
<p id="EN-US_TOPIC_0125560423__p54852443">Ancestor: Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p13862865">Mandatory if <strong id="EN-US_TOPIC_0125560423__b3757191629">Transition</strong>, <strong id="EN-US_TOPIC_0125560423__b137571918213">NoncurrentVersionTransition</strong>, and <strong id="EN-US_TOPIC_0125560423__b157574110216">NoncurrentVersionExpiration</strong> are absent.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row57656925"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p39699339">ID</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p61529894">Indicates the unique identifier of a rule. The value can contain a maximum of 255 characters.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p16898135">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560423__p17865493">Ancestor: Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p37818817">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row4825033"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p55283354">LifecycleConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p48766684">Indicates the container for lifecycle rules. You can add multiple rules. The total size of the rules cannot exceed 20 KB.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p36246974">Type: XML</p>
|
|
<p id="EN-US_TOPIC_0125560423__p57787318">Children: Rule</p>
|
|
<p id="EN-US_TOPIC_0125560423__p50323820">Ancestor: None</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p49697630">Mandatory</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row15752738173915"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p903368173915">NoncurrentDays</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p1780571618050">Indicates the number of days after object is noncurrent when the specified rule takes effect.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p1687068218050">Type: Positive integer</p>
|
|
<p id="EN-US_TOPIC_0125560423__p1178684417544">Ancestor: NoncurrentVersionExpiration, NoncurrentVersionTransition</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p21420606173915">Mandatory if the <strong id="EN-US_TOPIC_0125560423__b1598111525312">NoncurrentVersionExpiration</strong> or <strong id="EN-US_TOPIC_0125560423__b17992301044">NoncurrentVersionTransition</strong> parameter is present.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row81345881514"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p356918547576">NoncurrentVersionTransition</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p1670512161921">Indicates the element of the transition time and new storage class (applicable to historical versions) in the lifecycle configuration.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p4705416421">Type: XML</p>
|
|
<p id="EN-US_TOPIC_0125560423__p770520161926">Children: NoncurrentDays, StorageClass</p>
|
|
<p id="EN-US_TOPIC_0125560423__p47062162220">Ancestor: Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p11706816329">Mandatory if <strong id="EN-US_TOPIC_0125560423__b670691617215">Transition</strong>, <strong id="EN-US_TOPIC_0125560423__b0706111619216">Expiration</strong>, and <strong id="EN-US_TOPIC_0125560423__b170613169211">NoncurrentVersionExpiration</strong> are absent.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row38960720173947"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p1701766173947">NoncurrentVersionExpiration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p411104918235">Indicates the container for the noncurrent object expiration rule. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that OBS delete noncurrent object versions which meet the expiration rule.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p35167743115110">Type: XML</p>
|
|
<p id="EN-US_TOPIC_0125560423__p48074236115110">Children: NoncurrentDays</p>
|
|
<p id="EN-US_TOPIC_0125560423__p30014947115110">Ancestor: Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p114457812915">Mandatory if <strong id="EN-US_TOPIC_0125560423__b12739225526">Transition</strong>, <strong id="EN-US_TOPIC_0125560423__b47397251021">Expiration</strong>, and <strong id="EN-US_TOPIC_0125560423__b1873916251429">NoncurrentVersionTransition</strong> are absent.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row13403168129"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p18475453419">AbortIncompleteMultipartUpload</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p1984714456419">Container for specifying when the not merged parts (fragments) in an incomplete upload will be deleted.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p22531162611">Type: XML</p>
|
|
<p id="EN-US_TOPIC_0125560423__p1225318162067">Children node: DaysAfterInitiation</p>
|
|
<p id="EN-US_TOPIC_0125560423__p3253316061">Ancestor node: Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p13847194517412">Required if the <strong id="EN-US_TOPIC_0125560423__b28611145105812">Transition</strong>, <strong id="EN-US_TOPIC_0125560423__b28627452583">Expiration</strong>, <strong id="EN-US_TOPIC_0125560423__b9151221145920">NoncurrentVersionExpiration</strong>, or <strong id="EN-US_TOPIC_0125560423__b4581182495916">NoncurrentVersionTransition</strong> element is absent.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row9785101761212"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p3698938997">DaysAfterInitiation</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p7593183511109">Specifies the number of days since the initiation of an incomplete multipart upload that OBS will wait before deleting the not merged parts (fragments) of the upload.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p14593163531010">Type: positive integer</p>
|
|
<p id="EN-US_TOPIC_0125560423__p19593133511015">Ancestor node: AbortIncompleteMultipartUpload</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p1098034854512">Required if the <strong id="EN-US_TOPIC_0125560423__b26471861405">AbortIncompleteMultipartUpload</strong> element is absent.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row44625493"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p57895144">Prefix</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p58995125">Indicates the object key prefix identifying one or more objects to which the rule applies.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p61194080">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560423__p13875810">Ancestor: Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p50198807">Mandatory</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row49136085"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p20599914">Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p57980315">Indicates the container for lifecycle rules.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p52060794">Type: Container</p>
|
|
<p id="EN-US_TOPIC_0125560423__p65893970">Ancestor: LifecycleConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p35811316">Mandatory</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560423__row53866394"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560423__p1101770">Status</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560423__p22134555">Indicates whether the rule is enabled.</p>
|
|
<p id="EN-US_TOPIC_0125560423__p64993271">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560423__p48068532">Ancestor: Rule</p>
|
|
<p id="EN-US_TOPIC_0125560423__p29963612">Valid Values: Enabled, Disabled</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.11.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560423__p11133493">Mandatory</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0125560423__p694714219126">If the multi-version of a bucket is enabled or suspended, you can set <strong id="EN-US_TOPIC_0125560423__b19857186412">NoncurrentVersionExpiration</strong> or <strong id="EN-US_TOPIC_0125560423__b124611654573">NoncurrentVersionTransition</strong> to control the lifecycle of historical object versions. The lifecycle of a historical version depends on the time when the version becomes a historical one, that is, the version is overwritten by a new version (<strong id="EN-US_TOPIC_0125560423__b3387617131218">NoncurrentDays</strong>).</p>
|
|
<p id="EN-US_TOPIC_0125560423__p49481211214">In deletion circumstances, if <strong id="EN-US_TOPIC_0125560423__b1084319431022">NoncurrentDays</strong> is 1, a version can only be deleted one day after it has become a historical version. For example, the V1 version of object A is created on the first day of a month, and its new version V2 is uploaded on the fifth day of the month. Then V1 becomes a historical version. One day later, that is, when the 0 o'clock of the seventh day comes, V1 expires. If an object version does not meet the deletion conditions, <strong id="EN-US_TOPIC_0125560423__b684316434219">NoncurrentDays</strong> is 1, and <strong id="EN-US_TOPIC_0125560423__b7843144317218">StorageClass</strong> is <strong id="EN-US_TOPIC_0125560423__b14843174311210">STANDARD_IA</strong>, a version transitions to the Warm storage class one day after it has become a historical version. For example, the V1 version of object A is created on the first day of a month, and its new version V2 is uploaded on the fifth day of the month. Then V1 becomes a historical version. One day later, that is, when the 0 o'clock of the seventh day comes, V1 transitions to the Warm storage class. (Remarks: There is a delay of less than 48 hours for such a deletion or transition upon object expiration.)</p>
|
|
<p id="EN-US_TOPIC_0125560423__p1194816219121">The following lists the background processing for when the multi-version of a bucket is enabled or suspended and the object of the latest version meets expiration rules:</p>
|
|
<ul id="EN-US_TOPIC_0125560423__ul12734737181213"><li id="EN-US_TOPIC_0125560423__li16874714191310">The multi-version of the bucket is enabled:<ul id="EN-US_TOPIC_0125560423__ul036491715134"><li id="EN-US_TOPIC_0125560423__li9920101921316">If the object of the latest version is not <strong id="EN-US_TOPIC_0125560423__b1892091915138">deletemarker</strong>, a new <strong id="EN-US_TOPIC_0125560423__b165271026145">deletemarker</strong> is generated for the object.</li><li id="EN-US_TOPIC_0125560423__li879292281319">If the object of the latest version is <strong id="EN-US_TOPIC_0125560423__b14301435845">deletemarker</strong> and the object has this version only, the version will be deleted.</li><li id="EN-US_TOPIC_0125560423__li177343374123">If the object of the latest version is <strong id="EN-US_TOPIC_0125560423__b13877104312414">deletemarker</strong> and the object has other versions, all versions of the object remain unchanged.</li></ul>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0125560423__ul1416234117121"><li id="EN-US_TOPIC_0125560423__li9663122541318">The multi-version of the bucket is suspended:<ul id="EN-US_TOPIC_0125560423__ul684772518138"><li id="EN-US_TOPIC_0125560423__li1085462711313">If the latest version is not null, <strong id="EN-US_TOPIC_0125560423__b69251511948">deletemarker</strong> of a null version will be generated.</li><li id="EN-US_TOPIC_0125560423__li1162941181212">If the latest version is null, the null version will be overwritten by <strong id="EN-US_TOPIC_0125560423__b19891531252">deletemarker</strong> of a new null version.</li></ul>
|
|
</li></ul>
|
|
<p id="EN-US_TOPIC_0125560423__p49371557322">If the bucket versioning is <strong id="EN-US_TOPIC_0125560423__b193735710219">Enabled</strong> or <strong id="EN-US_TOPIC_0125560423__b5937057428">Suspended</strong> and the latest version of the object meets the transition rule:</p>
|
|
<ul id="EN-US_TOPIC_0125560423__ul9937135718212"><li id="EN-US_TOPIC_0125560423__li109377571129">If the latest version is <strong id="EN-US_TOPIC_0125560423__b11937145710210">deletemarker</strong>, this version will not transition to another storage class.</li><li id="EN-US_TOPIC_0125560423__li17581199732">If the latest version is <strong id="EN-US_TOPIC_0125560423__b15801914313">deletemarker</strong> and the object meets the transition conditions, this version will transition to another storage class.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section10857028"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560423__screen3321389612350">HTTP/1.1 status_code
|
|
Server: Server Name
|
|
x-amz-request-id: request id
|
|
x-amz-id-2: id
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Date: date
|
|
Content-Length: length </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section30604389"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560423__p13531531">This response uses common headers. For details about common response headers, see section <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section7004053"><h4 class="sectiontitle">Response elements</h4><p id="EN-US_TOPIC_0125560423__p62458233">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section63036484"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0125560423__p25952117">No special error responses are returned. For details about error responses, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section28842926"><h4 class="sectiontitle">Sample Request 1</h4><pre class="screen" id="EN-US_TOPIC_0125560423__screen3004118612411">PUT /?lifecycle HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: bucketname.obs.example.com
|
|
Date: Thu, 05 Sep 2013 09:35:44 +0000
|
|
Authorization: AWS B9A70C60A39C4D551A16:MOO0dUPmAAEXEe0/z+Q9LCx1Vzc=
|
|
Content-MD5: Sa2ttwkV/+XRCwEHg4N8ow==
|
|
Content-Length: 423
|
|
Expect: 100-continue
|
|
|
|
<LifecycleConfiguration>
|
|
<Rule>
|
|
<ID>delete-2-days</ID>
|
|
<Prefix>test/</Prefix>
|
|
<Status>Enabled</Status>
|
|
<Expiration>
|
|
<Days>365</Days>
|
|
</Expiration>
|
|
<NoncurrentVersionExpiration>
|
|
<NoncurrentDays>365</NoncurrentDays>
|
|
</NoncurrentVersionExpiration>
|
|
<Transition>
|
|
<Days>30</Days>
|
|
<StorageClass>STANDARD_IA</StorageClass>
|
|
</Transition>
|
|
<Transition>
|
|
<Days>60</Days>
|
|
<StorageClass>GLACIER</StorageClass>
|
|
</Transition>
|
|
<NoncurrentVersionTransition>
|
|
<NoncurrentDays>30</NoncurrentDays>
|
|
<StorageClass>STANDARD_IA</StorageClass>
|
|
</NoncurrentVersionTransition>
|
|
<NoncurrentVersionTransition>
|
|
<NoncurrentDays>60</NoncurrentDays>
|
|
<StorageClass>GLACIER</StorageClass>
|
|
</NoncurrentVersionTransition>
|
|
<AbortIncompleteMultipartUpload>
|
|
<DaysAfterInitiation>10</DaysAfterInitiation>
|
|
</AbortIncompleteMultipartUpload>
|
|
</Rule>
|
|
</LifecycleConfiguration>
|
|
</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section58259743"><h4 class="sectiontitle">Sample Response 1</h4><pre class="screen" id="EN-US_TOPIC_0125560423__screen4214788812421">HTTP/1.1 200 OK
|
|
Date: Thu, 05 Sep 2013 09:35:44 GMT
|
|
Server: OBS
|
|
x-amz-request-id: 90E2BA0A420C00000140ED7A369007A2
|
|
x-amz-id-2: t35S98JCFKUMswCPZCk+UTi/VOoiSenzi5J6wnoKCIMfXUsKYGgU5+daiWAYiY/8
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section165812054676"><h4 class="sectiontitle">Sample Request 2</h4><pre class="screen" id="EN-US_TOPIC_0125560423__screen27421420142759">PUT /?lifecycle HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: bucketname.obs.example.comDate: Thu, 05 Sep 2015 09:35:44 +0000
|
|
Authorization: AWS B9A70C60A39C4D551A16:MOO0dUPmAAEXEe0/z+Q9LCx1Vzc=
|
|
Content-MD5: Sa2ttwkV/+XRCwEHg4N8ow==
|
|
Content-Length: 423
|
|
Expect: 100-continue
|
|
<LifecycleConfiguration>
|
|
<Rule>
|
|
<ID>delete-2-days</ID>
|
|
<Prefix>test/</Prefix>
|
|
<Status>Enabled</Status>
|
|
<Expiration>
|
|
<Days>365</Days>
|
|
</Expiration>
|
|
<Transition>
|
|
<Days>30</Days>
|
|
<StorageClass>STANDARD_IA</StorageClass>
|
|
</Transition>
|
|
<Transition>
|
|
<Days>60</Days>
|
|
<StorageClass>GLACIER</StorageClass>
|
|
</Transition>
|
|
<NoncurrentVersionTransition>
|
|
<NoncurrentDays>30</NoncurrentDays>
|
|
<StorageClass>STANDARD_IA</StorageClass>
|
|
</NoncurrentVersionTransition>
|
|
<NoncurrentVersionTransition>
|
|
<NoncurrentDays>60</NoncurrentDays>
|
|
<StorageClass>GLACIER</StorageClass>
|
|
</NoncurrentVersionTransition>
|
|
<AbortIncompleteMultipartUpload>
|
|
<DaysAfterInitiation>10</DaysAfterInitiation>
|
|
</AbortIncompleteMultipartUpload>
|
|
</Rule>
|
|
</LifecycleConfiguration></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560423__section8484163419817"><h4 class="sectiontitle">Sample Response 2</h4><pre class="screen" id="EN-US_TOPIC_0125560423__screen16582241142810">HTTP/1.1 200 OK
|
|
Date: Thu, 05 Sep 2015 09:35:44 GMT
|
|
x-amz-request-id: 90E2BA0A420C00000140ED7A369007A2
|
|
x-amz-id-2: t35S98JCFKUMswCPZCk+UTi/VOoiSenzi5J6wnoKCIMfXUsKYGgU5+daiWAYiY/8
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0125560493.html">Operations on Buckets</a></div>
|
|
</div>
|
|
</div>
|
|
|