(context)
return resource
Generates one backendService resource.
Generates one backendService resource.
Generates one backendService resource .
def GenerateBackendService(context):
  """Generates one backendService resource."""
  prop = context.properties
  port = prop[default.PORT]
  health_path = prop[default.HEALTH_PATH]
  default_srv = prop[default.SERVICE]
  outputs = prop.setdefault(GENERATED_PROP, dict())
  be_name = common.AutoName(context.env['name'], default.BACKEND_SERVICE)
  hc_name = common.AutoName(context.env['name'], default.HEALTHCHECK)

  # pyformat: disable
  resource = [
      {
          'name': hc_name,
          'type': default.HEALTHCHECK,
          'properties': {
              'port': port,
              'requestPath': health_path,
          }
      }, {
          'name': be_name,
          'type': default.BACKEND_SERVICE,
          'properties': {
              'port': port,
              'portName': default_srv,
              'backends': GenerateBackends(context),
              'healthChecks': [common.Ref(hc_name)],
              'generatedProperties': outputs
          }
      }
  ]
  # pyformat: enable
  return resource
def GenerateBackendService ( context ) : prop = context . properties port = prop [ default . PORT ] health_path = prop [ default . HEALTH_PATH ] default_srv = prop [ default . SERVICE ] outputs = prop . setdefault ( GENERATED_PROP , dict ( ) ) be_name = common . AutoName ( context . env [ 'name' ] , default . BACKEND_SERVICE ) hc_name = common . AutoName ( context . env [ 'name' ] , default . HEALTHCHECK ) # pyformat: disable resource = [ { 'name' : hc_name , 'type' : default . HEALTHCHECK , 'properties' : { 'port' : port , 'requestPath' : health_path , } } , { 'name' : be_name , 'type' : default . BACKEND_SERVICE , 'properties' : { 'port' : port , 'portName' : default_srv , 'backends' : GenerateBackends ( context ) , 'healthChecks' : [ common . Ref ( hc_name ) ] , 'generatedProperties' : outputs } } ] # pyformat: enable return resource