forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
178 lines
14 KiB
HTML
178 lines
14 KiB
HTML
<a name="EN-US_TOPIC_0125560467"></a><a name="EN-US_TOPIC_0125560467"></a>
|
|
|
|
<h1 class="topictitle1">HEAD Bucket</h1>
|
|
<div id="body9716817"><p class="msonormal" id="EN-US_TOPIC_0125560467__p52761448">After being granted <strong id="EN-US_TOPIC_0125560467__b20342494">READ</strong> permission for a bucket, you can use this operation to query whether the bucket exists.</p>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section34833164"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560467__screen26687806112316">HEAD / HTTP/1.1
|
|
User-Agent: agent
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: date
|
|
Authorization: authorization</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section45063028"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560467__p3221269">This request involves no parameters.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section2914074"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560467__p59596251">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_0125560467__p26232393">If you want to obtain CORS configuration information, you must use the headers in <a href="#EN-US_TOPIC_0125560467__table48864719">Table 1</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560467__table48864719"></a><a name="table48864719"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560467__table48864719" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request headers of CORS configuration</caption><thead align="left"><tr id="EN-US_TOPIC_0125560467__row29527737"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.4.2.4.1.1"><p id="EN-US_TOPIC_0125560467__p42936498">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.4.2.4.1.2"><p id="EN-US_TOPIC_0125560467__p55304348">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.4.2.4.1.3"><p id="EN-US_TOPIC_0125560467__p50467231">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560467__row61313890"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="EN-US_TOPIC_0125560467__p369165">Origin</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="EN-US_TOPIC_0125560467__p29902409">Indicates an origin specified by a pre-request. Generally, it is a domain name.</p>
|
|
<p id="EN-US_TOPIC_0125560467__p686229">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="EN-US_TOPIC_0125560467__p55584556">Mandatory</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560467__row30498962"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="EN-US_TOPIC_0125560467__p54496880">Access-Control-Request-Headers</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="EN-US_TOPIC_0125560467__p52171134">Indicates the HTTP headers of a request. The request can use multiple HTTP headers.</p>
|
|
<p id="EN-US_TOPIC_0125560467__p66887022">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="EN-US_TOPIC_0125560467__p49139720">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560467__row23410512213"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="EN-US_TOPIC_0125560467__p12337965214">x-amz-security-token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="EN-US_TOPIC_0125560467__p1833717612118">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_0125560467__p633715612119">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="EN-US_TOPIC_0125560467__p433710611212">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_0125560467__section26226671"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0125560467__p53831642">This request involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section56386551"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560467__screen56015167112335">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-bucket-region: region name
|
|
Content-Type: */*
|
|
x-obs-version: version
|
|
x-default-storage-class: staorage class
|
|
x-amz-id-2: id
|
|
Date: date
|
|
Content-Length: length</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section37716915"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560467__p41592000">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>
|
|
<p id="EN-US_TOPIC_0125560467__p54470724">In addition to common headers, when CORS is configured for buckets, you can use the response headers in <a href="#EN-US_TOPIC_0125560467__table14722737">Table 2</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560467__table14722737"></a><a name="table14722737"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560467__table14722737" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Appended response headers when CORS is configured for buckets</caption><thead align="left"><tr id="EN-US_TOPIC_0125560467__row48105459"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.7.4.2.3.1.1"><p id="EN-US_TOPIC_0125560467__p4228126">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.7.4.2.3.1.2"><p id="EN-US_TOPIC_0125560467__p6933938">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560467__row24778069"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560467__p60866610">Access-Control-Allow-Origin</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560467__p31248367">If <strong id="EN-US_TOPIC_0125560467__b12799849">Origin</strong> in the request meets the CORS configuration requirements, <strong id="EN-US_TOPIC_0125560467__b48089780">Origin</strong> is included in the response.</p>
|
|
<p id="EN-US_TOPIC_0125560467__p30154842">Type: String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560467__row2958122"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560467__p38281336">Access-Control-Allow-Headers</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560467__p13780551">If <strong id="EN-US_TOPIC_0125560467__b56916103">headers</strong> in the request meet the CORS configuration requirements, <strong id="EN-US_TOPIC_0125560467__b42482879">headers</strong> are included in the response.</p>
|
|
<p id="EN-US_TOPIC_0125560467__p46801593">Type: String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560467__row18561159"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560467__p27058887">Access-Control-Max-Age</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560467__p44286248">Indicates <strong id="EN-US_TOPIC_0125560467__b63031916">MaxAgeSeconds</strong> in the CORS configuration of a server.</p>
|
|
<p id="EN-US_TOPIC_0125560467__p30416337">Type: Integer</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560467__row5311585"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560467__p27585226">Access-Control-Allow-Methods</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560467__p19810832">If <strong id="EN-US_TOPIC_0125560467__b44079761">Access-Control-Request-Method</strong> in the request meets the CORS configuration requirements, methods in the rule are included in the response.</p>
|
|
<p id="EN-US_TOPIC_0125560467__p61173530">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560467__p13690860">Valid values: <strong id="EN-US_TOPIC_0125560467__b56108880">GET</strong>, <strong id="EN-US_TOPIC_0125560467__b35217880">PUT</strong>, <strong id="EN-US_TOPIC_0125560467__b48525468">HEAD</strong>, <strong id="EN-US_TOPIC_0125560467__b34076028">POST</strong>, and <strong id="EN-US_TOPIC_0125560467__b38248803">DELETE</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560467__row8694913"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560467__p33199375">Access-Control-Expose-Headers</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560467__p4794829">Indicates <strong id="EN-US_TOPIC_0125560467__b836417014599">ExposeHeader</strong> in the CORS configuration of a server.</p>
|
|
<p id="EN-US_TOPIC_0125560467__p52836835">Type: String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560467__row9577151519011"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560467__p1027317387279">x-amz-bucket-region</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560467__p147721719195813">Indicates the region of the bucket.</p>
|
|
<p id="EN-US_TOPIC_0125560467__p57722197584">Type: String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560467__row625181017236"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560467__p5661593517236">x-default-storage-class</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560467__p2248804017236">Indicates the default storage class of the current bucket. There are three storage classes: STANDARD (OBS Standard), STANDARD_IA (OBS Warm), and GLACIER (OBS Cold).</p>
|
|
<p id="EN-US_TOPIC_0125560467__p106576917236">Type: String</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section3907923"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0125560467__p64673997">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section35171311"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0125560467__p4102408">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_0125560467__section34727050"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="EN-US_TOPIC_0125560467__screen3254738211245">HEAD / HTTP/1.1
|
|
User-Agent: Jakarta Commons-HttpClient/3.1
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: Sun, 26 Sep 2010 09:16:00 GMT
|
|
Authorization: AWS 04RZT432N80TGDF2Y2G2:JUtd9kkJFjbKbkP9f6T/tAxozYY= </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section44108002"><h4 class="sectiontitle">Sample Response</h4><pre class="screen" id="EN-US_TOPIC_0125560467__screen66647080112411">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: 367CB63A2F283044981285492719060
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
x-amz-bucket-region: R1
|
|
Content-Type: application/xml
|
|
x-obs-version: 3.0
|
|
x-default-storage-class: STANDARD
|
|
x-amz-id-2: MzY3Q0I2M0EyRjI4MzA0NDk4MTI4NTQ5MjcxOTA2MEFBQUFBQUFBYmJiYmJiYmJD
|
|
Date: Sun, 26 Sep 2010 09:18:36 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section3311378921371"><h4 class="sectiontitle">Sample Request (Getting Bucket Metadata and CORS Configuration when CORS is properly configured)</h4><pre class="screen" id="EN-US_TOPIC_0125560467__screen995780993848">HEAD / HTTP/1.1
|
|
User-Agent: curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8{ zlib/1.2.3 libidn/1.10
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: Tue, 28 Apr 2015 13:47:30 +0000
|
|
Authorization: AWS D13E0C94E722DD69423C:1UL75oi0bFRpJlgZMfvh4lUyjBs=
|
|
Origin:www.example.com
|
|
Access-Control-Request-Headers:AllowedHeader_1</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560467__section23469382251"><h4 class="sectiontitle">Sample Response (Getting Bucket Metadata and CORS Configuration when CORS is properly configured)</h4><pre class="screen" id="EN-US_TOPIC_0125560467__screen352980051029">HTTP/1.1 200 OK
|
|
x-amz-request-id: BC4C45F57B0DED38D006D5F8FEB738C4
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Access-Control-Allow-Origin: www.example.com
|
|
Access-Control-Allow-Methods: POST,GET,HEAD,PUT
|
|
Access-Control-Allow-Headers: AllowedHeader_1
|
|
Access-Control-Max-Age: 100
|
|
Access-Control-Expose-Headers: ExposeHeader_1
|
|
x-amz-bucket-region: R1
|
|
Content-Type: text/xml
|
|
x-obs-version: 3.0
|
|
x-default-storage-class: STANDARD
|
|
x-amz-id-2: YkFlH3FTA2Tf/lIc2XiyuICp/EUqpVI4j1/g5hlatg75TTZdERSCYliqitChspgA
|
|
Date: Tue, 28 Apr 2015 13:47:30 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>
|
|
|