[英]Change default Google Cloud Storage bucket region when creating it in C# application
我對以編程方式在C#應用程序中創建存儲桶時更改Google Cloud Storage存儲桶區域感興趣。 方法如下:
StorageClient storageClient = StorageClient.Create();
storageClient.CreateBucket(projectId, bucketName);
但是似乎沒有辦法更改默認區域。 這應該是一件非常簡單的事情,但是我找不到任何信息。
private void CreateRegionalBucket(string location, string bucketName)
{
var storage = StorageClient.Create();
Bucket bucket = new Bucket { Location = location, Name = bucketName };
storage.CreateBucket(s_projectId, bucket);
Console.WriteLine($"Created {bucketName}.");
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.