doc-exports/docs/obs/api-swift/obs_03_0042.html
zhangyue 894279c39a Object Storage Service API Reference Swift V1
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2023-02-02 08:50:48 +00:00

233 lines
18 KiB
HTML

<a name="obs_03_0042"></a><a name="obs_03_0042"></a>
<h1 class="topictitle1">Request</h1>
<div id="body1442459864672"><div class="section" id="obs_03_0042__section2546628103434"><h4 class="sectiontitle">Method</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0042__table4950298103434" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Method description</caption><thead align="left"><tr id="obs_03_0042__row45407113103434"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.1.2.2.4.1.1"><p id="obs_03_0042__p54097511103434">Method</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.1.2.2.4.1.2"><p id="obs_03_0042__p44182409103434"><strong id="obs_03_0042__b62097364103434">URI</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.1.2.2.4.1.3"><p id="obs_03_0042__p63830579103434">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0042__row26049921103434"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.1.2.2.4.1.1 "><p id="obs_03_0042__p29668845103434">POST</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.1.2.2.4.1.2 "><p id="obs_03_0042__p54366205103434">/v1/{account}/{container}</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.1.2.2.4.1.3 "><p id="obs_03_0042__p41586457103434">Creates, updates, or deletes container metadata.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="obs_03_0042__p38733800103434"><strong id="obs_03_0042__b62513914">{account}</strong> indicates the name of an account. <strong id="obs_03_0042__b25754316">{container}</strong> indicates the name of a container.</p>
<p id="obs_03_0042__p22229410104836">Metadata creation or update depends on whether the specified metadata already exists. Existing metadata is updated, and missing metadata is created.</p>
<p id="obs_03_0042__p13059882103434">This operation does not involve a request body.</p>
</div>
<div class="section" id="obs_03_0042__section5807786810479"><h4 class="sectiontitle">Example Request</h4><p id="obs_03_0042__p668688710479">Create or update metadata:</p>
</div>
<pre class="screen" id="obs_03_0042__screen6018198810479">curl -i $publicURL/marktwain -X POST -H "X-Auth-Token:$token" -H "X-Container-Meta-name:value"</pre>
<p id="obs_03_0042__p476698710479">Delete metadata:</p>
<pre class="screen" id="obs_03_0042__screen4290288310479">curl -i $publicURL/marktwain -X POST -H "X-Auth-Token:$token" -H "X-Remove-Container-Meta-name:x"</pre>
<div class="section" id="obs_03_0042__section5058163010479"><h4 class="sectiontitle">Request Query Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0042__table13066390143824" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_03_0042__row60050431143824"><th align="left" class="cellrowborder" valign="top" width="20.66%" id="mcps1.3.6.2.1.4.1.1"><p id="obs_03_0042__p32246725143824">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.399999999999999%" id="mcps1.3.6.2.1.4.1.2"><p id="obs_03_0042__p19760809143824">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="64.94%" id="mcps1.3.6.2.1.4.1.3"><p id="obs_03_0042__p44333492143824">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0042__row39752746143824"><td class="cellrowborder" valign="top" width="20.66%" headers="mcps1.3.6.2.1.4.1.1 "><p id="obs_03_0042__p65855824143824">bulk-delete</p>
</td>
<td class="cellrowborder" valign="top" width="14.399999999999999%" headers="mcps1.3.6.2.1.4.1.2 "><p id="obs_03_0042__p32721527143824">String</p>
<p id="obs_03_0042__p26058290143824">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="64.94%" headers="mcps1.3.6.2.1.4.1.3 "><p id="obs_03_0042__p30346749143824">Bulk-deletes objects. This parameter is used with the deletion list file.</p>
<p id="obs_03_0042__p4685286143824">A maximum of 10,000 objects can be deleted.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_03_0042__section3124263010479"><h4 class="sectiontitle">Request Headers</h4><p id="obs_03_0042__p22826821105553">Request URI parameters</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0042__table4114798105553" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_03_0042__row30330451105553"><th align="left" class="cellrowborder" valign="top" width="20.66%" id="mcps1.3.7.3.1.4.1.1"><p id="obs_03_0042__p40847470105553">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.399999999999999%" id="mcps1.3.7.3.1.4.1.2"><p id="obs_03_0042__p48579016105553">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="64.94%" id="mcps1.3.7.3.1.4.1.3"><p id="obs_03_0042__p47731417105553">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0042__row33811556105553"><td class="cellrowborder" valign="top" width="20.66%" headers="mcps1.3.7.3.1.4.1.1 "><p id="obs_03_0042__p54381502105553">{account}</p>
</td>
<td class="cellrowborder" valign="top" width="14.399999999999999%" headers="mcps1.3.7.3.1.4.1.2 "><p id="obs_03_0042__p42825561105553">String</p>
<p id="obs_03_0042__p49885734105553">(Required)</p>
</td>
<td class="cellrowborder" valign="top" width="64.94%" headers="mcps1.3.7.3.1.4.1.3 "><p id="obs_03_0042__p14212677105553">A unique account name. In the current version, it indicates a unique ID for the account.</p>
</td>
</tr>
<tr id="obs_03_0042__row60805232105553"><td class="cellrowborder" valign="top" width="20.66%" headers="mcps1.3.7.3.1.4.1.1 "><p id="obs_03_0042__p26276797105553">{container}</p>
</td>
<td class="cellrowborder" valign="top" width="14.399999999999999%" headers="mcps1.3.7.3.1.4.1.2 "><p id="obs_03_0042__p48045802105553">String</p>
<p id="obs_03_0042__p29759036105553">(Required)</p>
</td>
<td class="cellrowborder" valign="top" width="64.94%" headers="mcps1.3.7.3.1.4.1.3 "><p id="obs_03_0042__p61671709105553">A unique container name.</p>
<p id="obs_03_0042__p18174469105553">For details about container naming rules, see <a href="obs_03_0009.html">Naming Rules</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="obs_03_0042__p58476526105955"><a href="#obs_03_0042__table15259407105955">Table 2</a> describes the request header parameters.</p>
<div class="tablenoborder"><a name="obs_03_0042__table15259407105955"></a><a name="table15259407105955"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0042__table15259407105955" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="obs_03_0042__row1038926105955"><th align="left" class="cellrowborder" valign="top" width="36.54%" id="mcps1.3.7.5.2.4.1.1"><p id="obs_03_0042__p17044171105955">Header</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.939999999999998%" id="mcps1.3.7.5.2.4.1.2"><p id="obs_03_0042__p10061014105955">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46.52%" id="mcps1.3.7.5.2.4.1.3"><p id="obs_03_0042__p19613076105955">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0042__row1286149195840"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p22279653195855">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p59821436195855">String</p>
<p id="obs_03_0042__p1522018195855">(Required)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p56174656195855">Authentication token.</p>
</td>
</tr>
<tr id="obs_03_0042__row45816803105955"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p20173539105955">X-Container-Read</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p23443972105955">String</p>
<p id="obs_03_0042__p37011763105457">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p19913581105955">Sets a container ACL that grants read access. For details about the ACL rules, see <a href="obs_03_0034.html#obs_03_0034__section1003248895852">Container Read ACL Rules (X-Container-Read)</a>.</p>
</td>
</tr>
<tr id="obs_03_0042__row21486598105955"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p62692876105955">X-Container-Write</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p44958166105955">String</p>
<p id="obs_03_0042__p316752410558">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p17732812105955">Sets a container ACL that grants write access. For details about the ACL rules, see <a href="obs_03_0034.html#obs_03_0034__section39003754101721">Container Write ACL Rules (X-Container-Write)</a>.</p>
</td>
</tr>
<tr id="obs_03_0042__row63267932105955"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p24428891105955">X-Container-Meta-name</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p32583150105955">String</p>
<p id="obs_03_0042__p40086891105510">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p21989502105955">Container metadata. <strong id="obs_03_0042__b43181444181013">{name}</strong> is the name of a metadata item that you want to add, update, or delete. To delete this item, leave <strong id="obs_03_0042__b1831894461020">{name}</strong> empty in this header. You must specify an <strong id="obs_03_0042__b1958652481102620">X-Container-Meta-{name}</strong> header for each metadata item (for each <strong id="obs_03_0042__b1279392657102620">{name}</strong>) that you want to add, update, or delete.</p>
</td>
</tr>
<tr id="obs_03_0042__row458779151141"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p1484652511410">X-Remove-Container-Meta-name</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p217504131141">String</p>
<p id="obs_03_0042__p49410157105512">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p169530371141">Deletes container metadata. <strong id="obs_03_0042__b30495700">{name}</strong> is the name of a metadata item that you want to add, update, or delete. Metadata deletion requires the <strong id="obs_03_0042__b2028005442102633">X-Remove-Container-Meta-{name}</strong> parameter, and the value can be set to any non-empty character string.</p>
</td>
</tr>
<tr id="obs_03_0042__row62788344111830"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p37854186111832">X-Container-Meta-Web-Directory-Type</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p46290239111832">String</p>
<p id="obs_03_0042__p58330641105513">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p19683931161050">Type of the object shown as a folder.</p>
</td>
</tr>
<tr id="obs_03_0042__row24556019161111"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p50637782161123">X-Container-Meta-Web-Index</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p46349110161130">String</p>
<p id="obs_03_0042__p8019660161123">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p45612760161123">Name of the specified index page.</p>
</td>
</tr>
<tr id="obs_03_0042__row16061118161137"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p23515956161212">X-Container-Meta-Web-Error</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p34640194161518">String</p>
<p id="obs_03_0042__p25744254161212">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p4909812161212">Name of the page shown in the error information, only 401 and 404 errors supported.</p>
</td>
</tr>
<tr id="obs_03_0042__row5880191161217"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p27288609161225">X-Container-Meta-Web-Listings</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p37362349161516">boolean</p>
<p id="obs_03_0042__p62893743161225">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p61228397161225">Indicates whether to show the object list when no index page is configured. The value <strong id="obs_03_0042__b84235270614579">true</strong> indicates to show and <strong id="obs_03_0042__b842352706145723">false</strong> (default) not to show.</p>
</td>
</tr>
<tr id="obs_03_0042__row2720846161153"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p27061310161235">X-Container-Meta-Web-Listings-CSS</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p3225886316152">String</p>
<p id="obs_03_0042__p44482467161235">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p46310052161235">Type of the CSS loaded when showing the object list.</p>
</td>
</tr>
<tr id="obs_03_0042__row40940633161157"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p38235690161419">X-Web-Mode</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p46741775161423">boolean</p>
<p id="obs_03_0042__p10083176161419">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p11430931161419">Indicates whether to enable static website for authorized users. The value <strong id="obs_03_0042__b84235270615315">true</strong> indicates to enable and <strong id="obs_03_0042__b84235270615319">false</strong> (default) not to enable.</p>
</td>
</tr>
<tr id="obs_03_0042__row31362913162035"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p64891499162047">X-Container-Meta-Access-Control-Allow-Origin</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p21720103162047">String</p>
<p id="obs_03_0042__p61263199162047">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p63372116162047">Website addresses whose CORS-based access requests are allowed, which are separated from each other with commas (,).</p>
</td>
</tr>
<tr id="obs_03_0042__row41697949162033"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p27374691162047">X-Container-Meta-Access-Control-Max-Age</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p2757504162047">Int</p>
<p id="obs_03_0042__p24817542162047">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p64063885162047">Maximum duration during which clients can keep CORS access results (clients' browsers cache CORS access results).</p>
</td>
</tr>
<tr id="obs_03_0042__row22086053162031"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p61911971162047">X-Container-Meta-Access-Control-Expose-Headers</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p48813730162047">String</p>
<p id="obs_03_0042__p36670389162047">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p17511502162047">Headers that can be exposed to clients (for example browsers), separated from each other with spaces.</p>
</td>
</tr>
<tr id="obs_03_0042__row57255603142420"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p45538384142420">X-Container-Meta-Temp-URL-Key</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p18376640142520">String</p>
<p id="obs_03_0042__p31172033142520">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p8679111142420">Secret key value for container-layer TempURL.</p>
</td>
</tr>
<tr id="obs_03_0042__row54539534142428"><td class="cellrowborder" valign="top" width="36.54%" headers="mcps1.3.7.5.2.4.1.1 "><p id="obs_03_0042__p21093759142428">X-Container-Meta-Temp-URL-Key-2</p>
</td>
<td class="cellrowborder" valign="top" width="16.939999999999998%" headers="mcps1.3.7.5.2.4.1.2 "><p id="obs_03_0042__p1040367142521">String</p>
<p id="obs_03_0042__p9363310142521">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="46.52%" headers="mcps1.3.7.5.2.4.1.3 "><p id="obs_03_0042__p17676166142428">A second secret key value for container-layer TempURL.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_03_0041.html">Create/Update/Delete Container Metadata</a></div>
</div>
</div>