You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Bucket Policy
GetBucketPolicy
Copy page
Download PDF
GetBucketPolicy
Description​
This API is used to get the bucket policy of a specified bucket.​
Note​
  • This API must be called by the bucket owner or subaccounts of the bucket owner with the GetBucketPolicy permission for the bucket. For detailed instructions on how to achieve access control using bucket policies, see Bucket authorization policy management.​
  • If the specified bucket policy does not exist and this API is called to get the bucket policy, the server returns the 404 NoSuchBucketPolicy error.​
Request syntax​
​
Get /?policy HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 08:05:36 +0000​
Authorization: authorization string​
​
Request parameters and headers​
For common request headers, see Common parameters.​
​
Name​
Location​
Type​
Required​
Sample value​
Description​
policy​
Query​
String​
Yes​
-​
Identifies a GetBucketPolicy request.​
​
Request body elements​
No elements are used.​
Response headers​
For common response headers, see Common parameters.​
Response body elements​
The response body should be a JSON string containing the desired bucket policy. For more information, see Bucket policy templates and parameters.​
Sample request​
​
GET /?policy HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 08:05:36 +0000​
Authorization: authorization string​
​
Sample response​
​
HTTP/1.1 200 OK​
Date: Fri, 30 Jul 2021 13:53:55 GMT​
Server: TosServer​
x-tos-id-2: 1e89f203jld00006-a444fd0​
x-tos-request-id: 1e89f203b2d00006-a444ed0​
Content-Length: 212​
{​
"Version": "1.0",​
"Statement": [​
{​
"Sid": "Bucket Read-Only",​
"Effect": "Allow",​
"Principal": [​
"210004xxxx/testuser"​
],​
"Action": [​
"tos:Get*",​
"tos:List*"​
],​
"Resource": [​
"trn:tos:::bucketname",​
"trn:tos:::bucketname/*"​
]​
}​
]​
}​
​
​
Last updated: 2026.08.03 10:28:47