查看Bucket所属的区域
更新时间:2022-09-14
Bucket Location即Bucket Region,百度智能云支持的各region详细信息可参见区域选择说明。
如下代码可以获取该Bucket的Location信息:
BosClient client = new BosClient(config);
ListBucketsResponse listBucketsResponse = client.listBuckets();
List<BucketSummary> bucketSummaryList = listBucketsResponse.getBuckets();
for(BucketSummary bs : bucketSummaryList){
System.out.println( bs.getLocation());
}
System.out.println(client.getBucketLocation("bucket-test").getLocationConstraint());