[英]Change default Google Cloud Storage bucket region when creating it in C# application
I am interested in changing Google Cloud Storage bucket region when creating bucket in C# application programmatically. 我对以编程方式在C#应用程序中创建存储桶时更改Google Cloud Storage存储桶区域感兴趣。 Here is the method:
方法如下:
StorageClient storageClient = StorageClient.Create();
storageClient.CreateBucket(projectId, bucketName);
But it seems there is no way to change default region. 但是似乎没有办法更改默认区域。 It should be a very simple thing to do, but I can not find any information on it.
这应该是一件非常简单的事情,但是我找不到任何信息。
From the official Google Cloud Storage sample : 来自官方的Google Cloud Storage示例 :
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.