View the region to which a bucket belongs
Updated at:2025-11-03
Bucket Location refers to Bucket Region. For details on regions supported by Baidu AI Cloud, refer to [Region Selection Guide](Reference/Region Selection Instructions/Region.md).
-
Basic workflow
- Create a BosClient instance.
- Run the listBuckets() method.
- Example code
The following code can retrieve the bucket's location information:
JavaScript
1BosClient.getBucketLocation(<BucketNname>)
2 .then(function(response) {
3 if(response) {
4 console.log(response);
5 }
6 })
7 .catch(err){}
