Sha256: 400528b728383d5e78ae6767325cfd83fc7f063f04645979b9cb1e08494a7e36

Contents?: true

Size: 931 Bytes

Versions: 9

Compression:

Stored size: 931 Bytes

Contents

module Fog
  module AWS
    class Storage
      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']
        #
        # ==== See Also
        # http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html

        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' => nil}
          })
        end

      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fog-0.8.2 lib/fog/storage/requests/aws/put_bucket_versioning.rb
fog-0.8.1 lib/fog/storage/requests/aws/put_bucket_versioning.rb
fog-0.8.0 lib/fog/storage/requests/aws/put_bucket_versioning.rb
fog-0.7.2 lib/fog/storage/requests/aws/put_bucket_versioning.rb
fog-0.7.1 lib/fog/storage/requests/aws/put_bucket_versioning.rb
fog-0.7.0 lib/fog/storage/requests/aws/put_bucket_versioning.rb
fog-0.6.0 lib/fog/storage/requests/aws/put_bucket_versioning.rb
fog-0.5.3 lib/fog/storage/requests/aws/put_bucket_versioning.rb
fog-0.5.2 lib/fog/storage/requests/aws/put_bucket_versioning.rb