Retrieves the resource policy of a specified table.
Usage notes
-
If a resource policy is not configured for the table, the operation returns a 404 error.
-
The returned
resourcePolicyis a JSON policy string.
Permissions
|
API |
Action |
Description |
|
GetTablePolicy |
oss:GetTablePolicy |
Retrieves the resource policy of a table. |
Request syntax
GET /tables/{tableBucketARN}/{namespace}/{name}/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 Alibaba Cloud Resource Name (ARN) of the table bucket in the format acs:osstables:{region}:{uid}:bucket/{bucketName}. Specified in the URI path. |
|
namespace |
String |
Yes |
my_namespace |
The namespace that contains the table. Specified in the URI path. |
|
name |
String |
Yes |
my_table |
The name of the table. Specified in the URI path. |
Response parameters
|
Parameter |
Type |
Example |
Description |
|
resourcePolicy |
String |
{"Version":"1",...} |
The resource policy for the table, returned as a JSON-formatted string. |
Examples
Request example
GET /tables/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/my_namespace/my_table/policy HTTP/1.1
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: Thu, 10 Apr 2025 08:00:00 GMT
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\",...}"
}
SDK
The following SDKs support this operation:
ossutil CLI
For the corresponding ossutil command, see get-table-policy.
Error codes
|
Error code |
HTTP status code |
Description |
|
ForbiddenException |
403 |
The caller is not authorized to perform the operation. |
|
NotFoundException |
404 |
The specified resource does not exist. |