Sha256: 316ef27c9f19b9605dff61910e656771b01554521bcb20951c92ccdb7f47afe1

Contents?: true

Size: 1.6 KB

Versions: 20

Compression:

Stored size: 1.6 KB

Contents

module Fog
  module OpenStack
    class Image
      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

20 entries across 20 versions & 3 rubygems

Version Path
fog-openstack-1.1.3 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.1.2 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-fork-99 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.1.0 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.1.0.pre lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-apibank-1.0.102 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.11 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-apibank-1.0.101 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.10 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.9 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.8 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.7 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.6 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.5 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.4 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.3 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.2 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.1 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-1.0.0 lib/fog/openstack/image/v1/requests/get_image_by_id.rb
fog-openstack-0.3.1 lib/fog/openstack/image/v1/requests/get_image_by_id.rb