1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/google/requests/compute/list_images.rb
Ferran Rodenas 3ebe34c280 [google|compute] Refactor Compute to use the new Shared module
Commit d801b27 introduced a new Shared module with logic to initialize
a google_client_api and to make requests.

This commit refactors Compute to use the new Shared module.
2014-07-30 12:19:50 -07:00

29 lines
759 B
Ruby

module Fog
module Compute
class Google
class Mock
def list_images(project=@project)
images = data(project)[:images].values
build_excon_response({
"kind" => "compute#imageList",
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{project}/global/images",
"id" => "projects/#{project}/global/images",
"items" => images
})
end
end
class Real
def list_images(project=nil)
api_method = @compute.images.list
project=@project if project.nil?
parameters = {
'project' => project
}
request(api_method, parameters)
end
end
end
end
end