(context)
return resource
If the endpoint property is present, it will add a service endpoint.
If the endpoint property is present, it will add a service endpoint.
If the endpoint property is present it will add a service endpoint .
def AddServiceEndpointIfNeeded(context):
  """If the endpoint property is present, it will add a service endpoint."""
  prop = context.properties
  if ENDPOINT_NAME not in prop:
    return []
  network = common.MakeGlobalComputeLink(context, default.NETWORK)
  reference = '$(ref.' + MakeVMName(context) + '.name)'
  address = common.MakeFQHN(context, reference)
  name = prop[ENDPOINT_NAME]
  resource = [
      {
          'name': name,
          'type': default.ENDPOINT,
          'properties': {
              'addresses': [
                  {'address': address}
              ],
              'dnsIntegration': {
                  'networks': [network]
              }
          }
      }
  ]
  return resource
def AddServiceEndpointIfNeeded ( context ) : prop = context . properties if ENDPOINT_NAME not in prop : return [ ] network = common . MakeGlobalComputeLink ( context , default . NETWORK ) reference = '$(ref.' + MakeVMName ( context ) + '.name)' address = common . MakeFQHN ( context , reference ) name = prop [ ENDPOINT_NAME ] resource = [ { 'name' : name , 'type' : default . ENDPOINT , 'properties' : { 'addresses' : [ { 'address' : address } ] , 'dnsIntegration' : { 'networks' : [ network ] } } } ] return resource