class Fog::Compute::Google::UrlMap
Constants
- RUNNING_STATE
Public Instance Methods
add_host_rules(hostRules)
click to toggle source
# File lib/fog/google/models/compute/url_map.rb, line 55 def add_host_rules hostRules hostRules= [hostRules] unless hostRules.class == Array service.update_url_map(self, hostRules) reload end
add_path_matchers(pathMatchers, hostRules)
click to toggle source
# File lib/fog/google/models/compute/url_map.rb, line 61 def add_path_matchers(pathMatchers, hostRules) pathMatchers = [pathMatchers] unless pathMatchers.class == Array hostRules=[hostRules] unless hostRules.class == Array service.update_url_map(self, hostRules, pathMatchers) reload end
destroy(async=true)
click to toggle source
# File lib/fog/google/models/compute/url_map.rb, line 38 def destroy(async=true) requires :name operation = service.delete_url_map(name) if not async Fog.wait_for do operation = service.get_global_operation(operation.body["name"]) operation.body["status"] == "DONE" end end operation end
ready?()
click to toggle source
# File lib/fog/google/models/compute/url_map.rb, line 68 def ready? begin service.get_url_map(self.name) true rescue Fog::Errors::NotFound false end end
reload()
click to toggle source
# File lib/fog/google/models/compute/url_map.rb, line 77 def reload requires :name return unless data = begin collection.get(name) rescue Excon::Errors::SocketError nil end new_attributes = data.attributes merge_attributes(new_attributes) self end
save()
click to toggle source
# File lib/fog/google/models/compute/url_map.rb, line 20 def save requires :name, :defaultService options = { 'defaultService' => defaultService, 'description' => description, 'fingerprint' => fingerprint, 'hostRules' => hostRules, 'pathMatchers' => pathMatchers, 'tests' => tests } data = service.insert_url_map(name, options).body operation = Fog::Compute::Google::Operations.new(:service => service).get(data['name']) operation.wait_for { !pending? } reload end
validate()
click to toggle source
# File lib/fog/google/models/compute/url_map.rb, line 51 def validate service.validate_url_map self end