Sha256: 22fa5e03557c15431e9febae903cc2ccf0a36cbfe293af3f21f201232e59f787

Contents?: true

Size: 1.48 KB

Versions: 61

Compression:

Stored size: 1.48 KB

Contents

module Fog
  module Storage
    class AWS
      class Real

        require 'fog/aws/parsers/storage/get_service'

        # List information about S3 buckets for authorized user
        #
        # @return [Excon::Response] 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
        #
        # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTServiceGET.html
        #
        def get_service
          request({
            :expects  => 200,
            :headers  => {},
            :host     => @host,
            :idempotent => true,
            :method   => 'GET',
            :parser   => Fog::Parsers::Storage::AWS::GetService.new
          })
        end

      end

      class Mock # :nodoc:all

        def get_service
          response = Excon::Response.new
          response.headers['Status'] = 200
          buckets = self.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

61 entries across 61 versions & 6 rubygems

Version Path
fog-maestrodev-1.15.0.20130927082724 lib/fog/aws/requests/storage/get_service.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/aws/requests/storage/get_service.rb
fog-1.15.0 lib/fog/aws/requests/storage/get_service.rb
gapinc-fog-1.14.0 lib/fog/aws/requests/storage/get_service.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/aws/requests/storage/get_service.rb
fog-1.14.0 lib/fog/aws/requests/storage/get_service.rb
fog-1.13.0 lib/fog/aws/requests/storage/get_service.rb
gapinc-fog-1.12.1.2 lib/fog/aws/requests/storage/get_service.rb
gapinc-fog-1.12.1.1 lib/fog/aws/requests/storage/get_service.rb
gapinc-fog-1.12.1a lib/fog/aws/requests/storage/get_service.rb
gapinc-fog-1.12.1 lib/fog/aws/requests/storage/get_service.rb
fog-1.12.1 lib/fog/aws/requests/storage/get_service.rb
fog-1.12.0 lib/fog/aws/requests/storage/get_service.rb
hpfog-0.0.20 lib/fog/aws/requests/storage/get_service.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/storage/get_service.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/storage/get_service.rb
fog-1.11.1 lib/fog/aws/requests/storage/get_service.rb
fog-1.11.0 lib/fog/aws/requests/storage/get_service.rb
fog-1.10.1 lib/fog/aws/requests/storage/get_service.rb
fog-test-me-1.10.0 lib/fog/aws/requests/storage/get_service.rb