mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
29 lines
710 B
Ruby
29 lines
710 B
Ruby
module Fog
|
|
module AWS
|
|
class S3
|
|
|
|
# Change who pays for requests to an S3 bucket
|
|
#
|
|
# ==== Parameters
|
|
# * bucket_name<~String> - name of bucket to modify
|
|
# * payer<~String> - valid values are BucketOwner or Requester
|
|
def put_request_payment(bucket_name, payer)
|
|
data =
|
|
<<-DATA
|
|
<RequestPaymentConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
<Payer>#{payer}</Payer>
|
|
</RequestPaymentConfiguration>
|
|
DATA
|
|
request({
|
|
:body => data,
|
|
:expects => 200,
|
|
:headers => {},
|
|
:host => "#{bucket_name}.#{@host}",
|
|
:method => 'PUT',
|
|
:query => "requestPayment"
|
|
})
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|