Queries the information about all objects in a bucket.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ens:ListObjects |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| BucketName |
string |
Yes |
The name of the bucket. |
test |
| EncodingType |
string |
No |
The encoding type of the object names in the response. Only URL encoding is supported. |
url |
| Marker |
string |
No |
The position from which the list operation starts. If this parameter is specified, objects whose names are alphabetically greater than value of Marker are returned. The Marker parameter is used to list the returned objects by page, and its value must be smaller than 1,024 bytes in length. Even if the value specified for Marker does not exist in the list during a conditional query, the list starts from the object whose name is alphabetically greater than the value of Marker. |
a |
| MaxKeys |
integer |
No |
The maximum number of objects to return. Valid values: 0 to 1000. Default value: 100. |
100 |
| Prefix |
string |
No |
The prefix that must be included in the names of objects you want to list. If you specify a prefix to query objects, the returned object names contain the prefix. The value of the parameter must be less than 1,000 bytes in length. |
b |
| ContinuationToken |
string |
No |
The token used in this list operation. If the number of objects exceeds the value of MaxKeys, the NextContinuationToken is included in the response as the token for the next list operation. |
test1.txt |
| StartAfter |
string |
No |
The position from which the list operation starts. If this parameter is specified, objects whose names are alphabetically greater than the value of StartAfter are returned. The StartAfter parameter is used to list the returned objects by page, and its value must be less than 1,000 bytes in length. Even if the value specified for StartAfter does not exist in the list during a conditional query, the list starts from the object whose name is alphabetically greater than the value of StartAfter. |
b |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| CommonPrefixes |
array |
If the delimiter parameter is specified in the request, the response contains CommonPrefixes. Objects whose names contain the same string from the prefix to the next occurrence of the delimiter are grouped as a single result element in CommonPrefixes. |
|
|
string |
If the delimiter parameter is specified in the request, the response contains CommonPrefixes. Objects whose names contain the same string from the prefix to the next occurrence of the delimiter are grouped as a single result element in CommonPrefixes. |
Not applicable |
|
| NextContinuationToken |
string |
The token used in the next list operation. |
CgJiYw-- |
| ContinuationToken |
string |
The token used in this list operation. |
test1.txt |
| Delimiter |
string |
The character used to group objects by name. |
/ |
| EncodingType |
string |
The encoding type of the object names in the response. |
Not applicable |
| Prefix |
string |
The prefix contained in the names of returned objects. |
b |
| Marker |
string |
The position from which the list operation starts. |
ceshi.txt1617853707991 |
| BucketName |
string |
The name of the bucket. |
test |
| Contents |
array<object> |
The list of object metadata. |
|
|
object |
|||
| Key |
string |
The name of the object. |
ceshi.txt1617853706546 |
| LastModified |
string |
The time when the object was last modified. |
2021-04-08T03:48:47.488Z |
| ETag |
string |
The entity tag (ETag). When an object is created, an ETag is created to identify the content of the object.
|
5B3C1A2E053D763E1B002CC607C5**** |
| Size |
integer |
The size of the returned object. Unit: bytes. |
15 |
| IsTruncated |
boolean |
Indicates whether the listed objects are truncated. Valid values:
|
true |
| KeyCount |
integer |
The number of keys returned for this request. |
10 |
| NextMarker |
string |
The position from which the next list operation starts. |
ceshi.txt1617853707991 |
| MaxKeys |
integer |
The maximum number of objects returned. |
10 |
| RequestId |
string |
The ID of the request. |
4833C4AC-9396-458C-8F25-1D701334E560 |
Examples
Success response
JSON format
{
"CommonPrefixes": [
"Not applicable"
],
"NextContinuationToken": "CgJiYw--",
"ContinuationToken": "test1.txt",
"Delimiter": "/",
"EncodingType": "Not applicable",
"Prefix": "b",
"Marker": "ceshi.txt1617853707991",
"BucketName": "test",
"Contents": [
{
"Key": "ceshi.txt1617853706546",
"LastModified": "2021-04-08T03:48:47.488Z",
"ETag": "5B3C1A2E053D763E1B002CC607C5****",
"Size": 15
}
],
"IsTruncated": true,
"KeyCount": 10,
"NextMarker": "ceshi.txt1617853707991",
"MaxKeys": 10,
"RequestId": "4833C4AC-9396-458C-8F25-1D701334E560"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Invalid%s | Specified parameter %s is not valid | |
| 400 | InvalidBucketName | Specified parameter BucketName is not valid. | The specified BucketName parameter is invalid. |
| 400 | InvalidPrefix | Specified parameter Prefix is not valid. | |
| 400 | InvalidStartAfter | Specified parameter StartAfter is not valid. | |
| 400 | InvalidMarker | Specified parameter Marker is not valid. | |
| 400 | InvalidDelimiter | Specified parameter Delimiter is not valid. | |
| 400 | NoPermission | Permission denied. | |
| 400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. | |
| 400 | InvalidArgument | Specified parameter ContinuationToken is incorrect. | The ContinuationToken parameters set are incorrect. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | AccessDenied | auth is not valid | |
| 403 | UserDisable | The user has been disabled due to arrears. | The user has been disabled due to arrears. |
| 404 | NoSuchBucket | The specified bucket does not exist. | The requested bucket does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.