Files
doc-exports/docs/obs/tool-obsutil/obs_11_0062.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

123 lines
10 KiB
HTML

<a name="obs_11_0062"></a><a name="obs_11_0062"></a>
<h1 class="topictitle1">Creating an Authorization Code for Directory Sharing</h1>
<div id="body1569313196706"><div class="section" id="obs_11_0062__section1479112110815"><h4 class="sectiontitle">Function</h4><p id="obs_11_0062__p178478162456">You can use this command to specify the bucket name, object name prefix, and access code to create an authorization code for directory sharing.</p>
</div>
<div class="section" id="obs_11_0062__section1220752192216"><h4 class="sectiontitle">Command Line Structure</h4><ul id="obs_11_0062__ul17832169163716"><li id="obs_11_0062__li383219919376">In Windows<pre class="screen" id="obs_11_0062__screen917312587818">obsutil create-share obs://bucket[/prefix] [-ac=xxx] [-vp=xxx] [-dst=xxx] [-config=xxx] </pre>
</li><li id="obs_11_0062__li126121614103718">In Linux or macOS<pre class="screen" id="obs_11_0062__screen1058392319116">./obsutil create-share obs://bucket[/prefix] [-ac=xxx] [-vp=xxx] [-dst=xxx] [-config=xxx] </pre>
</li></ul>
</div>
<div class="section" id="obs_11_0062__section18151565418"><h4 class="sectiontitle">Examples</h4><ul id="obs_11_0062__ul11161556104117"><li id="obs_11_0062__li716145613416">In Windows, you can run the <strong id="obs_11_0062__b1898712404510">obsutil create-share obs://bucket/test/ -ac=123456 -vp=1m</strong> command to create an authorization code that is valid within one month.<pre class="screen" id="obs_11_0062__screen1516155613414"><strong id="obs_11_0062__b1916125610413">obsutil create-share obs://bucket/test/ -ac=123456 -vp=1m</strong>
Authorization Code:
token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Access Code:
123456
Valid Until:
Sat, 26 Oct 2019 11:28:10 GMT +0800</pre>
</li></ul>
</div>
<div class="section" id="obs_11_0062__section6559191102418"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_11_0062__table10831182114445" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_11_0062__row683212154419"><th align="left" class="cellrowborder" valign="top" width="18.19%" id="mcps1.3.4.2.1.4.1.1"><p id="obs_11_0062__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_0062__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_0062__p12832121184414">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_11_0062__row108328217449"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0062__p1065435215710">bucket</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0062__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_0062__p17425512259">The bucket name</p>
</td>
</tr>
<tr id="obs_11_0062__row6835121971217"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0062__p15835519201217">prefix</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0062__p138351193129">Optional</p>
</td>
<td class="cellrowborder" valign="top" width="55.65%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0062__p3793205419129">The prefix of an object name. If this parameter is specified, objects starting with this prefix are shared. If this parameter is left blank, all objects in the bucket are shared.</p>
<div class="note" id="obs_11_0062__note68118464576"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0062__p1081154625710">It is recommended that the value end with a slash (/).</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0062__row12354183045115"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0062__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_0062__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_0062__p183551330185117">The access code</p>
<div class="note" id="obs_11_0062__note65111626111415"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0062__ul206431628162318"><li id="obs_11_0062__li206439288237">If no access code is passed using this parameter, obsutil tool prompts you to enter the access code in interactive mode.</li><li id="obs_11_0062__li8644628102320">An access code is a six-digit string.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0062__row77261271514"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0062__p157268710117">vp</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0062__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_0062__p177272717115">The validity period of an authorization code. The default value is one day, indicating that the generated authorization code is valid for only one day.</p>
<div class="note" id="obs_11_0062__note129881917144317"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0062__ul664374365714"><li id="obs_11_0062__li655764411571">This parameter supports different time units, including: <strong id="obs_11_0062__b18310113924516">m</strong> (month), <strong id="obs_11_0062__b7731174217458">w</strong> (week), <strong id="obs_11_0062__b939146194514">d</strong> (day), <strong id="obs_11_0062__b177541648104511">h</strong> (hour), <strong id="obs_11_0062__b057414526458">min</strong> (minute), and <strong id="obs_11_0062__b172971456124514">s</strong> (second). For example, <strong id="obs_11_0062__b893316215467">1d</strong> indicates that the authorization code is valid within one day, <strong id="obs_11_0062__b89548234467">2w</strong> indicates that the code is valid within two weeks, and <strong id="obs_11_0062__b9237173811469">3h</strong> indicates that the code is valid within three hours.</li><li id="obs_11_0062__li166433438579">The default time unit is <strong id="obs_11_0062__b19393135664711">s</strong> (second), for example, <strong id="obs_11_0062__b6832499486">3600</strong> indicates that the authorization code is valid within 3600 seconds.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0062__row6754154015416"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0062__p137541240164118">dst</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0062__p56341823134220">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_0062__p475494094114">The path for storing the generated authorization code</p>
</td>
</tr>
<tr id="obs_11_0062__row1095422313515"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0062__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_0062__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_0062__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>
<tr id="obs_11_0062__row11157121892418"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0062__p1966666191820">payer</p>
</td>
<td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0062__p1266611611820">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_0062__p1166617619181">Specifies that requester pays is enabled.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_11_0062__section103074529141"><h4 class="sectiontitle">Response</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_11_0062__table992610203244" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_11_0062__row892913208248"><th align="left" class="cellrowborder" valign="top" width="21.73%" id="mcps1.3.5.2.1.3.1.1"><p id="obs_11_0062__p1392992019245">Field</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="78.27%" id="mcps1.3.5.2.1.3.1.2"><p id="obs_11_0062__p19318207246">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_11_0062__row79320208248"><td class="cellrowborder" valign="top" width="21.73%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0062__p1093217203246">Authorization Code</p>
</td>
<td class="cellrowborder" valign="top" width="78.27%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0062__p18753151115409">The code for authorization</p>
</td>
</tr>
<tr id="obs_11_0062__row1753615812247"><td class="cellrowborder" valign="top" width="21.73%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0062__p15536155820245">Access Code</p>
</td>
<td class="cellrowborder" valign="top" width="78.27%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0062__p575213111407">The access code</p>
</td>
</tr>
<tr id="obs_11_0062__row98643152253"><td class="cellrowborder" valign="top" width="21.73%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0062__p8864415102517">Valid Until</p>
</td>
<td class="cellrowborder" valign="top" width="78.27%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0062__p0751611114014">The expiration time</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>