Retrieves the resource policy (IAM Policy JSON) for a Table Bucket.
Usage notes
-
Returns a NotFoundException error if no resource policy is set on the Table Bucket.
-
The resource policy is returned as a JSON string in IAM policy format.
Permissions
|
API |
Action |
Description |
|
GetTableBucketPolicy |
oss:GetTableBucketPolicy |
Gets the resource policy of a Table Bucket. |
Request syntax
GET /buckets/{tableBucketARN}/policy HTTP/1.1
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue
Request parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
tableBucketARN |
string |
Yes |
acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket |
The ARN of the Table Bucket. Format: acs:osstables:{region}:{accountId}:bucket/{bucketName}. |
Response parameters
|
Parameter |
Type |
Example |
Description |
|
resourcePolicy |
string |
- |
The resource policy in IAM policy JSON format. |
Examples
Request example
GET /buckets/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/policy HTTP/1.1
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: GMT Date
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/osstables/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c****
Response example
HTTP/1.1 200 OK
Server: AliyunOSS
x-oss-request-id: 5C06A3B67B8B5A3DA422****
x-oss-server-time: 3
Content-Type: application/json
{
"resourcePolicy": "{\"Version\":\"1\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"oss:GetTableBucket\"],\"Principal\":[\"1234567890\"],\"Resource\":[\"acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket\"]}]}"
}
SDKs
Available SDKs:
ossutil CLI
The corresponding ossutil command is get-table-bucket-policy.
Error codes
|
Error code |
HTTP status code |
Description |
|
ForbiddenException |
403 |
You do not have the required permissions for this operation. |
|
NotFoundException |
404 |
The requested resource does not exist. |