Skip to content

S3  >  Operations  >  list_directory_buckets

list_directory_buckets

Operation

list_directory_buckets async

list_directory_buckets(request: ListDirectoryBucketsInput | ListDirectoryBucketsInputDict, /, *, plugins: list[Plugin] | None = None) -> ListDirectoryBucketsOutput
list_directory_buckets(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[ListDirectoryBucketsInputDict]) -> ListDirectoryBucketsOutput

Returns a list of all Amazon S3 directory buckets owned by the authenticated sender of the request. For more information about directory buckets, see Directory buckets in the Amazon S3 User Guide.

Note

Directory buckets - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format https://s3express-control.region-code.amazonaws.com/bucket-name. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the Amazon S3 User Guide. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the Amazon S3 User Guide.

Permissions

You must have the s3express:ListAllMyDirectoryBuckets permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the Amazon S3 User Guide.

HTTP Host header syntax

Directory buckets - The HTTP Host header syntax is s3express-control.region.amazonaws.com.

Note

The BucketRegion response element is not part of the ListDirectoryBuckets Response Syntax.

Warning: You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
ListDirectoryBucketsOutput

An instance of ListDirectoryBucketsOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

ListDirectoryBucketsInput dataclass

Bases: _SerdeShape

Dataclass for ListDirectoryBucketsInput structure.

Attributes
continuation_token class-attribute instance-attribute
continuation_token: str | None = ...

ContinuationToken indicates to Amazon S3 that the list is being continued on buckets in this account with a token. ContinuationToken is obfuscated and is not a real bucket name. You can use this ContinuationToken for the pagination of the list results.

max_directory_buckets class-attribute instance-attribute
max_directory_buckets: int | None = ...

Maximum number of buckets to be returned in response. When the number is more than the count of buckets that are owned by an Amazon Web Services account, return all the buckets in response.

Dictionaries

ListDirectoryBucketsInputDict

Bases: TypedDict

Dictionary form of ListDirectoryBucketsInput.

Attributes
continuation_token instance-attribute
continuation_token: str | None

ContinuationToken indicates to Amazon S3 that the list is being continued on buckets in this account with a token. ContinuationToken is obfuscated and is not a real bucket name. You can use this ContinuationToken for the pagination of the list results.

max_directory_buckets instance-attribute
max_directory_buckets: int | None

Maximum number of buckets to be returned in response. When the number is more than the count of buckets that are owned by an Amazon Web Services account, return all the buckets in response.

Output

ListDirectoryBucketsOutput dataclass

Bases: _SerdeShape

Dataclass for ListDirectoryBucketsOutput structure.

Attributes

buckets class-attribute instance-attribute
buckets: list[Bucket] | None = ...

The list of buckets owned by the requester.

continuation_token class-attribute instance-attribute
continuation_token: str | None = ...

If ContinuationToken was sent with the request, it is included in the response. You can use the returned ContinuationToken for pagination of the list response.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.