Return a list of all of the buckets owned by the authenticated sender of the request.
![](../icons/collapse_all.gif)
C# |
public ListBucketsResponse ListBuckets( ListBucketsRequest request )
![](../icons/collapse_all.gif)
- request (ListBucketsRequest)
- The ListBucketsRequest that defines the parameters of this operation
![](../icons/collapse_all.gif)
Returns a ListBucketsResponse with the response from S3.
![](../icons/collapse_all.gif)
This example shows how to list all buckets.
![](../icons/CopyCode.gif)
// Create a client AmazonS3Client client = new AmazonS3Client(); // Issue call ListBucketsResponse response = client.ListBuckets(); // View response data Console.WriteLine("Buckets owner - {0}", response.Owner.DisplayName); foreach (S3Bucket bucket in response.Buckets) { Console.WriteLine("Bucket {0}, Created on {1}", bucket.BucketName, bucket.CreationDate); }
![](../icons/collapse_all.gif)
Exception | Condition |
---|---|
ArgumentNullException | |
WebException | |
AmazonS3Exception |