Sha256: 5567725593dac6aa91a717b9475f0ace25d400d132683f1d70a15f13efb45290

Contents?: true

Size: 1.51 KB

Versions: 36

Compression:

Stored size: 1.51 KB

Contents

module Fog
  module Storage
    class InternetArchive
      class Real
        require 'fog/internet_archive/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::InternetArchive::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

36 entries across 34 versions & 6 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-internet-archive-0.0.1/lib/fog/internet_archive/requests/storage/get_service.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-internet-archive-0.0.1/lib/fog/internet_archive/requests/storage/get_service.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-internet-archive-0.0.1/lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.40.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.39.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-internet-archive-0.0.1 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.38.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.37.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.36.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.35.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-2.0.0.pre.0 lib/fog/internet_archive/requests/storage/get_service.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.34.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.33.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.32.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.31.0 lib/fog/internet_archive/requests/storage/get_service.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.30.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.29.0 lib/fog/internet_archive/requests/storage/get_service.rb
fog-1.28.0 lib/fog/internet_archive/requests/storage/get_service.rb