Sha256: da4be082d5e6ecdc28154662d10ec529e3af9f6d3e86b7b03be53c910eae095a

Contents?: true

Size: 928 Bytes

Versions: 14

Compression:

Stored size: 928 Bytes

Contents

module Fog
  module Image
    class OpenStack
      class V2
        class Real
          def download_image(image_id, _content_range = nil, params) # TODO: implement content range handling
            request_hash = {
              :expects  => [200, 204],
              :method   => 'GET',
              :raw_body => true,
              :path     => "images/#{image_id}/file",
            }
            request_hash[:response_block] = params[:response_block] if params[:response_block]
            request(request_hash).body
          end
        end # class Real

        class Mock
          def download_image(_image_id, _content_range = nil)
            response = Excon::Response.new
            response.status = [200, 204][rand(2)]
            response.body = ""
            response
          end # def list_tenants
        end # class Mock
      end # class OpenStack
    end
  end # module Identity
end # module Fog

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-openstack-0.1.25 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.24 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.23 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.22 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.21 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.20 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.19 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.18 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.17 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.15 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.14 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.13 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.12 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.11 lib/fog/image/openstack/v2/requests/download_image.rb