查看Bucket所属的区域
更新时间:2025-04-01
基本流程
- 创建BosClient类的实例。
- 执行BosClient.testGetBucketLocation方法。
示例代码
let location: string;
try {
location = await bosClient.getBucketLocation(bucketName);
logger.info(`location: ${location}`);
} catch (bosResponse) {
logger.error(`errCode: ${bosResponse.error.code}`)
logger.error(`requestId: ${bosResponse.error.requestId}`)
logger.error(`errMessage: ${bosResponse.error.message}`)
logger.error(`statusCode: ${bosResponse.statusCode}`)
}