mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
41 lines
946 B
Ruby
41 lines
946 B
Ruby
|
module Fog
|
||
|
module AWS
|
||
|
module S3
|
||
|
class Real
|
||
|
|
||
|
# Change versioning status for an S3 bucket
|
||
|
#
|
||
|
# ==== Parameters
|
||
|
# * bucket_name<~String> - name of bucket to modify
|
||
|
# * status<~String> - Status to change to in ['Enabled', 'Suspended']
|
||
|
def put_bucket_versioning(bucket_name, status)
|
||
|
data =
|
||
|
<<-DATA
|
||
|
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||
|
<Status>#{status}</Status>
|
||
|
</VersioningConfiguration>
|
||
|
DATA
|
||
|
|
||
|
request({
|
||
|
:body => data,
|
||
|
:expects => 200,
|
||
|
:headers => {},
|
||
|
:host => "#{bucket_name}.#{@host}",
|
||
|
:method => 'PUT',
|
||
|
:query => 'versioning'
|
||
|
})
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
|
class Mock
|
||
|
|
||
|
def put_bucket_versioning(bucket_name, status)
|
||
|
raise MockNotImplemented.new("Contributions welcome!")
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|