Files
doc-exports/docs/obs/tool-obsutil/obs_11_0063.html
weihongmin1 a41a4e0331 OBS Util 0115 Version
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: weihongmin1 <weihongmin1@huawei.com>
Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
2026-02-17 10:18:57 +00:00

144 lines
12 KiB
HTML

<a name="obs_11_0063"></a><a name="obs_11_0063"></a>
<h1 class="topictitle1">Listing Objects by Using an Authorization Code</h1>
<div id="body1568718272166"><div class="section" id="obs_11_0063__section1479112110815"><h4 class="sectiontitle">Function</h4><p id="obs_11_0063__p178478162456">You can use this command to query objects in a bucket with an authorization code. The returned objects are sorted in lexicographical order.</p>
</div>
<div class="section" id="obs_11_0063__section1220752192216"><h4 class="sectiontitle">Command Line Structure</h4><ul id="obs_11_0063__ul17832169163716"><li id="obs_11_0063__li383219919376">In Windows<ul id="obs_11_0063__ul196342211919"><li id="obs_11_0063__li19173158686">Enter an authorization code directly.<pre class="screen" id="obs_11_0063__screen917312587818">obsutil share-ls authorization_code [-ac=xxx] [-prefix=xxx] [-s] [-d] [-marker=xxx] [-bf=xxx] [-limit=1] [-config=xxx] </pre>
</li><li id="obs_11_0063__li74963241910">Use the file path to pass an authorization code.<pre class="screen" id="obs_11_0063__screen6461112161119">obsutil share-ls file://authorization_code_file_url [-ac=xxx] [-prefix=xxx] [-s] [-d] [-marker=xxx] [-bf=xxx] [-limit=1] [-config=xxx] </pre>
</li></ul>
</li><li id="obs_11_0063__li126121614103718">In Linux or macOS<ul id="obs_11_0063__ul14699133815117"><li id="obs_11_0063__li1158316236113">Enter an authorization code directly.<pre class="screen" id="obs_11_0063__screen1058392319116">./obsutil share-ls authorization_code [-ac=xxx] [-prefix=xxx] [-s] [-d] [-marker=xxx] [-bf=xxx] [-limit=1] [-config=xxx] </pre>
</li><li id="obs_11_0063__li821733318117">Use the file path to pass an authorization code.<pre class="screen" id="obs_11_0063__screen132172330113">./obsutil share-ls file://authorization_code_file_url [-ac=xxx] [-prefix=xxx] [-s] [-d] [-marker=xxx] [-bf=xxx] [-limit=1] [-config=xxx] </pre>
</li></ul>
</li></ul>
</div>
<div class="section" id="obs_11_0063__section525371794218"><h4 class="sectiontitle">Examples</h4><ul id="obs_11_0063__ul32539172422"><li id="obs_11_0063__li2253317174211">In Windows, you can run the <strong id="obs_11_0063__b414240338">obsutil share-ls xxx -ac=123456 -limit=1</strong> command to query objects in a bucket using an authorization code.<pre class="screen" id="obs_11_0063__screen15930429104512"><strong id="obs_11_0063__b8931229144520">obsutil share-ls xxx -ac=123456 -limit=1</strong>
The authorized prefix is [test/test.tar.gz]
Listing objects .
Object list:
key LastModified Size StorageClass ETag
obs://bucket-test/test/test.tar.gz 2019-07-11T14:50:59Z 48.92KB standard "1dd27294ad2f152b43cd111e9fe3990f"
Total size of prefix [test/]: 48.92KB
Folder number: 0
File number: 1
The authorized prefix is [test/]</pre>
</li><li id="obs_11_0063__li725417104517">In Windows, you can run the <strong id="obs_11_0063__b698119579285">obsutil share-ls xxx -ac=123456 -limit=1</strong> command to query directories in a bucket using an authorization code.<pre class="screen" id="obs_11_0063__screen12253101713422"><strong id="obs_11_0063__b32539178428">obsutil share-ls xxx -ac=123456 -limit=1</strong>
The authorized prefix is [test]
Listing objects .
Folder list:
obs://bucket-test/test/
Object list:
key LastModified Size StorageClass ETag
obs://bucket-test/test/test.tar.gz 2019-07-11T14:50:59Z 48.92KB standard "1dd27294ad2f152b43cd111e9fe3990f"
Total size of prefix [test/]: 48.92KB
Folder number: 1
File number: 1
The authorized prefix is [test/]</pre>
</li></ul>
</div>
<div class="section" id="obs_11_0063__section6559191102418"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_11_0063__table10831182114445" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_11_0063__row683212154419"><th align="left" class="cellrowborder" valign="top" width="18.19%" id="mcps1.3.4.2.1.4.1.1"><p id="obs_11_0063__p118329219446">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="26.16%" id="mcps1.3.4.2.1.4.1.2"><p id="obs_11_0063__p15137125919108">Optional or Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.65%" id="mcps1.3.4.2.1.4.1.3"><p id="obs_11_0063__p12832121184414">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_11_0063__row108328217449"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0063__p66741317155112">authorization_code</p>
<p id="obs_11_0063__p4745172620131">or</p>
<p id="obs_11_0063__p12371530111313">file://authorization_code_file_url</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0063__p154316502519">Mandatory</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0063__p17425512259">The code for authorization</p>
<div class="note" id="obs_11_0063__note7117115211318"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0063__p1511835281319">If the authorization code starts with <strong id="obs_11_0063__b57839515549">file://</strong>, the authorization code is obtained from a local file.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0063__row12354183045115"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0063__p1878833185111">ac</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0063__p235543012513">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0063__p183551330185117">The access code</p>
<div class="note" id="obs_11_0063__note65111626111415"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0063__ul206431628162318"><li id="obs_11_0063__li206439288237">If no access code is specified using this parameter, obsutil tool prompts you to enter the access code in interactive mode.</li><li id="obs_11_0063__li8644628102320">An access code is a six-digit string.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0063__row77261271514"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0063__p157268710117">prefix</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0063__p19727157912">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0063__p177272717115">The object name prefix specified for listing objects using an authorization code</p>
<div class="note" id="obs_11_0063__note129881917144317"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0063__ul664374365714"><li id="obs_11_0063__li655764411571">If this parameter is specified, objects starting with this prefix are listed.</li><li id="obs_11_0063__li166433438579">If this parameter is left blank, all objects in the authorized path are shared.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0063__row167881281811"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0063__p37889281012">s</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0063__p177888281316">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0063__p1378816281111">Displays simplified query result.</p>
<div class="note" id="obs_11_0063__note1452085114212"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0063__p252035122111">In the simplified format, the returned result contains only the object name.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0063__row105292037563"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0063__p145294376611">d</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0063__p18226142117716">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0063__p853014371767">Lists only objects and subdirectories in the current directory, instead of recursively listing all objects and subdirectories.</p>
<div class="note" id="obs_11_0063__note1255192611160"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0063__p156102661616">According to the naming conventions in OBS, a slash (/) is used as the directory separator.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0063__row182013491164"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0063__p1201174920618">marker</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0063__p1020113491669">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0063__p820104913610">The start position for listing objects in a bucket using an authorization code. The objects following this start position are sorted in lexicographical order by object name.</p>
</td>
</tr>
<tr id="obs_11_0063__row193001710154315"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0063__p63016107437">bf</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0063__p10301510184317">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0063__p1930171012438">The display formats of bytes in the listing result. Possible values are:</p>
<ul id="obs_11_0063__ul1273864144412"><li id="obs_11_0063__li17738649445">human-readable</li><li id="obs_11_0063__li1551213137447">raw</li></ul>
<div class="note" id="obs_11_0063__note11602143394810"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0063__p6603633154818">If this parameter is not configured, the display format of bytes in the result is determined by the <strong id="obs_11_0063__b1712732920119">humanReadableFormat</strong> parameter in the configuration file.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0063__row23091241125114"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0063__p1918111241654">limit</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0063__p218113247513">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0063__p310214615616">The maximum number of objects that can be listed. If the value is less than or equal to 0, all objects are listed. If it is left blank, 1000 objects are listed by default.</p>
<div class="note" id="obs_11_0063__note1997814166384"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0063__p17979111612385">If there are a large number of objects in a bucket, you are advised to set this parameter to limit the number of objects to be listed each time. If not all objects are listed, <strong id="obs_11_0063__b1440343663211">marker</strong> of the next request will be returned in the result, which you can use to list the remaining objects.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0063__row1095422313515"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0063__p153951131317">config</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0063__p12395135316">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0063__obs_11_0008_p1750111452317">The user-defined configuration file for executing the current command. For details about parameters that can be configured, see <a href="obs_11_0035.html">Configuration Parameters</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_11_0012.html">Object Commands</a></div>
</div>
</div>