| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
This implementation of the GET operation uses the policy
subresource to return the policy of a specified bucket. To use this operation, you must
have GetPolicy permissions on the specified bucket, and you must be the
bucket owner.
If you don't have GetPolicy permissions, Amazon S3 returns a 403 Access
Denied error. If you have the correct permissions, but you're not the bucket
owner, Amazon S3 returns a 405 Method Not Allowed error. If the bucket does
not have a policy, Amazon S3 returns a 404 Policy Not found error. There
are restrictions about who can create bucket policies and which objects in a bucket they
can apply to. For more information, go to Using
Bucket Policies.
GET /?policy HTTP/1.1 Host:BucketName.s3.amazonaws.com Date:dateAuthorization:signatureValue
This implementation of the operation does not use request parameters.
This implementation of the operation uses only request headers that are common to all operations. For more information, see Common Request Headers.
This implementation of the operation does not use request elements.
This implementation of the operation uses only response headers that are common to most responses. For more information, see Common Response Headers.
The response contains the (JSON) policy of the specified bucket.
This implementation of the operation does not return special errors. For general information about Amazon S3 errors and a list of error codes, see Error Responses.
The following request returns the policy of the specified bucket.
GET ?policy HTTP/1.1 Host: bucket.s3.amazonaws.com Date: Wed, 28 Oct 2009 22:32:00 GMT Authorization: AWS AKIAIOSFODNN7EXAMPLE:xQE0diMbLRepdf3YB+FIEXAMPLE=
HTTP/1.1 200 OK
x-amz-id-2: Uuag1LuByru9pO4SAMPLEAtRPfTaOFg==
x-amz-request-id: 656c76696e67SAMPLE57374
Date: Tue, 04 Apr 2010 20:34:56 GMT
Connection: keep-alive
Server: AmazonS3
{
"Version":"2008-10-17",
"Id":"aaaa-bbbb-cccc-dddd",
"Statement" : [
{
"Effect":"Deny",
"Sid":"1",
"Principal" : {
"AWS":["111122223333","444455556666"]
},
"Action":["s3:*"],
"Resource":"arn:aws:s3:::bucket/*"
}
]
}