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/insert_network.rb

30 lines
769 B
Ruby
Raw Normal View History

2012-10-22 20:15:33 -04:00
module Fog
module Compute
2012-12-04 15:05:11 -05:00
class Google
2012-10-22 20:15:33 -04:00
class Mock
def insert_network(network_name, ip_range, options = {})
2012-10-22 20:15:33 -04:00
Fog::Mock.not_implemented
end
end
class Real
def insert_network(network_name, ip_range, options = {})
2012-10-22 20:15:33 -04:00
api_method = @compute.networks.insert
parameters = {
'project' => @project,
}
body_object = {
'name' => network_name,
'IPv4Range' => ip_range
}
body_object['description'] = options[:description] if options[:description]
body_object['gatewayIPv4'] = options[:gateway_ipv4] if options[:gateway_ipv4]
request(api_method, parameters, body_object)
2012-10-22 20:15:33 -04:00
end
end
end
end
end