Sha256: b8c1ed3160fa7d5b9728f725e14b8b7b7414504db310775117326cebc60b36bd

Contents?: true

Size: 1.6 KB

Versions: 25

Compression:

Stored size: 1.6 KB

Contents

module Fog
  module Image
    class OpenStack
      class V1
        class Real
          def get_image_by_id(image_id)
            request(
              :expects => [200],
              :method  => 'HEAD',
              :path    => "images/#{image_id}"
            )
          end
        end

        class Mock
          def get_image_by_id(image_id)
            response = Excon::Response.new
            response.status = [200, 204][rand(2)]
            response.headers = {
              'X-Image-Meta-Checksum'         => '8a40c862b5735975d82605c1dd395796',
              'X-Image-Meta-Container_format' => 'aki',
              'X-Image-Meta-Created_at'       => '2016-01-06T03:22:20.000000',
              'X-Image-Meta-Deleted'          => 'False',
              'X-Image-Meta-Disk_format'      => 'aki',
              'X-Image-Meta-Id'               => image_id,
              'X-Image-Meta-Is_public'        => 'True',
              'X-Image-Meta-Min_disk'         => 0,
              'X-Image-Meta-Min_ram'          => 0,
              'X-Image-Meta-Name'             => 'cirros-0.3.4-x86_64-uec-kernel',
              'X-Image-Meta-Owner'            => '13cc6052265b41529e2fd0fc461fa8ef',
              'X-Image-Meta-Protected'        => 'False',
              'X-Image-Meta-Size'             => 4979632,
              'X-Image-Meta-Status'           => 'deactivated',
              'X-Image-Meta-Updated_at'       => '2016-02-25T03:02:05.000000',
              'X-Image-Meta-Property-foo'     => 'bar'
            }
            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/v1/requests/get_image_by_id.rb
fog-openstack-0.3.10 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.1.30 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.1.29 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.3.9 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.1.28 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.3.8 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.3.7 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.3.6 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.3.5 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.3.4 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.3.3 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.3.2 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.3.0 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.2.4 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.2.3 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.2.2 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.2.1 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-openstack-0.2.0 lib/fog/image/openstack/v1/requests/get_image_by_id.rb
fog-zj-0.1.28 lib/fog/image/openstack/v1/requests/get_image_by_id.rb