def GenerateLoadBalancer()

in templates/http_load_balancer.py [0:0]


def GenerateLoadBalancer(context):
  """Generates the urlMap and globalForwardingRule part of the LB."""
  name = context.env['name']
  prop = context.properties

  resource = [
      {
          'name': common.AutoName(name, default.URL_MAP),
          'type': default.URL_MAP,
          'properties': {
              'defaultService': prop[DEFAULT_SERVICE],
              'hostRules': prop[HOST_RULES],
              'pathMatchers': prop[PATH_MATCHERS],
          }
      }, {
          'name': common.AutoName(name, default.PROXY),
          'type': default.PROXY,
          'properties': {
              'urlMap': common.AutoRef(name, default.URL_MAP),
          }
      },
  ]  # pyformat: disable
  return resource