ListObjectsV2
Returns a list of all the objects in a bucket. You can use the request parameters as a selection criteria to return a subset of the objects in a bucket. The API returns objects with the latest version when the versioning is enabled on the bucket. A 200 OK response can contain valid or invalid XML. Make sure to design your application to parse the contents of the response and handle it appropriately.
Request Syntax
GGET /bucket?list-type=2&continuation-token=Continuation Token&delimiter=Delimiter&max-keys=MaxKeys&prefix=Prefix HTTP/1.1 Host: msdps3.server:8443
Request Parameters
Bucket
Name of the bucket that contains the objects.
Required: Yes
Type: String
continuation-token
Continuation-token is the point from where you want S3 interface for MSDP to start listing objects. S3 interface for MSDP expects the continuation-token that is returned by the server in the last request. The value of NextContinuationToken of response should be used in request as ContinuationToken. The token can only be used once and valid for two minutes by default.
Type: String
delimiter
A delimiter is a character used to group keys. It rolls up the keys that contain the same character between the prefix and the first occurrence of the delimiter into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the MaxKeys value. MSDP S3 supports only "/" string as delimiter.
Type: String
max-keys
Limits the number of keys that are returned in the response. By default, the action returns up to 1,000 key names.
Type: Integer
prefix
Limits the response to keys that begin with the specified prefix.
Type: String
Response Syntax
HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult>
<IsTruncated>boolean</IsTruncated>
<Contents>
<ETag>string</ETag>
<Key>string</Key>
<LastModified>timestamp</LastModified>
<Size>integer</Size>
<StorageClass>string</StorageClass>
</Contents>
...
<Name>string</Name>
<Prefix>string</Prefix>
<Delimiter>string</Delimiter>
<MaxKeys>integer</MaxKeys>
<CommonPrefixes>
<Prefix>string</Prefix>
</CommonPrefixes>
...
<KeyCount>integer</KeyCount>
<ContinuationToken>string</ContinuationToken>
<NextContinuationToken>string</NextContinuationToken>
</ListBucketResult>Response Body
ListBucketResult
Root level tag for the ListBucketResult parameters.
Required: Yes
CommonPrefixes
When determining the number of returns, all the keys (up to 1,000) rolled into a common prefix count as one. CommonPrefixes contains all keys between Prefix and the next occurrence of the string that is specified by the delimiter.
Contents
Metadata about each object that is returned.
ETag
SHA256 digest of the object.
Key
Object name.
LastModified
Last modification date and time of the object.
Size
Size of the object.
StorageClass
Storage class of the object.
Delimiter
Delimiter value that is passed in request.
IsTruncated
A flag indicating whether all the results satisfying the search criteria were returned by MSDP S3.
ContinuationToken
The ContinuationToken is the point from where you want S3 interface for MSDP to start listing objects. S3 interface for MSDP expects ContinuationToken that is returned by server in last request. The value of NextContinuationToken of response should be used in request as ContinuationToken.
KeyCount
The number of objects that are returned in the response body.
MaxKeys
The maximum number of objects that can be returned in the response body.
Name
The name of the bucket
NextContinuationToken
When the response is truncated, you can use this value as ContinuationToken in subsequent request to get next set of objects.
Prefix
Limits the response to keys that begin with the specified prefix.
For versioned bucket, it is recommended that you use List Object Versions API to get all objects information. If using "list objects" in versioned bucket when results are truncated, key count in the results may be less than Max keys and you can make a follow-up paginated request.
Recommend less than 1000 CommonPrefixes elements under a specified prefix separated by the slash (/) delimiter character. If more than 10000 CommonPrefixes elements under a specified prefix exist, list objects with the prefix and the delimiter parameters in the request returns only 10000 elements. You can use list objects without delimiter if you want to list all elements under a specified prefix.
When using list objects APIs on a versioned bucket, if all of objects under the specified prefix are delete markers, the specified prefix is shown as a CommonPrefixes element.
Possible Error Response
Success
HTTP status code 200.
InvalidArgument(continuation-token is invalid)
Invalid Argument.
HTTP status code 400.
InvalidArgument(max-keys is invalid)
Invalid Argument.
HTTP status code 400.
S3srvExtInvalidPrefix
Prefixes cannot start with a slash.
HTTP status code 400.
S3srvExtInvalidDelimiter
Only support the slash as a delimiter.
HTTP status code 400
AccessDenied
Access Denied.
HTTP status code 403.
NoSuchBucket
The specified bucket does not exist.
HTTP status code 404.
InternalError
Request failed because of an internal server error.
HTTP status code 500.