Querying the Object List in an OBS Bucket
Function
This interface is used to query objects in an OBS bucket.
URI
GET /v2/rtc-ops/buckets/objects
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
bucket |
Yes |
String |
Specifies the name of the bucket to be queried. |
prefix |
No |
String |
Object name prefix, which can be regarded as the folder path. |
type |
Yes |
String |
Query type. The options are as follows:
|
location |
Yes |
String |
Run the following command to query the region where the bucket is located:
|
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. This parameter is mandatory when token authentication is used. It can be obtained by calling the IAM API that is used for obtaining a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
X-request-Id |
String |
This field carries the request ID for task tracing. |
Parameter |
Type |
Description |
---|---|---|
count |
Integer |
Total number of objects. |
objects |
Array of ObsObject objects |
OBS file. |
Parameter |
Type |
Description |
---|---|---|
file_name |
String |
Object name. |
size |
Integer |
File size, in unit of KB. |
last_modified |
String |
Last modification time, for example, 2020/07/16 15:11:55 GMT+08:00. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
X-request-Id |
String |
This field carries the request ID for task tracing. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Description. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
X-request-Id |
String |
This field carries the request ID for task tracing. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Description. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
X-request-Id |
String |
This field carries the request ID for task tracing. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Description. |
Example Requests
None
Example Responses
Status code: 200
Objects in the OBS bucket are successfully queried.
{ "count" : 1, "objects" : [ { "file_name" : "test file" }, { "size" : 7254700 }, { "last_modified" : "20230815085859" } ] }
Status code: 401
The request fails because the X-Auth-Token is incorrect.
{ "error_code" : "RTC.00001003", "error_msg" : "InvalidParameterValue" }
Status code: 404
Query failed. The task ID does not exist.
{ "error_code" : "RTC.00001003", "error_msg" : "InvalidParameterValue" }
Status code: 500
Query failed. Server error.
{ "error_code" : "RTC.00002xxx", "error_msg" : "InternalError" }
Status Codes
Status Code |
Description |
---|---|
200 |
Objects in the OBS bucket are successfully queried. |
401 |
The request fails because the X-Auth-Token is incorrect. |
404 |
Query failed. The task ID does not exist. |
500 |
Query failed. Server error. |
Error Codes
See Error Codes.
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