Sha256: a5208b516b652fc042931176b87059e144c8da307cef8f07a087164cfe2744bd

Contents?: true

Size: 1.12 KB

Versions: 11

Compression:

Stored size: 1.12 KB

Contents

module Fog
  module AWS
    module S3
      class Real

        # Get versioning status for an S3 bucket
        #
        # ==== Parameters
        # * bucket_name<~String> - name of bucket to get versioning status for
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'VersioningConfiguration'<~Hash>
        #         * Status<~String>: Versioning status in ['Enabled', 'Suspended', nil]
        #
        def get_bucket_versioning(bucket_name)
          unless bucket_name
            raise ArgumentError.new('bucket_name is required')
          end
          request({
            :expects    => 200,
            :headers    => {},
            :host       => "#{bucket_name}.#{@host}",
            :idempotent => true,
            :method     => 'GET',
            :parser     => Fog::Parsers::AWS::S3::GetBucketVersioning.new,
            :query      => 'versioning'
          })
        end

      end

      class Mock

        def get_bucket_versioning(bucket_name)
          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/get_bucket_versioning.rb
fog-0.1.2 lib/fog/aws/requests/s3/get_bucket_versioning.rb
fog-0.1.1 lib/fog/aws/requests/s3/get_bucket_versioning.rb
fog-0.1.0 lib/fog/aws/requests/s3/get_bucket_versioning.rb
fog-0.0.100 lib/fog/aws/requests/s3/get_bucket_versioning.rb
fog-0.0.99 lib/fog/aws/requests/s3/get_bucket_versioning.rb
fog-0.0.98 lib/fog/aws/requests/s3/get_bucket_versioning.rb
fog-0.0.97 lib/fog/aws/requests/s3/get_bucket_versioning.rb
fog-0.0.96 lib/fog/aws/requests/s3/get_bucket_versioning.rb
fog-0.0.95 lib/fog/aws/requests/s3/get_bucket_versioning.rb
fog-0.0.94 lib/fog/aws/requests/s3/get_bucket_versioning.rb