doc-exports/docs/obs/api-ref/obs_04_0020.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

214 lines
11 KiB
HTML

<a name="obs_04_0020"></a><a name="obs_04_0020"></a>
<h1 class="topictitle1">Listing Buckets</h1>
<div id="body23756221"><div class="section" id="obs_04_0020__section5584184924715"><h4 class="sectiontitle">Functions</h4><p id="obs_04_0020__p753105884719">You can perform this operation to list all buckets that you have created.</p>
</div>
<div class="section" id="obs_04_0020__section65384058"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0020__screen45205739"><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 / HTTP/1.1
Host: obs.region.example.com
Date: date
Authorization: authorization
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="obs_04_0020__section51585610"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0020__p40868721">This request contains no parameter.</p>
</div>
<div class="section" id="obs_04_0020__section61617313"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0020__p22032077">This request header uses common message fields. For details, see <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a>.</p>
</div>
<div class="section" id="obs_04_0020__section17684911"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0020__p22366230">The request does not use request elements.</p>
</div>
<div class="section" id="obs_04_0020__section24946477"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0020__screen66834225"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20</pre></div></td><td class="code"><div class="highlight"><pre><span></span>GET HTTP/1.1 status_code
Content-Type: type
Date: date
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;ListAllMyBucketsResult</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>
<span class="nt">&lt;Owner&gt;</span>
<span class="nt">&lt;ID&gt;</span>id<span class="nt">&lt;/ID&gt;</span>
<span class="nt">&lt;/Owner&gt;</span>
<span class="nt">&lt;Buckets&gt;</span>
<span class="nt">&lt;Bucket&gt;</span>
<span class="nt">&lt;Name&gt;</span>bucketName<span class="nt">&lt;/Name&gt;</span>
<span class="nt">&lt;CreationDate&gt;</span>date<span class="nt">&lt;/CreationDate&gt;</span>
<span class="nt">&lt;Location&gt;</span>region<span class="nt">&lt;/Location&gt;</span>
<span class="nt">&lt;BucketType&gt;</span>buckettype<span class="nt">&lt;/BucketType&gt;</span>
<span class="nt">&lt;/Bucket&gt;</span>
...
<span class="nt">&lt;/Buckets&gt;</span>
<span class="nt">&lt;/ListAllMyBucketsResult&gt;</span>
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="obs_04_0020__section23191709"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0020__p66812821">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_0020__section7398790"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0020__p52620452">This response contains the XML list of buckets owned by the user. <a href="#obs_04_0020__table3679815894442">Table 1</a> describes the elements.</p>
<div class="tablenoborder"><a name="obs_04_0020__table3679815894442"></a><a name="table3679815894442"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0020__table3679815894442" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Response elements</caption><thead align="left"><tr id="obs_04_0020__row20543572"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.2.3.1.1"><p id="obs_04_0020__p53416658"><strong id="obs_04_0020__b19713818173913">Element</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.2.3.1.2"><p id="obs_04_0020__p17602688"><strong id="obs_04_0020__b1387212255392">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0020__row14567053"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0020__p39080636">ListAllMyBucketsResult</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0020__p11414972">List of buckets created by the user</p>
<p id="obs_04_0020__p35625890">Type: XML</p>
</td>
</tr>
<tr id="obs_04_0020__row52197557"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0020__p143694">Owner</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0020__p11639215">Bucket owner information, including the tenant ID.</p>
<p id="obs_04_0020__p37644074">Type: XML</p>
</td>
</tr>
<tr id="obs_04_0020__row3252353"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0020__p62114027">ID</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0020__p65180310">Domain ID (account ID) of a user.</p>
<p id="obs_04_0020__p49751883">Type: string</p>
</td>
</tr>
<tr id="obs_04_0020__row61424743"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0020__p9348268">Buckets</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0020__p19012258">Buckets owned by the user</p>
<p id="obs_04_0020__p36892599">Type: XML</p>
</td>
</tr>
<tr id="obs_04_0020__row63597936"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0020__p51159231">Bucket</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0020__p50257079">Details about a bucket</p>
<p id="obs_04_0020__p49660529">Type: XML</p>
</td>
</tr>
<tr id="obs_04_0020__row44291583"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0020__p30848447">Name</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0020__p15696288">Bucket name</p>
<p id="obs_04_0020__p7048868">Type: string</p>
</td>
</tr>
<tr id="obs_04_0020__row63439817"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0020__p38351587">CreationDate</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0020__p19470870">Creation time of the bucket</p>
<p id="obs_04_0020__p41020104">Type: string</p>
</td>
</tr>
<tr id="obs_04_0020__row172523593133"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0020__p2253125951316">Location</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0020__p1625385914134">Location of the bucket</p>
<p id="obs_04_0020__p930953141417">Type: string</p>
</td>
</tr>
<tr id="obs_04_0020__row2027165118447"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0020__p1127120510448">BucketType</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0020__p027185144419">Bucket type</p>
<p id="obs_04_0020__p1453610954511">Type: string. Value options are as follows:</p>
<ul id="obs_04_0020__ul13905114810473"><li id="obs_04_0020__li1690514486477"><strong id="obs_04_0020__b9433474163">OBJECT</strong>: indicates a bucket.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0020__section66589115"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0020__p34294098">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_0020__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0020__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 / HTTP/1.1
User-Agent: curl/7.29.0
Host: obs.region.example.com
Accept: */*
Date: Mon, 25 Jun 2018 05:37:12 +0000
Authorization: OBS GKDF4C7Q6SI0IPGTXTJN:9HXkVQIiQKw33UEmyBI4rWrzmic=
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="obs_04_0020__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0020__screen8485113814"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: BF260000016435722C11379647A8A00A
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSGGDRUM62QZi3hGP8Fz3gOloYCfZ39U
Content-Type: application/xml
Date: Mon, 25 Jun 2018 05:37:12 GMT
Content-Length: 460
<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;ListAllMyBucketsResult</span> <span class="na">xmlns=</span><span class="s">&quot;http://obs.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;Owner&gt;</span>
<span class="nt">&lt;ID&gt;</span>783fc6652cf246c096ea836694f71855<span class="nt">&lt;/ID&gt;</span>
<span class="nt">&lt;/Owner&gt;</span>
<span class="nt">&lt;Buckets&gt;</span>
<span class="nt">&lt;Bucket&gt;</span>
<span class="nt">&lt;Name&gt;</span>examplebucket01<span class="nt">&lt;/Name&gt;</span>
<span class="nt">&lt;CreationDate&gt;</span>2018-06-21T09:15:01.032Z<span class="nt">&lt;/CreationDate&gt;</span>
<span class="nt">&lt;Location&gt;</span>region<span class="nt">&lt;/Location&gt;</span>
<span class="nt">&lt;BucketType&gt;</span>OBJECT<span class="nt">&lt;/BucketType&gt;</span>
<span class="nt">&lt;/Bucket&gt;</span>
<span class="nt">&lt;Bucket&gt;</span>
<span class="nt">&lt;Name&gt;</span>examplebucket02<span class="nt">&lt;/Name&gt;</span>
<span class="nt">&lt;CreationDate&gt;</span>2018-06-22T03:56:33.700Z<span class="nt">&lt;/CreationDate&gt;</span>
<span class="nt">&lt;Location&gt;</span>region<span class="nt">&lt;/Location&gt;</span>
<span class="nt">&lt;BucketType&gt;</span>OBJECT<span class="nt">&lt;/BucketType&gt;</span>
<span class="nt">&lt;/Bucket&gt;</span>
<span class="nt">&lt;/Buckets&gt;</span>
<span class="nt">&lt;/ListAllMyBucketsResult&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>