Queries the information about all objects in a bucket.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ens:ListObjects | list | *All Resources * |
| 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 | long | 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 parameters
Examples
Sample success responses
JSON
format
{
"CommonPrefixes": [
"N/A"
],
"NextContinuationToken": "CgJiYw--",
"ContinuationToken": "test1.txt",
"Delimiter": "/",
"EncodingType": "N/A",
"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. | - |
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. | - |
403 | AccessDenied | auth is not valid | - |
404 | NoSuchBucket | The specified bucket does not exist. | The requested bucket does not exist. |
500 | InternalError | The request processing has failed due to some unknown error. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|