Promo Center

50% off for new user

Direct Mail-46% off

Learn More

GetBucketLocation

Updated at: 2025-01-22 02:24

Queries the region of an Object Storage Service (OSS) bucket. Only the bucket owner can query the region of a bucket.

Request syntax

GET /?location HTTP/1.1
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue

Request headers

All headers in a DescribeRegions request are common request headers. For more information, see Common request headers.

Response headers

All headers in the response to a DescribeRegions request are common response headers. For more information, see Common response headers.

Response elements

Element

Type

Example

Description

Element

Type

Example

Description

LocationConstraint

String

oss-cn-hangzhou

The OSS region ID, which specifies the region in which the bucket is located.

Examples

Sample requests

Get /?location HTTP/1.1
Host: examplebucket.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 04 May 2012 05:31:04 GMT  
Authorization: OSS qn6q**************:77Dv****************                

Sample success responses

HTTP/1.1 200
x-oss-request-id: 534B371674E88A4D8906****
Date: Fri, 15 Mar 2013 05:31:04 GMT
Connection: keep-alive
Content-Length: 90 
Server: AliyunOSS

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

OSS SDKs

You can use OSS SDKs for the following programming languages to call GetBucketLocation:

Error codes

Error code

HTTP status code

Description

Error code

HTTP status code

Description

AccessDenied

403

You do not have the permissions to query the region of the bucket. Only the owner of a bucket can query the region in which the bucket is located.

  • On this page (1)
  • Request syntax
  • Request headers
  • Response headers
  • Response elements
  • Examples
  • OSS SDKs
  • Error codes
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare