Querying Object Properties
Function
You can use this command to query the basic properties of an object.
Command Line Structure
- In Windows
obsutil stat obs://bucket/key [-acl][-bf=xxx] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
- In Linux or macOS
./obsutil stat obs://bucket/key [-acl][-bf=xxx] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
Examples
- Take the Windows OS as an example. Run the obsutil stat obs://bucket-test/key command 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). Possible values are:
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. |
config |
Optional (additional parameter) |
The user-defined configuration file for executing the current command. To learn the parameters that can be configured in this file, see Configuration Parameters. |
e |
Optional (additional parameter) |
The endpoint |
i |
Optional (additional parameter) |
The user's AK |
k |
Optional (additional parameter) |
The user's SK |
t |
Optional (additional parameter) |
The user's security token |
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 Possible values are:
|
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. For details about common ContentType values, see Content-Type Introduction. |
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. For details about user-defined object metadata, see User-defined Object Metadata. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot