doc-exports/docs/obs/s3api/en-us_topic_0125560403.html
Jawei, Li 1a4c1a720a OBS s3api 2.0.38.SP5
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>
2022-11-16 14:51:13 +00:00

89 lines
6.9 KiB
HTML

<a name="EN-US_TOPIC_0125560403"></a><a name="EN-US_TOPIC_0125560403"></a>
<h1 class="topictitle1">PUT Bucket storage class</h1>
<div id="body1510627911015"><p id="EN-US_TOPIC_0125560403__p66426196425">You can use this operation to create a default storage class for a bucket or change the default storage class of a bucket.</p>
<p id="EN-US_TOPIC_0125560403__p18642151910429">Only users granted the <strong id="EN-US_TOPIC_0125560403__b164711199429">s3:PutBucketStoragePolicy</strong> permission can perform this operation. By default, only the bucket owner can perform this operation. The bucket owner can allow other users to perform this operation by granting them the permission or setting a bucket policy.</p>
<p id="EN-US_TOPIC_0125560403__p96477199423">When a bucket has a default storage class, if users do not specify the object storage class when uploading or copying an object or initializing a multipart upload task, the object will use the default bucket storage class.</p>
<p id="EN-US_TOPIC_0125560403__p46471219154213">When users do not manually set a default storage class for a bucket, the bucket will have the Standard storage class by default.</p>
<div class="section" id="EN-US_TOPIC_0125560403__section1693614596537"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560403__screen39160888">PUT /?storagePolicy HTTP/1.1
User-Agent: agent
Host: bucketname.obs.example.com
Date: date
Accept: */*
Date: date
Authorization: authorization
Content-Length: length
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;StoragePolicy xmlns="http://obs.example.com/doc/2015-06-30/"&gt;
&lt;DefaultStorageClass&gt;STANDARD&lt;/DefaultStorageClass&gt;
&lt;/StoragePolicy&gt;</pre>
</div>
<div class="section" id="EN-US_TOPIC_0125560403__section931219237541"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560403__p780013183441">This request involves no parameters.</p>
</div>
<div class="section" id="EN-US_TOPIC_0125560403__section1454013816540"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560403__p230618817454">This request uses common headers. For details about common request headers, see <a href="en-us_topic_0125560462.html">Common Request Headers</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0125560403__section1254181935510"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0125560403__p21967010">This request uses elements to specify the default bucket storage class. <a href="#EN-US_TOPIC_0125560403__table63485364">Table 1</a> describes the elements.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560403__table63485364"></a><a name="table63485364"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560403__table63485364" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request elements</caption><thead align="left"><tr id="EN-US_TOPIC_0125560403__row57640352"><th align="left" class="cellrowborder" valign="top" width="34.83%" id="mcps1.3.8.3.2.4.1.1"><p id="EN-US_TOPIC_0125560403__p334413554618">Element</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="41.93%" id="mcps1.3.8.3.2.4.1.2"><p id="EN-US_TOPIC_0125560403__p16344235134618">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.24%" id="mcps1.3.8.3.2.4.1.3"><p id="EN-US_TOPIC_0125560403__p03441835144619">Remarks</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0125560403__row9812033"><td class="cellrowborder" valign="top" width="34.83%" headers="mcps1.3.8.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560403__p124693486466">DefaultStorageClass</p>
</td>
<td class="cellrowborder" valign="top" width="41.93%" headers="mcps1.3.8.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560403__p2469104884616">Indicates the default bucket storage class.</p>
<p id="EN-US_TOPIC_0125560403__p1469184814615">It is a character string and can be <strong id="EN-US_TOPIC_0125560403__b047020485465">STANDARD</strong> (OBS Standard), <strong id="EN-US_TOPIC_0125560403__b6470164816464">STANDARD_IA</strong> (OBS Warm), or <strong id="EN-US_TOPIC_0125560403__b10470104811465">GLACIER</strong> (OBS Cold). Note that the three storage class values are case-sensitive.</p>
</td>
<td class="cellrowborder" valign="top" width="23.24%" headers="mcps1.3.8.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560403__p17470194814463">Mandatory</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0125560403__section28885633224023"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560403__screen58034899224023">HTTP/1.1 status_code
Server: Server Name
x-amz-request-id: request id
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
x-amz-id-2: id
Date: date
Content-Length: 0</pre>
</div>
<div class="section" id="EN-US_TOPIC_0125560403__section52552049224023"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560403__p073427184813">This response uses common headers. For details about common response headers, see <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0125560403__section55760466224023"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0125560403__p20303899224023">This response involves no elements.</p>
</div>
<div class="section" id="EN-US_TOPIC_0125560403__section48517371224023"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0125560403__p1233774214499">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_0125560403__section31331064"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="EN-US_TOPIC_0125560403__screen2592113">PUT / HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/3.1
Host: bucketname.obs.example.com
Accept: */*
Date: Sun, 26 Sep 2017 08:24:46 GMT
Authorization: AWS 04RZT432N80TGDF2Y2G2:ZyEGq367GyGGyItzr5egJOjaqiM=
Content-Length: 240
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;StoragePolicy xmlns="http://obs.example.com/doc/2015-06-30/"&gt;
&lt;DefaultStorageClass&gt;STANDARD&lt;/DefaultStorageClass&gt;
&lt;/StoragePolicy&gt;</pre>
</div>
<div class="section" id="EN-US_TOPIC_0125560403__section35401528"><h4 class="sectiontitle">Sample Response</h4><pre class="screen" id="EN-US_TOPIC_0125560403__screen8634633">HTTP/1.1 200 OK
Server: OBS
x-amz-request-id: 3CEF0000015D08E1CF94AE61EA0EA1BC
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
x-amz-id-2: 0Z9Og4sWbGljhJq/UYfv6oBCwQ3/ZidsCQYz4CYBU305KRQnMwJWNXk/3/vswTEx
Date: Sun, 26 Sep 2017 08:28:06 GMT
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>