forked from docs/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
371 lines
28 KiB
HTML
371 lines
28 KiB
HTML
<a name="obs_04_0091"></a><a name="obs_04_0091"></a>
|
|
|
|
<h1 class="topictitle1">Modifying Object Metadata</h1>
|
|
<div id="body1540457671959"><div class="section" id="obs_04_0091__section5584184924715"><h4 class="sectiontitle">Functions</h4><p id="obs_04_0091__p12384203811536">This operation modifies, deletes, or adds metadata to uploaded objects in a bucket.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section87117516572"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0091__screen49284209"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/ObjectName?metadata<span class="w"> </span>HTTP/1.1<span class="w"> </span>
|
|
Host:<span class="w"> </span>bucketname.obs.region.example.com
|
|
Content-Type:<span class="w"> </span>application/xml<span class="w"> </span>
|
|
Content-Length:<span class="w"> </span>length
|
|
Authorization:<span class="w"> </span>authorization
|
|
Date:<span class="w"> </span>date
|
|
<span class="nt"><Optional</span><span class="w"> </span><span class="err">Additional</span><span class="w"> </span><span class="err">Header</span><span class="nt">></span><span class="w"> </span>
|
|
<span class="nt"><object</span><span class="w"> </span><span class="err">Content</span><span class="nt">></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section1335357115716"><h4 class="sectiontitle">Request Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0091__table58067199194414" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameters</caption><thead align="left"><tr id="obs_04_0091__row47703054"><th align="left" class="cellrowborder" valign="top" width="22.220000000000002%" id="mcps1.3.3.2.2.4.1.1"><p id="obs_04_0091__p38742141">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="62.629999999999995%" id="mcps1.3.3.2.2.4.1.2"><p id="obs_04_0091__p57298161">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.15%" id="mcps1.3.3.2.2.4.1.3"><p id="obs_04_0091__p28645973">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0091__row12058206"><td class="cellrowborder" valign="top" width="22.220000000000002%" headers="mcps1.3.3.2.2.4.1.1 "><p id="obs_04_0091__p37190649">versionId</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="62.629999999999995%" headers="mcps1.3.3.2.2.4.1.2 "><p id="obs_04_0091__p59652605">Object version ID</p>
|
|
<p id="obs_04_0091__p2533">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.15%" headers="mcps1.3.3.2.2.4.1.3 "><p id="obs_04_0091__p205208">No</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section97291350155820"><h4 class="sectiontitle">Request Headers</h4><div class="note" id="obs_04_0091__note2117145210101"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_04_0091__p12117135221013">OBS supports the six HTTP request headers: Cache-Control, Expires, Content-Encoding, Content-Disposition, Content-Type, and Content-Language. It saves these header values in the metadata of the object. When the object is downloaded or queried, the saved values are set for corresponding HTTP headers and returned to the client.</p>
|
|
</div></div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0091__table61280977212224" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request headers</caption><thead align="left"><tr id="obs_04_0091__row15136906"><th align="left" class="cellrowborder" valign="top" width="19.388061193880613%" id="mcps1.3.4.3.2.4.1.1"><p id="obs_04_0091__p18129858">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="63.26367363263674%" id="mcps1.3.4.3.2.4.1.2"><p id="obs_04_0091__p59232370">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.4.3.2.4.1.3"><p id="obs_04_0091__p33092675">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0091__row724013513136"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p3240151101314">x-obs-metadata-directive</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p192401251101314">Metadata operation indicator.</p>
|
|
<p id="obs_04_0091__p143311921115918">The value can be <strong id="obs_04_0091__b4951643195611">REPLACE_NEW</strong> or <strong id="obs_04_0091__b1446884610566">REPLACE</strong>.</p>
|
|
<p id="obs_04_0091__p661749111510"><strong id="obs_04_0091__b879416554564">REPLACE_NEW</strong>: The metadata that has an existing value is replaced. A value is assigned to the metadata that does not have a value. The metadata that is not specified remains unchanged. (Note: a header with custom metadata is replaced.)</p>
|
|
<p id="obs_04_0091__p162133337141"><strong id="obs_04_0091__b26327426576">REPLACE</strong>: Use the header field carried in the current request to replace the original metadata. The metadata that is not specified (except <strong id="obs_04_0091__b81201210145816">x-obs-storage-class</strong>) will be deleted.</p>
|
|
<p id="obs_04_0091__p1198745435912">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p1624075161312">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row63261020"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p23869030">Cache-Control</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p54343305">Specifies the cache behavior of the web page when the object is downloaded.</p>
|
|
<p id="obs_04_0091__p19327699">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p22039757">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row64140087"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p1843814391213">Content-Disposition</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p154381636122">Specifies the name of the object when it is downloaded.</p>
|
|
<p id="obs_04_0091__p771129161910">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p131716593257">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row56307738"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p10438133128">Content-Encoding</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p18438113191212">Specifies the content encoding format when an object is being downloaded.</p>
|
|
<p id="obs_04_0091__p9149531151911">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p55120132614">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row6380420"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p642411331211">Content-Language</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p1424937129">Specifies the content language format when an object is downloaded.</p>
|
|
<p id="obs_04_0091__p1796118322193">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p386400182617">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row61132595"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p142413311122">Content-Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p1042414311120">Object file type.</p>
|
|
<p id="obs_04_0091__p18743173417195">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p94585182615">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row6969192931217"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p1496972917125">Expires</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p896916292120">Specifies the cache expiration time of the web page when the object is downloaded.</p>
|
|
<p id="obs_04_0091__p3898336191913">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p115736267">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row24693334128"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p17469233151218">x-obs-website-redirect-location</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p54569953">When the bucket is configured with the website redirection, the request for obtaining the object can be redirected to another object or an external URL in the bucket.</p>
|
|
<p id="obs_04_0091__p21367535">In the following example, the request header sets the redirection to an object (<strong id="obs_04_0091__b1723225149">anotherPage.html</strong>) in the same bucket:</p>
|
|
<p id="obs_04_0091__p58090092">x-obs-website-redirect-location:/anotherPage.html</p>
|
|
<p id="obs_04_0091__p53048785">In the following example, the request header sets the object redirection to an external URL:</p>
|
|
<p id="obs_04_0091__p7677024">x-obs-website-redirect-location:http://www.example.com/</p>
|
|
<p id="obs_04_0091__p1984352">Type: string</p>
|
|
<p id="obs_04_0091__p26514819">Constraint: The value must be prefixed by a slash (/), <strong id="obs_04_0091__b456419220472">http://</strong>, or <strong id="obs_04_0091__b165661028471">https://</strong>. The length of the value cannot exceed 2 KB.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p105214362610">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row19438101181314"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p94381513131">x-obs-storage-class</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p3110729">Specifies the storage class of an object.</p>
|
|
<p id="obs_04_0091__p27996566">Type: string</p>
|
|
<p id="obs_04_0091__p14339210104117">Storage class options: <strong id="obs_04_0091__b1761818361400">STANDARD</strong> (Standard), <strong id="obs_04_0091__b166191536803">WARM</strong> (Warm), <strong id="obs_04_0091__b2619163611019">COLD</strong> (Cold). These values are case sensitive.</p>
|
|
<p id="obs_04_0091__p53129340">Example: <strong id="obs_04_0091__b1362711521274">x-obs-storage-class: STANDARD</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p22246592613">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row1558441015133"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0091__p3584141041311">x-obs-meta-*</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.26367363263674%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0091__p358517513574">A message header starting with <strong id="obs_04_0091__b1670013616210">x-obs-meta-</strong> can be added to a request to add custom metadata for object management. Custom metadata will be returned in the response header when you retrieve or query the metadata of the object. </p>
|
|
<p id="obs_04_0091__p20610280">Type: string</p>
|
|
<p id="obs_04_0091__p58819972">Example: <strong id="obs_04_0091__b49169561172">x-obs-meta-test: test metadata</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0091__p97390511263">No</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section104962134593"><h4 class="sectiontitle">Request Elements</h4><p id="obs_04_0091__p1015132214">This request involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section18199326165917"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0091__screen3213824"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>status_code
|
|
Date:<span class="w"> </span>date
|
|
Content-Length:<span class="w"> </span>length
|
|
Etag:<span class="w"> </span>etag
|
|
Last-Modified:<span class="w"> </span>time
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section66401511596"><h4 class="sectiontitle">Response Headers</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0091__table165543915196" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Additional response headers</caption><thead align="left"><tr id="obs_04_0091__row35547917199"><th align="left" class="cellrowborder" valign="top" width="23.46%" id="mcps1.3.7.2.2.3.1.1"><p id="obs_04_0091__p105541892192">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="76.53999999999999%" id="mcps1.3.7.2.2.3.1.2"><p id="obs_04_0091__p175548951915">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0091__row185541921912"><td class="cellrowborder" valign="top" width="23.46%" headers="mcps1.3.7.2.2.3.1.1 "><p id="obs_04_0091__p55711799196">x-obs-metadata-directive</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.53999999999999%" headers="mcps1.3.7.2.2.3.1.2 "><p id="obs_04_0091__p1657119171910">Metadata operation indicator.</p>
|
|
<p id="obs_04_0091__p55717911914">The value can be <strong id="obs_04_0091__b12844407313">REPLACE_NEW</strong> or <strong id="obs_04_0091__b168614401039">REPLACE</strong>.</p>
|
|
<p id="obs_04_0091__p45711198191">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row25718961910"><td class="cellrowborder" valign="top" width="23.46%" headers="mcps1.3.7.2.2.3.1.1 "><p id="obs_04_0091__p175719912194">Cache-Control</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.53999999999999%" headers="mcps1.3.7.2.2.3.1.2 "><p id="obs_04_0091__p257110918190">Specifies the cache behavior of the web page when the object is downloaded. If a request carries this header field, the response message must contain this header field.</p>
|
|
<p id="obs_04_0091__p75711499192">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row6571149191911"><td class="cellrowborder" valign="top" width="23.46%" headers="mcps1.3.7.2.2.3.1.1 "><p id="obs_04_0091__p457117916191">Content-Disposition</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.53999999999999%" headers="mcps1.3.7.2.2.3.1.2 "><p id="obs_04_0091__p65717951918">Specifies the name of the object when it is downloaded. If a request carries this header field, the response message must contain this header field.</p>
|
|
<p id="obs_04_0091__p657118913191">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row185718915191"><td class="cellrowborder" valign="top" width="23.46%" headers="mcps1.3.7.2.2.3.1.1 "><p id="obs_04_0091__p8585195199">Content-Encoding</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.53999999999999%" headers="mcps1.3.7.2.2.3.1.2 "><p id="obs_04_0091__p6585109121913">Specifies the content encoding format when an object is being downloaded. If a request carries this header field, the response message must contain this header field.</p>
|
|
<p id="obs_04_0091__p15585149161911">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row858510921918"><td class="cellrowborder" valign="top" width="23.46%" headers="mcps1.3.7.2.2.3.1.1 "><p id="obs_04_0091__p65851998198">Content-Language</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.53999999999999%" headers="mcps1.3.7.2.2.3.1.2 "><p id="obs_04_0091__p125854931918">Specifies the content language format when an object is downloaded. If a request carries this header field, the response message must contain this header field.</p>
|
|
<p id="obs_04_0091__p6585129101913">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row1060218911916"><td class="cellrowborder" valign="top" width="23.46%" headers="mcps1.3.7.2.2.3.1.1 "><p id="obs_04_0091__p20602109111914">Expires</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.53999999999999%" headers="mcps1.3.7.2.2.3.1.2 "><p id="obs_04_0091__p1560216971917">Specifies the cache expiration time of the web page when the object is downloaded. If a request carries this header field, the response message must contain this header field.</p>
|
|
<p id="obs_04_0091__p17602597193">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row19602129161914"><td class="cellrowborder" valign="top" width="23.46%" headers="mcps1.3.7.2.2.3.1.1 "><p id="obs_04_0091__p18602697195">x-obs-website-redirect-location</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.53999999999999%" headers="mcps1.3.7.2.2.3.1.2 "><p id="obs_04_0091__p1860209101917">When the bucket is configured with the website redirection, the request for obtaining the object can be redirected to another object or an external URL in the bucket. If a request carries this header field, the response message must contain this header field.</p>
|
|
<p id="obs_04_0091__p36020917190">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row96029951913"><td class="cellrowborder" valign="top" width="23.46%" headers="mcps1.3.7.2.2.3.1.1 "><p id="obs_04_0091__p136028941918">x-obs-storage-class</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.53999999999999%" headers="mcps1.3.7.2.2.3.1.2 "><p id="obs_04_0091__p10602491191">Specifies the storage class of an object. If a request carries this header field, the response message must contain this header field.</p>
|
|
<p id="obs_04_0091__p1560279111910">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0091__row0617159171910"><td class="cellrowborder" valign="top" width="23.46%" headers="mcps1.3.7.2.2.3.1.1 "><p id="obs_04_0091__p106177910199">x-obs-meta-*</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.53999999999999%" headers="mcps1.3.7.2.2.3.1.2 "><p id="obs_04_0091__p20617696199">Custom metadata is used to manage objects in a customized manner. If a request carries this header field, the response message must contain this header field.</p>
|
|
<p id="obs_04_0091__p17617596196">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section107960298020"><h4 class="sectiontitle">Response Elements</h4><p id="obs_04_0091__p15500174120">This response contains no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section7010441604"><h4 class="sectiontitle">Error Responses</h4><p id="obs_04_0091__p1170348119">No special error responses are returned. 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_0091__section1797652710587"><h4 class="sectiontitle">Sample Request: Adding Metadata for an Object</h4><p id="obs_04_0091__p792612321102">Add the following metadata to the object: <strong id="obs_04_0091__b7701614061">Content-Type:application/zip</strong> and <strong id="obs_04_0091__b67941217662">x-obs-meta-test:meta</strong>.</p>
|
|
<div class="codecoloring" codetype="Xml" id="obs_04_0091__screen41281918122116"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span>
|
|
<span class="normal">9</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/object?metadata<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<span class="w"> </span>*/*
|
|
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>14:24:33<span class="w"> </span>GMT
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
|
|
x-obs-metadata-directive:REPLACE_NEW
|
|
Content-Type:application/zip
|
|
x-obs-meta-test:meta
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section1634411453444"><h4 class="sectiontitle">Sample Response: Adding Metadata for an Object</h4><div class="codecoloring" codetype="Xml" id="obs_04_0091__screen91063375488"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span>
|
|
<span class="normal">9</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK
|
|
Server:<span class="w"> </span>OBS
|
|
x-obs-request-id:<span class="w"> </span>8DF400000163D3E4BB5905C41B6E65B6
|
|
Accept-Ranges:<span class="w"> </span>bytes
|
|
x-obs-id-2:<span class="w"> </span>32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSD3nAiTaBoeyt9oHp9vTYtXnLDmwV6D
|
|
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>04:19:21<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
x-obs-metadata-directive:REPLACE_NEW
|
|
x-obs-meta-test:meta
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section5110811174511"><h4 class="sectiontitle">Sample Request: Editing Metadata of an Object</h4><p id="obs_04_0091__p12953131514618">If metadata <strong id="obs_04_0091__b206081835154617">x-obs-meta-test:testmeta</strong> exists in the object and the value of <strong id="obs_04_0091__b66131735184615">x-obs-storage-class</strong> is <strong id="obs_04_0091__b0613133524613">WARM</strong>, change the metadata <strong id="obs_04_0091__b186141035114613">x-obs-meta-test</strong> of the object to <strong id="obs_04_0091__b14614203514466">newmeta</strong> and change <strong id="obs_04_0091__b1461443510462">x-obs-storage-class</strong> to <strong id="obs_04_0091__b361463514467">COLD</strong>.</p>
|
|
<div class="codecoloring" codetype="Xml" id="obs_04_0091__screen1533681895619"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span>
|
|
<span class="normal">9</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/object?metadata<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<span class="w"> </span>*/*
|
|
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>14:24:33<span class="w"> </span>GMT
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
|
|
x-obs-metadata-directive:REPLACE_NEW
|
|
x-obs-meta-test:newmeta
|
|
x-obs-storage-class:COLD
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section181718381456"><h4 class="sectiontitle">Sample Response: Editing Metadata of an Object</h4><div class="codecoloring" codetype="Xml" id="obs_04_0091__screen5311811121216"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
|
<span class="normal"> 2</span>
|
|
<span class="normal"> 3</span>
|
|
<span class="normal"> 4</span>
|
|
<span class="normal"> 5</span>
|
|
<span class="normal"> 6</span>
|
|
<span class="normal"> 7</span>
|
|
<span class="normal"> 8</span>
|
|
<span class="normal"> 9</span>
|
|
<span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK
|
|
Server:<span class="w"> </span>OBS
|
|
x-obs-request-id:<span class="w"> </span>8DF400000163D3E4BB5905C41B6E65B6
|
|
Accept-Ranges:<span class="w"> </span>bytes
|
|
x-obs-id-2:<span class="w"> </span>32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSD3nAiTaBoeyt9oHp9vTYtXnLDmwV6D
|
|
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>04:19:21<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
x-obs-metadata-directive:REPLACE_NEW
|
|
x-obs-meta-test:newmeta
|
|
x-obs-storage-class:COLD
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section588454394519"><h4 class="sectiontitle">Sample Request: Deleting Metadata of an Object</h4><p id="obs_04_0091__p19671119141312">Metadata <strong id="obs_04_0091__b128084214612">x-obs-meta-test:newmeta</strong> and <strong id="obs_04_0091__b9851142194616">Content-Type:application/zip</strong> exist in the object, and delete <strong id="obs_04_0091__b4856429467">x-obs-meta-test</strong>.</p>
|
|
<div class="codecoloring" codetype="Xml" id="obs_04_0091__screen1592817231416"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/object?metadata<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<span class="w"> </span>*/*
|
|
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>14:24:33<span class="w"> </span>GMT
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
|
|
x-obs-metadata-directive:REPLACE
|
|
Content-Type:application/zip
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0091__section99685499019"><h4 class="sectiontitle">Sample Response: Deleting Metadata of an Object</h4><div class="codecoloring" codetype="Xml" id="obs_04_0091__screen115112819173"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK
|
|
Server:<span class="w"> </span>OBS
|
|
x-obs-request-id:<span class="w"> </span>8DF400000163D3E4BB5905C41B6E65B6
|
|
Accept-Ranges:<span class="w"> </span>bytes
|
|
x-obs-id-2:<span class="w"> </span>32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSD3nAiTaBoeyt9oHp9vTYtXnLDmwV6D
|
|
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>04:19:21<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
x-obs-metadata-directive:REPLACE
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0079.html">Operations on Objects</a></div>
|
|
</div>
|
|
</div>
|
|
|