Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: weihongmin1 <weihongmin1@huawei.com> Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
13 KiB
Querying Object Properties
Function
You can use this command to query the basic properties of an object.
Command Line Structure
- Windows
obsutil stat obs://bucket/key [-acl][-bf=xxx] [-config=xxx]
- macOS or Linux
./obsutil stat obs://bucket/key [-acl][-bf=xxx] [-config=xxx]
Examples
- In Windows, run obsutil stat obs://bucket-test/key to query the basic properties of an object.
obsutil stat obs://bucket-test/key 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
Parameter Description
Parameter |
Optional or Mandatory |
Description |
|---|---|---|
bucket |
Mandatory |
The name of the bucket to which an object belongs |
key |
Mandatory |
The name of the object whose attributes are to be queried |
acl |
Optional |
Queries the access control policies of the object at the same time. |
bf |
Optional (additional parameter) |
The display format of the object size (in bytes). The value can be:
For common users, the human-readable format is easier to understand. For scenarios where accurate calculation or automatic processing is required, the raw format is more suitable. If this parameter is not configured, the display format of the object size (in bytes) is determined by the humanReadableFormat parameter in the configuration file. |
bucket-cname |
Optional (additional parameter) |
The user-defined domain name bound to the bucket NOTE:
This parameter is only supported by obsutil 5.7.9 and later. |
config |
Optional (additional parameter) |
The user-defined configuration file for executing the current command. For details about parameters that can be configured, see Configuration Parameters. |
payer |
Optional (additional parameter) |
Specifies that requester pays is enabled. Range: requester |
Response
Field |
Description |
|---|---|
Key |
The object name |
LastModified |
The latest modification time of the object |
Size |
The object size Unit: byte |
StorageClass |
The storage class of the object The value can be:
|
MD5 |
Real MD5 of the object. This parameter is used to ensure and verify data integrity. You can query this value only after running the cp command and configuring the -vmd5 parameter. |
ETag |
The ETag value of an object calculated on the server |
ContentType |
The file type of an object. It determines the format and encoding method a browser will use to read the file. |
Type |
The file type |
Metadata |
The user-defined metadata of the object. This field can be queried only when the object has user-defined metadata. |