Sha256: a763c66b3fdd39d5556757e98040282cc7df6b7d6e67d6ebf8f95394112a0a96

Contents?: true

Size: 1.35 KB

Versions: 37

Compression:

Stored size: 1.35 KB

Contents

module Fog
  module AWS
    module S3
      class Real

        # List information about S3 buckets for authorized user
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'Buckets'<~Hash>:
        #       * 'Name'<~String> - Name of bucket
        #       * 'CreationTime'<~Time> - Timestamp of bucket creation
        #     * 'Owner'<~Hash>:
        #       * 'DisplayName'<~String> - Display name of bucket owner
        #       * 'ID'<~String> - Id of bucket owner
        def get_service
          request({
            :expects  => 200,
            :headers  => {},
            :host     => @host,
            :idempotent => true,
            :method   => 'GET',
            :parser   => Fog::Parsers::AWS::S3::GetService.new,
            :url      => @host
          })
        end

      end

      class Mock

        def get_service
          response = Excon::Response.new
          response.headers['Status'] = 200
          buckets = @data[:buckets].values.map do |bucket|
            bucket.reject do |key, value|
              !['CreationDate', 'Name'].include?(key)
            end
          end
          response.body = {
            'Buckets' => buckets,
            'Owner'   => { 'DisplayName' => 'owner', 'ID' => 'some_id'}
          }
          response
        end

      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
fog-0.1.8 lib/fog/aws/requests/s3/get_service.rb
fog-0.1.7 lib/fog/aws/requests/s3/get_service.rb
fog-0.1.6 lib/fog/aws/requests/s3/get_service.rb
fog-0.1.5 lib/fog/aws/requests/s3/get_service.rb
fog-0.1.4 lib/fog/aws/requests/s3/get_service.rb
fog-0.1.3 lib/fog/aws/requests/s3/get_service.rb
fog-0.1.2 lib/fog/aws/requests/s3/get_service.rb
fog-0.1.1 lib/fog/aws/requests/s3/get_service.rb
fog-0.1.0 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.100 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.99 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.98 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.97 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.96 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.95 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.94 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.93 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.92 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.91 lib/fog/aws/requests/s3/get_service.rb
fog-0.0.90 lib/fog/aws/requests/s3/get_service.rb