Configures the resource group to which a bucket belongs.
Usage notes
By default, an Alibaba Cloud account has the permission to configure a resource group for a bucket. To configure a resource group for a bucket by using a RAM user or Security Token Service (STS), you must have the oss:PutBucketResourceGroup
permission. For more information, see Attach a custom policy to a RAM user.
Request structure
PUT /?resourceGroup
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Host: BucketName.oss.aliyuncs.com
Authorization: SignatureValue
<?xml version="1.0" encoding="UTF-8"?>
<BucketResourceGroupConfiguration>
<ResourceGroupId>rg-aekz****</ResourceGroupId>
</BucketResourceGroupConfiguration>
Request headers
Request headers involved in this API operation contain only common request headers. For more information, see Common request headers.
Request elements
Element | Type | Required | Example | Description |
---|---|---|---|---|
BucketResourceGroupConfiguration | Container | Yes | N/A | The container that contains the ID of the resource group. Child nodes: ResourceGroupId |
ResourceGroupId | String | Yes | rg-aekz**** | The ID of the resource group to which the bucket belongs. If this element is not specified, the bucket is moved to the default resource group. Parent nodes: BucketResourceGroupConfiguration |
Response headers
The response headers involved in this API operation contain only common response headers. For more information, see Common response headers.
Examples
PUT /?resourceGroup
Content-Length: 0
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Sat, 8 May 2021 01:33:47 GMT
Authorization: OSS qn6qrrqxo2oawuk5****:77Dvh5wQgIjWjwO/KyRt****
<?xml version="1.0" encoding="UTF-8"?>
<BucketResourceGroupConfiguration>
<ResourceGroupId>rg-aekz****</ResourceGroupId>
</BucketResourceGroupConfiguration>
HTTP/1.1 200 OK
x-oss-request-id: 5D3663FBB007B79097FC****
Date: Sat, 8 May 2021 01:33:47 GMT
Content-Length: 0
Connection: keep-alive
Server: AliyunOSS
Error codes
Error code | HTTP status code | Description |
---|---|---|
AccessDenied | 403 | Possible causes:
|
ResourceGroupIdPreCheckError | 400 | The error message returned because the specified ID of the resource group is invalid or does not exist. The ID of the resource group fails the precheck. |