Return a list of all of the buckets owned by the authenticated sender of the request.
| C# |
public ListBucketsResponse ListBuckets()
Returns a ListBucketsResponse with the response from S3.
This example shows how to list all buckets.
// 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); }
| Exception | Condition |
|---|---|
| ArgumentNullException | |
| WebException | |
| AmazonS3Exception |