forked from docs/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: weihongmin1 <weihongmin1@huawei.com> Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
166 lines
13 KiB
HTML
166 lines
13 KiB
HTML
<a name="obs_11_0015"></a><a name="obs_11_0015"></a>
|
|
|
|
<h1 class="topictitle1">Querying Object Properties</h1>
|
|
<div id="body1542943180896"><div class="section" id="obs_11_0015__section444185010363"><h4 class="sectiontitle">Function</h4><p id="obs_11_0015__p582517539363">You can use this command to query the basic properties of an object.</p>
|
|
</div>
|
|
<div class="section" id="obs_11_0015__section1220752192216"><h4 class="sectiontitle">Command Line Structure</h4><ul id="obs_11_0015__ul0881135973713"><li id="obs_11_0015__li988185914376">In Windows<pre class="screen" id="obs_11_0015__screen12694238385">obsutil stat obs://bucket/key [-acl][-bf=xxx] [-config=xxx] </pre>
|
|
</li><li id="obs_11_0015__li24704153817">In Linux or macOS<pre class="screen" id="obs_11_0015__screen937611292388">./obsutil stat obs://bucket/key [-acl][-bf=xxx] [-config=xxx] </pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="obs_11_0015__section765204912352"><h4 class="sectiontitle">Examples</h4><ul id="obs_11_0015__ul1965184915352"><li id="obs_11_0015__li106664918359">Take the Windows OS as an example. Run the <strong id="obs_11_0015__b457411313143">obsutil stat obs://bucket-test/key</strong> command to query the basic properties of an object.<pre class="screen" id="obs_11_0015__screen26654953516"><strong id="obs_11_0015__b1366349173516">obsutil stat obs://bucket-test/key</strong>
|
|
|
|
Start at 2024-09-25 04:48:10.1147483 +0000 UTC
|
|
|
|
Key:
|
|
obs://bucket-test/key
|
|
LastModified:
|
|
2018-11-16T02:15:49Z
|
|
Size:
|
|
7
|
|
StorageClass:
|
|
standard
|
|
ETag:
|
|
43d93b553855b0e1fc67e31c28c07b65
|
|
ContentType:
|
|
text/plain
|
|
Type:
|
|
file
|
|
Metadata:
|
|
key=value</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="obs_11_0015__section6559191102418"><h4 class="sectiontitle">Parameter Description</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_11_0015__table10831182114445" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_11_0015__row683212154419"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.1.4.1.1"><p id="obs_11_0015__p118329219446">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="27%" id="mcps1.3.4.2.1.4.1.2"><p id="obs_11_0015__p15137125919108">Optional or Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="56.00000000000001%" id="mcps1.3.4.2.1.4.1.3"><p id="obs_11_0015__p12832121184414">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_11_0015__row108328217449"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0015__p64495172515">bucket</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0015__p154316502519">Mandatory</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.00000000000001%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0015__p17425512259">The name of the bucket to which an object belongs</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row178507135421"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0015__p18851121313427">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0015__p1285119130421">Mandatory</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.00000000000001%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0015__p1685111317426">The name of the object whose attributes are to be queried</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row1542113212124"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0015__p814111533115">acl</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0015__p181412534110">Optional</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.00000000000001%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0015__p20141165311112">Queries the access control policies of the object at the same time.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row11249230184216"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0015__p11249183064217">bf</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0015__p10301510184317">Optional (additional parameter)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.00000000000001%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0015__p1930171012438">The display format of the object size (in bytes). Possible values are:</p>
|
|
<ul id="obs_11_0015__en-us_topic_0000001871061785_obs_11_0010_ul1273864144412"><li id="obs_11_0015__en-us_topic_0000001871061785_obs_11_0010_li17738649445"><strong id="obs_11_0015__b94884120914">human-readable</strong>: The object size is displayed in a human-readable format. For example, the object size is displayed in KB, MB, GB, or TB (for instance, 1 GB), rather than in bytes (for instance, 1,073,741,824 bytes, which is a very large number).</li><li id="obs_11_0015__en-us_topic_0000001871061785_obs_11_0010_li1551213137447"><strong id="obs_11_0015__b9290171613917">raw</strong>: The number of bytes is displayed without any conversion or formatting. For example, if the space occupied by an object is 1 GB, the object size is displayed as 1,073,741,824 bytes.</li></ul>
|
|
<p id="obs_11_0015__p66619355810">For common users, the <strong id="obs_11_0015__b1561011483917">human-readable</strong> format is easier to understand. For scenarios where accurate calculation or automatic processing is required, the <strong id="obs_11_0015__b771641951010">raw</strong> format is more suitable.</p>
|
|
<p id="obs_11_0015__p65632013016">If this parameter is not configured, the display format of the object size (in bytes) is determined by the <strong id="obs_11_0015__b5904932181014">humanReadableFormat</strong> parameter in the configuration file.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row181318394179"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0015__p114391014518">bucket-cname</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0015__p4143210950">Optional (additional parameter)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.00000000000001%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0015__p16143610251">The user-defined domain name bound to the bucket</p>
|
|
<div class="note" id="obs_11_0015__note16256574591"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0015__p172595719595">This parameter is only supported by obsutil 5.7.9 and later.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row17576193493515"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0015__p153951131317">config</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0015__p12395135316">Optional (additional parameter)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.00000000000001%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0015__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_0015__row1533964644016"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0015__p1966666191820">payer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0015__p1266611611820">Optional (additional parameter)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.00000000000001%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0015__p1166617619181">Specifies that requester pays is enabled.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_11_0015__section6926520122416"><h4 class="sectiontitle">Response</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_11_0015__table992610203244" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_11_0015__row892913208248"><th align="left" class="cellrowborder" valign="top" width="21.67%" id="mcps1.3.5.2.1.3.1.1"><p id="obs_11_0015__p1392992019245">Field</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="78.33%" id="mcps1.3.5.2.1.3.1.2"><p id="obs_11_0015__p19318207246">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_11_0015__row79320208248"><td class="cellrowborder" valign="top" width="21.67%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0015__p1093217203246">Key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.33%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0015__p169337207245">The object name</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row1753615812247"><td class="cellrowborder" valign="top" width="21.67%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0015__p15536155820245">LastModified</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.33%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0015__p3536758162410">The latest modification time of the object</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row1272082862513"><td class="cellrowborder" valign="top" width="21.67%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0015__p4720528142516">Size</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.33%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0015__p8798185963315">The object size</p>
|
|
<p id="obs_11_0015__p872012286252">Unit: byte</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row11100149145919"><td class="cellrowborder" valign="top" width="21.67%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0015__p210114914596">StorageClass</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.33%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0015__p11011093596">The storage class of the object</p>
|
|
<p id="obs_11_0015__en-us_topic_0000001871061785_obs_11_0041_p86547153813">Possible values are:</p>
|
|
<ul id="obs_11_0015__en-us_topic_0000001871061785_obs_11_0041_ul175651814214"><li id="obs_11_0015__en-us_topic_0000001871061785_obs_11_0041_li1256512172114"><strong id="obs_11_0015__b1944917476157">standard</strong>: Standard storage class. It features low access latency and high throughput, and is applicable to storing frequently accessed data (multiple accesses per month) or data that is smaller than 1 MB.</li><li id="obs_11_0015__en-us_topic_0000001871061785_obs_11_0041_li10565181142113"><strong id="obs_11_0015__b26841581179">warm</strong>: Warm storage class. It is ideal for storing infrequently accessed (less than 12 times a year) data, but when needed, the access has to be fast.</li><li id="obs_11_0015__en-us_topic_0000001871061785_obs_11_0041_li756616110216"><strong id="obs_11_0015__b18144101301815">cold</strong>: Cold storage class. It provides secure, durable, and inexpensive storage for rarely-accessed (once a year) data. <strong id="obs_11_0015__b14308135617219">For an object whose storage class is cold, restore the object first and then specify its storage class.</strong></li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row10250185112481"><td class="cellrowborder" valign="top" width="21.67%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0015__p1525135124814">MD5</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.33%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0015__p930919517495">Real MD5 of the object. This parameter is used to ensure and verify data integrity.</p>
|
|
<p id="obs_11_0015__p19250153010474">You can query this value only after running the <strong id="obs_11_0015__b16845183220238">cp</strong> command and configuring the <strong id="obs_11_0015__b15845183219230">-vmd5</strong> parameter.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row48453315255"><td class="cellrowborder" valign="top" width="21.67%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0015__p14845531172510">ETag</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.33%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0015__p11845131182516">The ETag value of an object calculated on the server</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row714915616589"><td class="cellrowborder" valign="top" width="21.67%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0015__p141743597587">ContentType</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.33%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0015__p10174175975817">The file type of an object. It determines the format and encoding method a browser will use to read the file.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row13393853182112"><td class="cellrowborder" valign="top" width="21.67%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0015__p93933538211">Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.33%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0015__p1739315312114">The file type</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_11_0015__row9438135064914"><td class="cellrowborder" valign="top" width="21.67%" headers="mcps1.3.5.2.1.3.1.1 "><p id="obs_11_0015__p14438550144911">Metadata</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.33%" headers="mcps1.3.5.2.1.3.1.2 "><p id="obs_11_0015__p184387501497">The user-defined metadata of the object. This field can be queried only when the object has user-defined metadata.</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>
|
|
|