Skip to content

Instantly share code, notes, and snippets.

@eskye

eskye/Bucket.cs Secret

Created June 8, 2020 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eskye/5492b216152a943b80110feeb45bd4bf to your computer and use it in GitHub Desktop.
Save eskye/5492b216152a943b80110feeb45bd4bf to your computer and use it in GitHub Desktop.
List and Create Bucket
public async Task<int> UploadToCloud()
{
// Listing buckets.
var bucketService = new BucketService(scope);
var listBucketOptions = new BucketListOptions();
var buckets = await bucketService.ListBucketsAsync(listBucketOptions);
foreach (BucketInfo b in buckets.Items)
{
Console.WriteLine(b.Name);
}
var restrictedBucketService = new BucketService(scope);
var newBucketName = "flureebucket";
var bucket = await restrictedBucketService.OpenBucketAsync(newBucketName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment