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/update_url_map.rb
snyquist2 8ad7e9e318 Merge remote-tracking branch 'new-upstream/master' into gce_l7
Conflicts:
	lib/fog/google/requests/compute/delete_backend_service.rb
2014-08-06 20:46:13 +00:00

39 lines
1 KiB
Ruby

module Fog
module Compute
class Google
class Mock
def update_url_map(url_map, host_rules)
Fog::Mock.not_implemented
end
end
class Real
def update_url_map(url_map, host_rules, path_matchers = nil)
api_method = @compute.url_maps.update
parameters = {
'project' => @project,
'urlMap' => url_map.name
}
# add new properties to the url_map resource
if url_map.hostRules then
url_map.hostRules.concat(host_rules)
else
url_map.hostRules = host_rules
end
# a path matcher can only be created with a host rule that uses it
if path_matchers then
if url_map.pathMatchers then
url_map.pathMatchers.concat(path_matchers)
else
url_map.pathMatchers = path_matchers
end
end
request(api_method, parameters, body_object=url_map)
end
end
end
end
end