All Products
Search
Document Center

Object Storage Service:GetBucketResourceGroup

Last Updated:Jun 10, 2026

Queries the resource group ID of a bucket.

Usage notes

Alibaba Cloud accounts can query bucket resource groups by default. RAM users or STS require the oss:GetBucketResourceGroup permission. For more information, see Grant a custom policy.

Request structure

GET /?resourceGroup
Host: BucketName.oss.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue

Request headers

This operation uses only common request headers. For more information, see Common request headers.

Response headers

This operation returns only common response headers. For more information, see Common response headers.

Response elements

Element

Type

Example

Description

BucketResourceGroupConfiguration

Container

N/A

The container for the resource group ID.

Child nodes: ResourceGroupId

ResourceGroupId

String

rg-aek27tc********

The resource group ID of the bucket.

If the bucket belongs to the default resource group, the value is rg-default-id.

Parent nodes: BucketResourceGroupConfiguration

Examples

Sample requests

GET /?resourceGroup
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Thu, 17 Apr 2025 07:51:28 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e

Sample responses

HTTP/1.1 200 OK
x-oss-request-id: 534B371674E88A4D8906****
Date: Sat, 8 May 2021 07:51:28 GMT
Connection: keep-alive
Content-Length: 531
Server: AliyunOSS
<?xml version="1.0" encoding="UTF-8"?>
<BucketResourceGroupConfiguration>
  <ResourceGroupId>rg-xxxxxx</ResourceGroupId>
</BucketResourceGroupConfiguration>

OSS SDKs

Call GetBucketResourceGroup with the following OSS SDKs:

ossutil

For information about the ossutil command that corresponds to the GetBucketResourceGroup operation, see get-bucket-resource-group.

Error codes

Error code

HTTP status code

Description

NoSuchBucket

404

The specified bucket does not exist.

AccessDenied

403

Possible causes:

  • The request does not include authentication information.

  • You are not authorized to perform GetBucketResourceGroup.