doc-exports/docs/obs/api-ref/obs_04_0024.html
Jawei, Li f1cb839979 OBS api-ref 2.0.38.SP5
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Jawei, Li <lijiawei5@huawei.com>
Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
2022-11-03 11:54:51 +00:00

103 lines
5.9 KiB
HTML

<a name="obs_04_0024"></a><a name="obs_04_0024"></a>
<h1 class="topictitle1">Obtaining Bucket Location</h1>
<div id="body33344080"><div class="section" id="obs_04_0024__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0024__p25590737">This operation obtains the location of a bucket. To use this operation, you must have the permission to read the bucket.</p>
</div>
<div class="section" id="obs_04_0024__section28990045"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0024__screen16515950"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4</pre></div></td><td class="code"><div class="highlight"><pre><span></span>GET /?location HTTP/1.1
Host: bucketname.obs.region.example.com
Date: date
Authorization: authorization
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="obs_04_0024__section59583813"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0024__p35421108">This request contains no parameters.</p>
</div>
<div class="section" id="obs_04_0024__section66492276"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0024__p50537472">This request uses common headers. For details, see <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a>.</p>
</div>
<div class="section" id="obs_04_0024__section61559578"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0024__p66160209">This request contains no elements.</p>
</div>
<div class="section" id="obs_04_0024__section17165296"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0024__screen57376732"><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 status_code
Date: date
Content-Type: type
Content-Length: length
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span>
<span class="nt">&lt;Location</span> <span class="na">xmlns=</span><span class="s">&quot;http://obs.region.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>region<span class="nt">&lt;/Location&gt;</span>
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="obs_04_0024__section20269944"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0024__p1512332591013">The response to the request uses common headers. For details, see <a href="obs_04_0013.html#obs_04_0013__d0e686">Table 1</a>.</p>
</div>
<div class="section" id="obs_04_0024__section48211769"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0024__p66238173">This response contains elements of information about a bucket's region. <a href="#obs_04_0024__table63691781">Table 1</a> describes the elements.</p>
<div class="tablenoborder"><a name="obs_04_0024__table63691781"></a><a name="table63691781"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0024__table63691781" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Response elements</caption><thead align="left"><tr id="obs_04_0024__row55071087"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.2.3.1.1"><p id="obs_04_0024__p31573097">Element</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.2.3.1.2"><p id="obs_04_0024__p65556830">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0024__row62255039"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0024__p9493421">Location</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0024__p30769611">Indicates the region where the bucket resides.</p>
<p id="obs_04_0024__p8491043">Type: string</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0024__section31252742"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0024__p16685901">No special error responses are involved. For details about error responses, see <a href="obs_04_0115.html#obs_04_0115__d0e843">Table 2</a>.</p>
</div>
<div class="section" id="obs_04_0024__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0024__screen8484163863919"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4
5
6</pre></div></td><td class="code"><div class="highlight"><pre><span></span>GET /?location HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.example.com
Accept: */*
Date: WED, 01 Jul 2015 02:30:25 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:1DrmbCV+lhz3zV7uywlj7lrh0MY=
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="obs_04_0024__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0024__screen8485113814"><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>HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: BF260000016435D9F27CB2758E9B41A5
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSKWoJmaMyRXqofHgapbETDyI2LM9rUw
Content-Type: application/xml
Date: WED, 01 Jul 2015 02:30:25 GMT
Content-Length: 128
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span>
<span class="nt">&lt;Location</span> <span class="na">xmlns=</span><span class="s">&quot;http://obs.region.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>region<span class="nt">&lt;/Location&gt;</span>
</pre></div>
</td></tr></table></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0019.html">Operations on Buckets</a></div>
</div>
</div>