Sha256: 453ece4e1b0f5848f669b195cb598cfbca9b4a0530e9961a79f228bf26d1d4ad

Contents?: true

Size: 834 Bytes

Versions: 25

Compression:

Stored size: 834 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 Mock
          def download_image(_image_id, _content_range = nil)
            response = Excon::Response.new
            response.status = [200, 204][rand(2)]
            response.body = ""
            response
          end
        end
      end
    end
  end
end

Version data entries

25 entries across 23 versions & 3 rubygems

Version Path
fog-openstack-0.1.31 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.10 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.30 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.29 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.9 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.1.28 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.8 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.7 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.6 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.5 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.4 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.3 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.2 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.3.0 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.2.4 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.2.3 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.2.2 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.2.1 lib/fog/image/openstack/v2/requests/download_image.rb
fog-openstack-0.2.0 lib/fog/image/openstack/v2/requests/download_image.rb
fog-zj-0.1.28 lib/fog/image/openstack/v2/requests/download_image.rb