Torch Object Storage
This interface lists the objects in the bucket.
You need read access to the bucket to call this interface. Each request returns a portion of the bucket's objects (up to 1,000 per request). You can use request parameters as filters to return a subset of objects in the bucket.
tip
For a better user experience, we recommend prioritizing the use of the new
ListObjectsV2 interface when developing applications. To maintain backward compatibility, TOS will continue to support ListObjects.
GET / HTTP/1.1 Host: bucketname.tos-cn-beijing.volces.com Date: GMT Date Authorization: authorization string
This request uses the public request header, see Common parameters.
| Name | Location | Type | Required | Sample Value | Description |
|---|---|---|---|---|---|
| delimiter | Query | String | No | - | Character used to group object names. Usually use / as the grouping character. |
encoding-type | Query | String | No | url | Specify the encoding type for the returned content. The values are as follows:
|
| max-keys | Query | Integer | No | 100 | Maximum number of objects to return. The maximum value is 1000, meaning up to 1000 objects can be returned per request. |
| prefix | Query | String | No | abc | List objects with a specified prefix. |
| marker | Query | String | No | test.txt | List the starting position of the objects. Set the value after which the object list is returned in alphabetical order. Usually the NextMarker value from the previous response body. |
There is no message element in this request response.
This request returns the common response message headers, please see common parameters.
| Name | Type | Sample Value | Description |
|---|---|---|---|
| Name | String | test-bucket | Bucket name. |
| Prefix | String | abc | prefix parameter included in the request |
| Marker | String | abc | marker parameter included in the request |
| MaxKeys | Integer | 100 | max-keys parameter included in the request |
| Delimiter | String | d | Delimiter parameter included in the request. |
| EncodingType | String | url | Encoding-type parameter included in the request. |
IsTruncated | Bool | true | Whether the returned result is truncated, the value explanations are as follows:
|
| NextMarker | String | abcd | If the results are not fully returned, it indicates the marker value for the next request. |
| CommonPrefixes | Array | [{"Prefix": "abcd"}] | When the delimiter parameter is included in the request, the response contains CommonPrefixes grouping information. This element identifies a set of object names that end with the delimiter and share a common prefix. |
| Contents | Array | - | The root node of the object information. |
| Key | String | abcde | Object name. The parent node is Contents. |
| LastModified | String | 2024-06-06T07:15:20.000Z | The last modification time of the object. The parent node is Contents. |
| ETag | String | "32185e15494ca8e0eedf12bd218787f6" | Generated when each object is created, uniquely identifying the content of the object. The parent node is Contents. |
| Size | Integer | 4813 | Object size. The parent node is Contents. |
StorageClass | String | STANDARD | Object storage types,For detailed information, please refer to Storage type. |
Type | String | Appendable | If the object is not a Normal object, this element will be returned with the following value explanation:
The parent node is Contents. |
HashCrc64ecma | String | 2217460101204276403 | Represents the 64-bit CRC value of the object. The 64-bit CRC is calculated according to the ECMA-182 standard. If the object was created before the TOS server supported 64-bit CRC verification, this header will not appear in the response message. The parent node is Contents. |
| Owner | Object | - | Object owner. The parent node is Contents. |
| ID | String | 1234567890 | Account ID. The parent node is Owner. |
| DisplayName | String | test-owner-name | Account name. The parent node is Owner. |
GET / HTTP/1.1 Host: bucketname.tos-cn-beijing.volces.com Date: Fri, 30 Jul 2021 08:05:36 GMT Authorization: authorization string
HTTP/1.1 200 OK x-tos-id-2: dc13a2093d620014-a444ed0 x-tos-request-id: dc13a2093d620014-a444ed0 Date: Fri, 30 Jul 2021 06:45:39 GMT server: TosServer Content-Length: 622 { "Name": "bucketName", "Prefix": "", "Marker": "", "MaxKeys": 1000, "IsTruncated": false, "Contents": [ { "Key": "obj1", "LastModified": "2021-08-20T03:10:02.000Z", "ETag": ""8a36be0d764367db4eea2deb16b71543"", "Size": 109, "StorageClass": "STANDARD" }, { "Key": "obj2", "LastModified": "2021-08-20T03:10:06.000Z", "ETag": ""8a36be0d764367db4eea2deb16b71543"", "Size": 109, "StorageClass": "STANDARD" }, { "Key": "obj3", "LastModified": "2021-08-20T03:10:10.000Z", "ETag": ""8a36be0d764367db4eea2deb16b71543"", "Size": 109, "StorageClass": "STANDARD" } ] }