forked from laiweijian4/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>
198 lines
16 KiB
HTML
198 lines
16 KiB
HTML
<a name="EN-US_TOPIC_0125560305"></a><a name="EN-US_TOPIC_0125560305"></a>
|
|
|
|
<h1 class="topictitle1">PUT Bucket</h1>
|
|
<div id="body18564111"><p id="EN-US_TOPIC_0125560305__p54806219">You can send the <strong id="EN-US_TOPIC_0125560305__b32859274">PUT Bucket</strong> request to create a bucket with the specified name.</p>
|
|
<div class="note" id="EN-US_TOPIC_0125560305__note23493928"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="EN-US_TOPIC_0125560305__p27298012">You can create a maximum of 100 buckets.</p>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0125560305__p10118767">The name of a bucket must be unique in OBS. If a user repeatedly creates namesake buckets in the same region, status code <strong id="EN-US_TOPIC_0125560305__b76377311489">200</strong> is returned. If namesake buckets are repeatedly created in other cases, status code <strong id="EN-US_TOPIC_0125560305__b1857441374811">409</strong> is returned. You can set the ACL of a bucket by adding optional header <strong id="EN-US_TOPIC_0125560305__b44355518">x-amz-acl</strong> to a request.</p>
|
|
<div class="note" id="EN-US_TOPIC_0125560305__note23960039"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0125560305__p55170850161711">In multiple regions scenarios, if user A creates a bucket, deletes the bucket later, and immediately creates a bucket with the same name in different regions, the system will respond <strong id="EN-US_TOPIC_0125560305__b1970124344814">409</strong>. If user A creates a bucket with the same name in different regions 30 minutes later, the system will respond <strong id="EN-US_TOPIC_0125560305__b10199133994817">200</strong>.</p>
|
|
<p id="EN-US_TOPIC_0125560305__p3836447020218">If a 5<em id="EN-US_TOPIC_0125560305__i732732184916">xx</em> error is returned from the server or the request times out during bucket creation, the system takes about 10 minutes to make bucket information consistent. During the process, bucket information is inaccurate.</p>
|
|
</div></div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section47363625202820"><h4 class="sectiontitle">Storage Class</h4><p id="EN-US_TOPIC_0125560305__p34127054202820">Users are allowed to create buckets of different storage classes. The <strong id="EN-US_TOPIC_0125560305__b38708033202820">x-default-storage-class</strong> header in a bucket creation request specifies the default storage class for a bucket. The storage class of the objects in a bucket is the same as that of the bucket. There are three storage classes: STANDARD (OBS Standard), STANDARD_IA (OBS Warm), and GLACIER (OBS Cold). If this header is not in the request, the storage class of the bucket created is OBS Standard. When users upload an object to a bucket, if they do not set the storage class of the object (see <a href="en-us_topic_0125560399.html">PUT Object</a>), the object will use the default storage class of the bucket.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section38116128"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560305__screen17691597104928">PUT / HTTP/1.1
|
|
User-Agent: agent
|
|
Host: Host Server
|
|
Accept: */*
|
|
Date: date
|
|
Authorization: authorization
|
|
x-amz-epid: <em id="EN-US_TOPIC_0125560305__i2084118705812">epid</em>
|
|
Content-Length: 0
|
|
<Optional Additional Header>
|
|
|
|
<CreateBucketConfiguration xmlns="http://obs.example.com/doc/2015-06-30/">
|
|
<LocationConstraint>location</LocationConstraint>
|
|
</CreateBucketConfiguration></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section7500834"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560305__p50339135">This request involves no parameters.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section398650"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560305__p50938166">This request uses common headers. For details about common request headers, see section <a href="en-us_topic_0125560462.html">Common Request Headers</a>.</p>
|
|
<p id="EN-US_TOPIC_0125560305__p22721246">You can add optional headers to this request. <a href="#EN-US_TOPIC_0125560305__table31170320">Table 1</a> describes the optional headers.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560305__table31170320"></a><a name="table31170320"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560305__table31170320" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Optional request headers</caption><thead align="left"><tr id="EN-US_TOPIC_0125560305__row47912089"><th align="left" class="cellrowborder" valign="top" width="33.333333333333336%" id="mcps1.3.8.4.2.4.1.1"><p id="EN-US_TOPIC_0125560305__p55673999">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.333333333333336%" id="mcps1.3.8.4.2.4.1.2"><p id="EN-US_TOPIC_0125560305__p13300041">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.333333333333336%" id="mcps1.3.8.4.2.4.1.3"><p id="EN-US_TOPIC_0125560305__p3561519">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560305__row20047659"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.1 "><p id="EN-US_TOPIC_0125560305__p13247650">x-amz-acl</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.2 "><p id="EN-US_TOPIC_0125560305__p66426750">Indicates the ACL of a bucket. Possible values are <strong id="EN-US_TOPIC_0125560305__b60969846">private</strong>, <strong id="EN-US_TOPIC_0125560305__b11857703">public-read</strong>, <strong id="EN-US_TOPIC_0125560305__b39610468">public-read-write</strong>, <strong id="EN-US_TOPIC_0125560305__b20949892">authenticated-read</strong>, <strong id="EN-US_TOPIC_0125560305__b54331306">bucket-owner-read</strong>, and <strong id="EN-US_TOPIC_0125560305__b19219710">bucket-owner-full-control</strong>. For details, see <a href="en-us_topic_0125560406.html#EN-US_TOPIC_0125560406__table40200743">Table 4</a>.</p>
|
|
<p id="EN-US_TOPIC_0125560305__p13292668">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.3 "><p id="EN-US_TOPIC_0125560305__p2964327">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560305__row23889184203239"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.1 "><p id="EN-US_TOPIC_0125560305__p57471669203319">x-default-storage-class</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.2 "><p id="EN-US_TOPIC_0125560305__p14900873203330">When creating a bucket, you can add this header in the request to set the bucket's default storage class, which can be STANDARD (OBS Standard), STANDARD_IA (OBS Warm), and GLACIER (OBS Cold). If this header is not specified in the request, the storage class of the bucket created is OBS Standard.</p>
|
|
<p id="EN-US_TOPIC_0125560305__p66998998203330">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.3 "><p id="EN-US_TOPIC_0125560305__p34271861203337">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560305__row1772355541119"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.1 "><p id="EN-US_TOPIC_0125560305__p2636530171316">x-amz-security-token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.2 "><p id="EN-US_TOPIC_0125560305__p176361330141312">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_0125560305__p186362030201310">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.3 "><p id="EN-US_TOPIC_0125560305__p1063603061316">Optional. This parameter must be carried in the request sent by federated users.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560305__row999218143574"><td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.1 "><p id="EN-US_TOPIC_0125560305__p65695633219">x-amz-epid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.2 "><p id="EN-US_TOPIC_0125560305__p756165643210">Enterprise project ID, which can be obtained from the enterprise project service. The value is a universally unique identifier (UUID). The value of a default enterprise project is <strong id="EN-US_TOPIC_0125560305__b17701173284018">0</strong> or does not contain this header. Users who have not enabled the enterprise project service do not need to carry this header either.</p>
|
|
<p id="EN-US_TOPIC_0125560305__p1111210103611">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560305__p16668181715360">Example: <strong id="EN-US_TOPIC_0125560305__b13873175220389">x-amz-epid: 9892d768-2d13-450f-aac7-ed0e44c2585f</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.333333333333336%" headers="mcps1.3.8.4.2.4.1.3 "><p id="EN-US_TOPIC_0125560305__p456756153216">Optional</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section5296112755414"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0125560305__p16625293">This request contains one element, as described in <a href="#EN-US_TOPIC_0125560305__table5512965">Table 2</a></p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560305__table5512965"></a><a name="table5512965"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560305__table5512965" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request element</caption><thead align="left"><tr id="EN-US_TOPIC_0125560305__row5892555"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.9.3.2.4.1.1"><p id="EN-US_TOPIC_0125560305__p7534928">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.9.3.2.4.1.2"><p id="EN-US_TOPIC_0125560305__p6349446">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.9.3.2.4.1.3"><p id="EN-US_TOPIC_0125560305__p44543124">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560305__row51223331"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560305__p55449179">LocationConstraint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560305__p62198499">Indicates the Region where a bucket will be created. This element is contained in <strong id="EN-US_TOPIC_0125560305__b22915580">CreateBucketConfiguration</strong>.</p>
|
|
<p id="EN-US_TOPIC_0125560305__p4913635">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560305__p62460164">Optional</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section61603605"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560305__screen43716622104944">HTTP/1.1 status_code
|
|
x-amz-request-id: request id
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Location: location
|
|
x-amz-id-2: id
|
|
Date: date
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section17561535"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560305__p15925207">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_0125560305__section23836090"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0125560305__p63896804">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section13198224"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0125560305__p8258615">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_0125560305__section12795575"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="EN-US_TOPIC_0125560305__screen35401010533">PUT / HTTP/1.1
|
|
User-Agent: Jakarta Commons-HttpClient/3.1
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: Sat, 03 Dec 2011 06:31:58 +0000
|
|
Authorization: AWS BF6C09F302931425E9A7:QBaO+tS/76QYHVnUoxvf9EPH/3o=
|
|
<strong id="EN-US_TOPIC_0125560305__b1698361616598"> </strong>x-amz-epid: 9892d768-2d13-450f-aac7-ed0e44c2585f
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section48051319"><h4 class="sectiontitle">Sample Response</h4><pre class="screen" id="EN-US_TOPIC_0125560305__screen20164173105318">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: 001B21A61C6C00000134029F41D1527F
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Location: /bucketname
|
|
x-amz-id-2: MDAxQjIxQTYxQzZDMDAwMDAxMzQwMjlGNDFEMTUyN0ZBQUFBQUFBQWJiYmJiYmJi
|
|
Date: Sat, 03 Dec 2011 06:31:58 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section29808687"><h4 class="sectiontitle">Sample Request (Example of Setting the Region of a Bucket)</h4><pre class="screen" id="EN-US_TOPIC_0125560305__screen30806076105332">PUT / HTTP/1.1
|
|
User-Agent: Jakarta Commons-HttpClient/3.1
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: Sat, 03 Dec 2011 06:31:58 +0000
|
|
Authorization: AWS BF6C09F302931425E9A7:QBaO+tS/76QYHVnUoxvf9EPH/3o=
|
|
x-amz-epid: 9892d768-2d13-450f-aac7-ed0e44c2585f
|
|
Content-Length: 149
|
|
|
|
<CreateBucketConfiguration xmlns="http://obs.example.com/doc/2015-06-30/">
|
|
<LocationConstraint>EU</LocationConstraint>
|
|
</CreateBucketConfiguration></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section66951593"><h4 class="sectiontitle">Sample Response (Example of Setting the Region of a Bucket)</h4><pre class="screen" id="EN-US_TOPIC_0125560305__screen60083759105349">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: 001B21A61C6C00000134029F41D1527F
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Location: /bucketname
|
|
x-amz-id-2: MDAxQjIxQTYxQzZDMDAwMDAxMzQwMjlGNDFEMTUyN0ZBQUFBQUFBQWJiYmJiYmJi
|
|
Date: Sat, 03 Dec 2011 06:31:58 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section1593874119494"><h4 class="sectiontitle">Sample Request (Example of Creating a parallel file system)</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0125560305__screen152931411562"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10</pre></div></td><td class="code"><div class="highlight"><pre><span></span>PUT / HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.region.example.com
|
|
Accept: */*
|
|
Date: WED, 01 Jul 2015 02:25:05 GMT
|
|
Authorization: AWS H4IPJX0TQTHTHEBQQCEC:75/Y4Ng1izvzc1nTGxpMXTE6ynw=
|
|
Content-Length: 157
|
|
<span class="nt"><CreateBucketConfiguration</span> <span class="na">xmlns=</span><span class="s">"http://obs.region.example.com/doc/2015-06-30/"</span><span class="nt">></span>
|
|
<span class="nt"><Location></span>region<span class="nt"></Location></span>
|
|
<span class="nt"></CreateBucketConfiguration></span>
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560305__section16939941164914"><h4 class="sectiontitle">Sample Response (Example of Creating a parallel file system)</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0125560305__screen32947410563"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: BF260000016435CE298386946AE4C482
|
|
Location: /examplebucket
|
|
x-amz-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCT9W2tcvLmMJ+plfdopaD62S0npbaRUz
|
|
Date: WED, 01 Jul 2015 02:25:06 GMT
|
|
Content-Length: 0
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</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>
|
|
|