doc-exports/docs/obs/api-swift/obs_03_0021.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

152 lines
11 KiB
HTML

<a name="obs_03_0021"></a><a name="obs_03_0021"></a>
<h1 class="topictitle1">Request</h1>
<div id="body8662426"><div class="section" id="obs_03_0021__section3051751717825"><h4 class="sectiontitle">Method</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0021__table5599981617825" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Method description</caption><thead align="left"><tr id="obs_03_0021__row1708100417825"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.1.2.2.4.1.1"><p id="obs_03_0021__p4138407817825">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_0021__p3711316617825"><strong id="obs_03_0021__b6558304317825">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_0021__p1062627917825">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0021__row2903806617825"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.1.2.2.4.1.1 "><p id="obs_03_0021__p327315417825">POST</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.1.2.2.4.1.2 "><p id="obs_03_0021__p6379890217825">/v1/{account}</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.1.2.2.4.1.3 "><p id="obs_03_0021__p32856717825">Creates, updates, or deletes account metadata.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="obs_03_0021__p17653025171427"><strong id="obs_03_0021__b13684913">{account}</strong> indicates the name of an account.</p>
<p id="obs_03_0021__p50328998104943">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_0021__p295710317825">This operation does not involve a request body.</p>
</div>
<div class="section" id="obs_03_0021__section58521383"><h4 class="sectiontitle">Example Request</h4><p id="obs_03_0021__p64013355164243">Create or update metadata:</p>
</div>
<pre class="screen" id="obs_03_0021__screen38030582">curl -i $publicURL -X POST -H "X-Auth-Token:$token" -H "X-Account-Meta-name:value"</pre>
<p id="obs_03_0021__p729042716439">Delete metadata:</p>
<pre class="screen" id="obs_03_0021__screen37970583164331">curl -i $publicURL -X POST -H "X-Auth-Token:$token" -H "X-Remove-Account-Meta-name:value"</pre>
<div class="section" id="obs_03_0021__section45363461144314"><h4 class="sectiontitle">Request Query Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0021__table50561716144314" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_03_0021__row45973958144314"><th align="left" class="cellrowborder" valign="top" width="20.66%" id="mcps1.3.6.2.1.4.1.1"><p id="obs_03_0021__p32903079144314">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_0021__p28480451144314">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_0021__p25610510144314">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0021__row13798066144314"><td class="cellrowborder" valign="top" width="20.66%" headers="mcps1.3.6.2.1.4.1.1 "><p id="obs_03_0021__p43901557144314">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_0021__p66365237144314">String</p>
<p id="obs_03_0021__p60416223144314">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="64.94%" headers="mcps1.3.6.2.1.4.1.3 "><p id="obs_03_0021__p61875876144314">Bulk-deletes containers. This parameter is used with the deletion list file.</p>
<p id="obs_03_0021__p20011978144314">A maximum of 10,000 empty containers can be deleted at once.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_03_0021__section39956945"><h4 class="sectiontitle">Request Headers</h4><p id="obs_03_0021__p61625742152418">Request URI parameters</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0021__table17760770152418" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_03_0021__row7106630152418"><th align="left" class="cellrowborder" valign="top" width="20.66%" id="mcps1.3.7.3.1.4.1.1"><p id="obs_03_0021__p38766128152418">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_0021__p7675774152418">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_0021__p25603865152418">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0021__row8953941152418"><td class="cellrowborder" valign="top" width="20.66%" headers="mcps1.3.7.3.1.4.1.1 "><p id="obs_03_0021__p54180595152418">{account}</p>
</td>
<td class="cellrowborder" valign="top" width="14.399999999999999%" headers="mcps1.3.7.3.1.4.1.2 "><p id="obs_03_0021__p26552041152418">String</p>
<p id="obs_03_0021__p37641781152418">(Required)</p>
</td>
<td class="cellrowborder" valign="top" width="64.94%" headers="mcps1.3.7.3.1.4.1.3 "><p id="obs_03_0021__p29085411152418">A unique account name. In the current version, it indicates a unique ID for the account.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="obs_03_0021__p56236611152418">Request header parameters</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0021__table36367452152418" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_03_0021__row3553961152418"><th align="left" class="cellrowborder" valign="top" width="28.74%" id="mcps1.3.7.5.1.4.1.1"><p id="obs_03_0021__p19435463152418">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.97%" id="mcps1.3.7.5.1.4.1.2"><p id="obs_03_0021__p8482680152418">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.290000000000006%" id="mcps1.3.7.5.1.4.1.3"><p id="obs_03_0021__p9858267152418">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0021__row6028629152418"><td class="cellrowborder" valign="top" width="28.74%" headers="mcps1.3.7.5.1.4.1.1 "><p id="obs_03_0021__p18556922152418">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="17.97%" headers="mcps1.3.7.5.1.4.1.2 "><p id="obs_03_0021__p26715728152418">String</p>
<p id="obs_03_0021__p39114965152418">(Required)</p>
</td>
<td class="cellrowborder" valign="top" width="53.290000000000006%" headers="mcps1.3.7.5.1.4.1.3 "><p id="obs_03_0021__p14195574152418">Authentication token.</p>
</td>
</tr>
<tr id="obs_03_0021__row60651309152418"><td class="cellrowborder" valign="top" width="28.74%" headers="mcps1.3.7.5.1.4.1.1 "><p id="obs_03_0021__p60891321152620">X-Account-Meta-Temp-URL-Key</p>
</td>
<td class="cellrowborder" valign="top" width="17.97%" headers="mcps1.3.7.5.1.4.1.2 "><p id="obs_03_0021__p33249987152620">String</p>
<p id="obs_03_0021__p48214753152625">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="53.290000000000006%" headers="mcps1.3.7.5.1.4.1.3 "><p id="obs_03_0021__p8894417152620">Secret key value for TempURL.</p>
</td>
</tr>
<tr id="obs_03_0021__row28489674152543"><td class="cellrowborder" valign="top" width="28.74%" headers="mcps1.3.7.5.1.4.1.1 "><p id="obs_03_0021__p41579437152620">X-Account-Meta-Temp-URL-Key-2</p>
</td>
<td class="cellrowborder" valign="top" width="17.97%" headers="mcps1.3.7.5.1.4.1.2 "><p id="obs_03_0021__p12491254152620">String</p>
<p id="obs_03_0021__p24077077152634">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="53.290000000000006%" headers="mcps1.3.7.5.1.4.1.3 "><p id="obs_03_0021__p5158623152620">A second secret key value for TempURL.</p>
</td>
</tr>
<tr id="obs_03_0021__row63573785152554"><td class="cellrowborder" valign="top" width="28.74%" headers="mcps1.3.7.5.1.4.1.1 "><p id="obs_03_0021__p2539795152620">X-Account-Meta-name</p>
</td>
<td class="cellrowborder" valign="top" width="17.97%" headers="mcps1.3.7.5.1.4.1.2 "><p id="obs_03_0021__p4396868152620">String</p>
<p id="obs_03_0021__p39948648152636">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="53.290000000000006%" headers="mcps1.3.7.5.1.4.1.3 "><p id="obs_03_0021__p20602066152620">Account metadata. <strong id="obs_03_0021__b11209202210327">{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_0021__b112166222323">{name}</strong> empty in this header. You must specify an <strong id="obs_03_0021__b151859853693931">X-Account-Meta-{name}</strong> header for each metadata item (for each <strong id="obs_03_0021__b162145756393931">{name}</strong>) that you want to add, update, or delete.</p>
</td>
</tr>
<tr id="obs_03_0021__row48993042152554"><td class="cellrowborder" valign="top" width="28.74%" headers="mcps1.3.7.5.1.4.1.1 "><p id="obs_03_0021__p53629899152620">X-Remove-Account-Meta-name</p>
</td>
<td class="cellrowborder" valign="top" width="17.97%" headers="mcps1.3.7.5.1.4.1.2 "><p id="obs_03_0021__p49054526152620">String</p>
<p id="obs_03_0021__p4576070152638">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="53.290000000000006%" headers="mcps1.3.7.5.1.4.1.3 "><p id="obs_03_0021__p13993707152620">Deletes metadata. If a tool does not support empty headers, such as an earlier version of cURL, send this header to delete metadata. <strong id="obs_03_0021__b28240785">{name}</strong> indicates the metadata to delete. Set <strong id="obs_03_0021__b34741661593953">{name}</strong> to a non-empty value.</p>
</td>
</tr>
<tr id="obs_03_0021__row8411726201748"><td class="cellrowborder" valign="top" width="28.74%" headers="mcps1.3.7.5.1.4.1.1 "><p id="obs_03_0021__p10261199201748">X-Account-Meta-Quota-Bytes</p>
</td>
<td class="cellrowborder" valign="top" width="17.97%" headers="mcps1.3.7.5.1.4.1.2 "><p id="obs_03_0021__p22204726201816">Int</p>
<p id="obs_03_0021__p65624812201816">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="53.290000000000006%" headers="mcps1.3.7.5.1.4.1.3 "><p id="obs_03_0021__p13536469201748">Configures the tenant quota. The value ranges from 0 to 9223372036854775807. After setting the quota, the quota will be checked each time you upload or copy an object, or modify the metadata of an object or bucket. If a quota check fails, a status code 413 is returned.</p>
</td>
</tr>
<tr id="obs_03_0021__row8839337201751"><td class="cellrowborder" valign="top" width="28.74%" headers="mcps1.3.7.5.1.4.1.1 "><p id="obs_03_0021__p44897679201751">X-Remove-Account-Meta-Quota-Bytes</p>
</td>
<td class="cellrowborder" valign="top" width="17.97%" headers="mcps1.3.7.5.1.4.1.2 "><p id="obs_03_0021__p28351766201824">String</p>
<p id="obs_03_0021__p53839309201824">(Optional)</p>
</td>
<td class="cellrowborder" valign="top" width="53.290000000000006%" headers="mcps1.3.7.5.1.4.1.3 "><p id="obs_03_0021__p32873986201751">Deletes the quota. This parameter can be set to any non-empty value. If you delete a quota without setting it first, status code 403 is returned.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_03_0020.html">Create/Update/Delete Account Metadata</a></div>
</div>
</div>