Sha256: 17f0a3bb3a766b56714678123bbc9579db9ba1433bc28f7fa11ec89f99ca348d

Contents?: true

Size: 1 KB

Versions: 14

Compression:

Stored size: 1 KB

Contents

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
            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
            if url_map.pathMatchers
              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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-google-0.6.0 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.5.5 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.5.4 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.5.3 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.5.2 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.5.1 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.5.0 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.4.2 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.4.1 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.4.0 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.3.2 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.3.1 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.3.0 lib/fog/compute/google/requests/update_url_map.rb
fog-google-0.2.0 lib/fog/compute/google/requests/update_url_map.rb