@RegisterWithArgChecks(name='evpn_prefix.add_local', req_args=[EVPN_ROUTE_TYPE, ROUTE_DISTINGUISHER, NEXT_HOP], opt_args=[EVPN_ESI, EVPN_ETHERNET_TAG_ID, REDUNDANCY_MODE, MAC_ADDR, IP_ADDR, IP_PREFIX, GW_IP_ADDR, EVPN_VNI, TUNNEL_TYPE, PMSI_TUNNEL_TYPE])
def add_evpn_local(route_type, route_dist, next_hop, **kwargs):
 if ((route_type in [EVPN_ETH_AUTO_DISCOVERY, EVPN_ETH_SEGMENT]) and (kwargs['esi'] == 0)):
  raise ConfigValueError(conf_name=EVPN_ESI, conf_value=kwargs['esi'])
 try:
  tm = CORE_MANAGER.get_core_service().table_manager
  label = tm.update_vrf_table(route_dist, next_hop=next_hop, route_family=VRF_RF_L2_EVPN, route_type=route_type, **kwargs)
  if label:
   label = label[0]
  return [{EVPN_ROUTE_TYPE: route_type, ROUTE_DISTINGUISHER: route_dist, VRF_RF: VRF_RF_L2_EVPN, VPN_LABEL: label}.update(kwargs)]
 except BgpCoreError as e:
  raise PrefixError(desc=e)

@ RegisterWithArgChecks ( name = 'evpn_prefix.add_local' , req_args = [ EVPN_ROUTE_TYPE , ROUTE_DISTINGUISHER , NEXT_HOP ] , opt_args = [ EVPN_ESI , EVPN_ETHERNET_TAG_ID , REDUNDANCY_MODE , MAC_ADDR , IP_ADDR , IP_PREFIX , GW_IP_ADDR , EVPN_VNI , TUNNEL_TYPE , PMSI_TUNNEL_TYPE ] ) def add_evpn_local ( route_type , route_dist , next_hop , ** kwargs ) : if ( ( route_type in [ EVPN_ETH_AUTO_DISCOVERY , EVPN_ETH_SEGMENT ] ) and ( kwargs [ 'esi' ] == 0 ) ) : raise ConfigValueError ( conf_name = EVPN_ESI , conf_value = kwargs [ 'esi' ] ) try : tm = CORE_MANAGER . get_core_service ( ) . table_manager label = tm . update_vrf_table ( route_dist , next_hop = next_hop , route_family = VRF_RF_L2_EVPN , route_type = route_type , ** kwargs ) if label : label = label [ 0 ] return [ { EVPN_ROUTE_TYPE : route_type , ROUTE_DISTINGUISHER : route_dist , VRF_RF : VRF_RF_L2_EVPN , VPN_LABEL : label } . update ( kwargs ) ] except BgpCoreError as e : raise PrefixError ( desc = e )
adds evpn route from vrf identified by *route_dist* .