Sha256: 9d47e363c669d8b735da3ba986b6d67de49791e1f11fabb701698d58162726de

Contents?: true

Size: 946 Bytes

Versions: 11

Compression:

Stored size: 946 Bytes

Contents

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fog-0.1.3 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.1.2 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.1.1 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.1.0 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.0.100 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.0.99 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.0.98 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.0.97 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.0.96 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.0.95 lib/fog/aws/requests/s3/put_bucket_versioning.rb
fog-0.0.94 lib/fog/aws/requests/s3/put_bucket_versioning.rb