Sha256: 821e3d59c02cbccbf2516ec78d25246e9ed1201ab662f9944ae840922ed20c93

Contents?: true

Size: 996 Bytes

Versions: 14

Compression:

Stored size: 996 Bytes

Contents

module Fog
  module Compute
    class Google
      class Mock
        def get_image(image_name, project = @project)
          image = data(project)[:images][image_name] || {
            "error" => {
              "errors" => [
                {
                  "domain" => "global",
                  "reason" => "notFound",
                  "message" => "The resource 'projects/#{project}/global/images/#{image_name}' was not found"
                }
              ],
              "code" => 404,
              "message" => "The resource 'projects/#{project}/global/images/#{image_name}' was not found"
            }
          }
          build_excon_response(image)
        end
      end

      class Real
        def get_image(image_name, project = @project)
          api_method = @compute.images.get
          parameters = {
            "image" => image_name,
            "project" => project
          }

          request(api_method, parameters)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-google-0.6.0 lib/fog/compute/google/requests/get_image.rb
fog-google-0.5.5 lib/fog/compute/google/requests/get_image.rb
fog-google-0.5.4 lib/fog/compute/google/requests/get_image.rb
fog-google-0.5.3 lib/fog/compute/google/requests/get_image.rb
fog-google-0.5.2 lib/fog/compute/google/requests/get_image.rb
fog-google-0.5.1 lib/fog/compute/google/requests/get_image.rb
fog-google-0.5.0 lib/fog/compute/google/requests/get_image.rb
fog-google-0.4.2 lib/fog/compute/google/requests/get_image.rb
fog-google-0.4.1 lib/fog/compute/google/requests/get_image.rb
fog-google-0.4.0 lib/fog/compute/google/requests/get_image.rb
fog-google-0.3.2 lib/fog/compute/google/requests/get_image.rb
fog-google-0.3.1 lib/fog/compute/google/requests/get_image.rb
fog-google-0.3.0 lib/fog/compute/google/requests/get_image.rb
fog-google-0.2.0 lib/fog/compute/google/requests/get_image.rb