Files
doc-exports/docs/obs/umn/en-us_topic_0049066876.html
zhangyue b55201d729 OBS UMN DOC
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2024-03-18 15:39:30 +00:00

68 lines
12 KiB
HTML

<a name="en-us_topic_0049066876"></a><a name="en-us_topic_0049066876"></a>
<h1 class="topictitle1">Object Metadata Overview</h1>
<div id="body1499753333227"><p id="en-us_topic_0049066876__p57782575145617">Object metadata is a set of name-value pairs that describe the object and is used for object management.</p>
<p id="en-us_topic_0049066876__p13189138161814">Currently, only the metadata defined by the system is supported.</p>
<p id="en-us_topic_0049066876__p2768182635920">The metadata defined by the system is classified into the following types: system-controlled and user-controlled. For example, metadata such as <strong id="en-us_topic_0049066876__b1558942811363">Last-Modified</strong> is controlled by the system and cannot be modified. You can call the API to modify the metadata such as <strong id="en-us_topic_0049066876__b2033616359364">ContentLanguage</strong>. The metadata that can be modified is described as follows:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0049066876__table63362710151941" frame="border" border="1" rules="all"><caption><b>Table 1 </b>OBS metadata</caption><thead align="left"><tr id="en-us_topic_0049066876__r40d16ee062c8406e9b4bfa133383394b"><th align="left" class="cellrowborder" valign="top" width="34.589999999999996%" id="mcps1.3.4.2.3.1.1"><p id="en-us_topic_0049066876__a5bcb1f27f2e6434482cec614651aa348">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="65.41%" id="mcps1.3.4.2.3.1.2"><p id="en-us_topic_0049066876__a1298648fc238467db505e62d55dce601">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0049066876__raeaa496cd5104fc7993613258270efa7"><td class="cellrowborder" valign="top" width="34.589999999999996%" headers="mcps1.3.4.2.3.1.1 "><p id="en-us_topic_0049066876__a0372510a577b45d3bd87af2da191354b">ContentDisposition</p>
</td>
<td class="cellrowborder" valign="top" width="65.41%" headers="mcps1.3.4.2.3.1.2 "><p id="en-us_topic_0049066876__ad2074dcb13754e11b486bc520171189d">Provides a default file name for the object that is being requested. When an object is being downloaded or accessed, the file with the default file name is directly displayed in the browser or a download dialog box is displayed if the file is being accessed.</p>
<p id="en-us_topic_0049066876__ac05b69907c674bcab5c4494f2ebb3afe">For example, select <strong id="en-us_topic_0049066876__b9579115015416">ContentDisposition</strong> as the metadata name and enter <strong id="en-us_topic_0049066876__b1758125011547">attachment;filename="testfile.xls"</strong> as the metadata value for an object. If you access the object through a link, a dialog box is directly displayed for downloading objects, and the object name is changed to <strong id="en-us_topic_0049066876__b165831750105419">testfile.xls</strong>. For details, see the definition about ContentDisposition in HTTP.</p>
</td>
</tr>
<tr id="en-us_topic_0049066876__r01c36a4b317a461293129ce020122bbe"><td class="cellrowborder" valign="top" width="34.589999999999996%" headers="mcps1.3.4.2.3.1.1 "><p id="en-us_topic_0049066876__en-us_topic_0047496338_p746994151941">ContentLanguage</p>
</td>
<td class="cellrowborder" valign="top" width="65.41%" headers="mcps1.3.4.2.3.1.2 "><p id="en-us_topic_0049066876__p1366173895810">Indicates the language or languages intended for the audience. Therefore, a user can differentiate according to the user's preferred language. For details, see the definition about ContentLanguage in HTTP.</p>
</td>
</tr>
<tr id="en-us_topic_0049066876__r168517bc0acb475fb3e6f23add45cf70"><td class="cellrowborder" valign="top" width="34.589999999999996%" headers="mcps1.3.4.2.3.1.1 "><p id="en-us_topic_0049066876__a4aa323a101b640fe87e364b6212b51ce">WebsiteRedirectLocation</p>
</td>
<td class="cellrowborder" valign="top" width="65.41%" headers="mcps1.3.4.2.3.1.2 "><p id="en-us_topic_0049066876__en-us_topic_0047496338_p297677011524">Redirects an object to another object or an external URL. The redirection function is implemented using static website hosting.</p>
<p id="en-us_topic_0049066876__p293004410328">For example, you can perform the following operations to implement object redirection:</p>
<ol id="en-us_topic_0049066876__ol64035022103214"><li id="en-us_topic_0049066876__li34498184103354">Set metadata of object <strong id="en-us_topic_0049066876__b3403178165515">testobject.html</strong> in the root directory of bucket <strong id="en-us_topic_0049066876__b144046825515">testbucket</strong>. Select <strong id="en-us_topic_0049066876__b18405585550">WebsiteRedirectLocation</strong> for <strong id="en-us_topic_0049066876__b54061586550">Name</strong> and enter <strong id="en-us_topic_0049066876__b18407128155519">http://www.example.com</strong> for <strong id="en-us_topic_0049066876__b34091884557">Value</strong>.<div class="note" id="en-us_topic_0049066876__note66951730103627"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="en-us_topic_0049066876__p65694662103627">OBS only supports redirection for objects in the root directory of a bucket. Redirection for objects located in folders of a bucket is not supported.</p>
</div></div>
</li><li id="en-us_topic_0049066876__li45119609103541">Configure static website hosting for bucket <strong id="en-us_topic_0049066876__b20224317114715">testbucket</strong>, and set the object <strong id="en-us_topic_0049066876__b4226191704715">testobject.html</strong> in the bucket as the default home page of the hosted static website.</li><li id="en-us_topic_0049066876__li39834343103214">If you access object <strong id="en-us_topic_0049066876__b537162135512">testobject.html</strong> through the URL link provided on the <strong id="en-us_topic_0049066876__b1337312105510">Configure Static Website Hosting</strong> page, the access request is redirected to <strong id="en-us_topic_0049066876__b1437682125516">http://www.example.com</strong>.</li></ol>
</td>
</tr>
<tr id="en-us_topic_0049066876__row1693347131513"><td class="cellrowborder" valign="top" width="34.589999999999996%" headers="mcps1.3.4.2.3.1.1 "><p id="en-us_topic_0049066876__p98743519161">ContentEncoding</p>
</td>
<td class="cellrowborder" valign="top" width="65.41%" headers="mcps1.3.4.2.3.1.2 "><p id="en-us_topic_0049066876__p1855932615315">Content encoding format when an object is downloaded. The options are as follows:</p>
<ul id="en-us_topic_0049066876__ul231450181911"><li id="en-us_topic_0049066876__li16311350111912">Standard: <strong id="en-us_topic_0049066876__b7257144816166">compress</strong>, <strong id="en-us_topic_0049066876__b13373155117162">deflate</strong>, <strong id="en-us_topic_0049066876__b1248785413160">exi</strong>, <strong id="en-us_topic_0049066876__b20326113191710">identity</strong>, <strong id="en-us_topic_0049066876__b42461662172">gzip</strong>, and <strong id="en-us_topic_0049066876__b16561310131714">pack200-gzip</strong></li><li id="en-us_topic_0049066876__li1757781852014">Others: <strong id="en-us_topic_0049066876__b591981817179">br</strong>, <strong id="en-us_topic_0049066876__b17202192111174">bzip2</strong>, <strong id="en-us_topic_0049066876__b18285224141713">lzma</strong>, <strong id="en-us_topic_0049066876__b3823192651712">peerdist</strong>, <strong id="en-us_topic_0049066876__b634143019176">sdch</strong>, <strong id="en-us_topic_0049066876__b78512032191714">xpress</strong>, <strong id="en-us_topic_0049066876__b86609347179">xz</strong></li></ul>
</td>
</tr>
<tr id="en-us_topic_0049066876__row16550105011519"><td class="cellrowborder" valign="top" width="34.589999999999996%" headers="mcps1.3.4.2.3.1.1 "><p id="en-us_topic_0049066876__p108795510169">CacheControl</p>
</td>
<td class="cellrowborder" valign="top" width="65.41%" headers="mcps1.3.4.2.3.1.2 "><p id="en-us_topic_0049066876__p148809571619">Cache behavior of the web page when the specified object is downloaded.</p>
<ul id="en-us_topic_0049066876__ul145952034131411"><li id="en-us_topic_0049066876__li45953349147">Cacheability: <strong id="en-us_topic_0049066876__b1340110266181">public</strong>, <strong id="en-us_topic_0049066876__b59171528111816">private</strong>, <strong id="en-us_topic_0049066876__b693143121817">no-cache</strong>, and <strong id="en-us_topic_0049066876__b69571236201819">only-if-cached</strong></li><li id="en-us_topic_0049066876__li8564445111817">Expiration time: <strong id="en-us_topic_0049066876__b15932459131811">max-age=&lt;</strong><strong id="en-us_topic_0049066876__b39321159201812"><em id="en-us_topic_0049066876__i15661445201816">seconds</em></strong><strong id="en-us_topic_0049066876__b793275951820">&gt;</strong>, <strong id="en-us_topic_0049066876__b19148191113192">s-maxage=&lt;</strong><strong id="en-us_topic_0049066876__b7148911141919"><em id="en-us_topic_0049066876__i85667452183">seconds</em></strong><strong id="en-us_topic_0049066876__b1114810111191">&gt;</strong>, <strong id="en-us_topic_0049066876__b418721915197">max-stale[=&lt;</strong><strong id="en-us_topic_0049066876__b181871619101914"><em id="en-us_topic_0049066876__i4566104551813">seconds</em></strong><strong id="en-us_topic_0049066876__b17187121919190">&gt;]</strong>, <strong id="en-us_topic_0049066876__b14721825111917">min-fresh=&lt;</strong><strong id="en-us_topic_0049066876__b1072132511195"><em id="en-us_topic_0049066876__i195661645111818">seconds</em></strong><strong id="en-us_topic_0049066876__b12721025131917">&gt;</strong>, <strong id="en-us_topic_0049066876__b895493261919">stale-while-revalidate=&lt;</strong><strong id="en-us_topic_0049066876__b1495433214191"><em id="en-us_topic_0049066876__i656610454187">seconds</em></strong><strong id="en-us_topic_0049066876__b1995415329197">&gt;</strong>, <strong id="en-us_topic_0049066876__b78011243131915">stale-if-error=&lt;</strong><strong id="en-us_topic_0049066876__b6801114341920"><em id="en-us_topic_0049066876__i156624581820">seconds</em></strong><strong id="en-us_topic_0049066876__b9801943171920">&gt;</strong></li><li id="en-us_topic_0049066876__li1082973214152">Re-verification and reloading: <strong id="en-us_topic_0049066876__b287981212010">must-revalidate</strong>, <strong id="en-us_topic_0049066876__b9700121619201">proxy-revalidate</strong>, <strong id="en-us_topic_0049066876__b9619220102011">immutable</strong></li><li id="en-us_topic_0049066876__li16664103121920">Others: <strong id="en-us_topic_0049066876__b189844289203">no-store</strong>, <strong id="en-us_topic_0049066876__b1260123212203">no-transform</strong></li></ul>
</td>
</tr>
<tr id="en-us_topic_0049066876__row8711105710150"><td class="cellrowborder" valign="top" width="34.589999999999996%" headers="mcps1.3.4.2.3.1.1 "><p id="en-us_topic_0049066876__p198826515166">Expires</p>
</td>
<td class="cellrowborder" valign="top" width="65.41%" headers="mcps1.3.4.2.3.1.2 "><p id="en-us_topic_0049066876__p38836541617">Cache expiration time (GMT)</p>
</td>
</tr>
<tr id="en-us_topic_0049066876__row149810548157"><td class="cellrowborder" valign="top" width="34.589999999999996%" headers="mcps1.3.4.2.3.1.1 "><p id="en-us_topic_0049066876__p168871452165">ContentType</p>
</td>
<td class="cellrowborder" valign="top" width="65.41%" headers="mcps1.3.4.2.3.1.2 "><p id="en-us_topic_0049066876__p788817518165">File type of an object. For details, see <a href="obs_03_0102.html">About Object Metadata Content-Type</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="en-us_topic_0049066876__note31593131154710"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="en-us_topic_0049066876__ul15902730154710"><li id="en-us_topic_0049066876__li8906846154710">When versioning is enabled for a bucket, you can set metadata for objects which are <strong id="en-us_topic_0049066876__b127559824155347">Latest Version</strong>, but cannot set metadata for objects which are <strong id="en-us_topic_0049066876__b74712712155347">Historical Version</strong>.</li><li id="en-us_topic_0049066876__li50365905154710">Metadata cannot be configured for Cold objects.</li></ul>
</div></div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_03_0323.html">Object Metadata</a></div>
</div>
</div>