Sha256: 016198118a651671de07b787b3600d481a65d33b908efc9e70ff554d693006f2

Contents?: true

Size: 930 Bytes

Versions: 14

Compression:

Stored size: 930 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']
        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

      class Mock

        def put_bucket_versioning(bucket_name, status)
          Fog::Mock.not_implemented
        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-0.3.13 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.12 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.11 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.10 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.9 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.8 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.7 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.6 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.5 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.4 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.3 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.2 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.1 lib/fog/aws/requests/storage/put_bucket_versioning.rb
fog-0.3.0 lib/fog/aws/requests/storage/put_bucket_versioning.rb