mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
ahh machine api changed as well... gotta figure out what the api is returning now.
This commit is contained in:
parent
7515724cb1
commit
886df0e29b
2 changed files with 14 additions and 4 deletions
|
@ -31,7 +31,7 @@ module Fog
|
|||
body_object = {
|
||||
'name' => server_name,
|
||||
'image' => image_url,
|
||||
'machineType' => @api_url + @project + "/global/machineTypes/#{machine_name}",
|
||||
'machineType' => self.get_machine_resource(machine_name),
|
||||
'networkInterfaces' => [{
|
||||
'network' => @api_url + @project + "/global/networks/#{network_name}"
|
||||
}]
|
||||
|
@ -42,8 +42,17 @@ module Fog
|
|||
response = self.build_response(result)
|
||||
end
|
||||
|
||||
end
|
||||
private
|
||||
|
||||
def get_machine_resource machine_name, zone_name
|
||||
|
||||
machine_types = self.list_machine_types zone_name
|
||||
p machine_types
|
||||
p @api_url
|
||||
|
||||
@api_url + @project + "/zones/#{zone_name}/machineTypes/#{machine_name}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,10 +12,11 @@ module Fog
|
|||
|
||||
class Real
|
||||
|
||||
def list_machine_types
|
||||
def list_machine_types(zone_name)
|
||||
api_method = @compute.machine_types.list
|
||||
parameters = {
|
||||
'project' => 'google'
|
||||
'project' => @project,
|
||||
'zone' => zone_name,
|
||||
}
|
||||
|
||||
result = self.build_result(api_method, parameters)
|
||||
|
|
Loading…
Reference in a new issue