mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
3ebe34c280
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.
28 lines
661 B
Ruby
28 lines
661 B
Ruby
module Fog
|
|
module Compute
|
|
class Google
|
|
class Mock
|
|
def list_zones
|
|
zones = self.data[:zones].values
|
|
build_excon_response({
|
|
"kind" => "compute#zoneList",
|
|
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones",
|
|
"id" => "projects/#{@project}/zones",
|
|
"items" => zones
|
|
})
|
|
end
|
|
end
|
|
|
|
class Real
|
|
def list_zones
|
|
api_method = @compute.zones.list
|
|
parameters = {
|
|
'project' => @project
|
|
}
|
|
|
|
request(api_method, parameters)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|