All Products
Search
Document Center

Object Storage Service:Query the region of a bucket

Last Updated:Mar 20, 2026

Returns the region of a bucket as a LocationConstraint value.

Prerequisites

Before you begin, make sure that you have:

Usage notes

  • Only the bucket owner can query the bucket's region.

Command syntax

ossutil api get-bucket-location --bucket <bucket-name> [flags]

Parameter

ParameterTypeDescription
--bucketstringThe name of the bucket.

For available flags, see Command-line options.

Examples

Query the region of examplebucket:

ossutil api get-bucket-location --bucket examplebucket

Expected output:

<?xml version="1.0" encoding="UTF-8"?>
<LocationConstraint>oss-cn-hangzhou</LocationConstraint>

The LocationConstraint value is an enumerated region identifier. In this example, oss-cn-hangzhou indicates the bucket is in China (Hangzhou).