def create_lrouter(cluster, tenant_id, display_name, nexthop):
 tags = [{'tag': tenant_id, 'scope': 'os_tid'}]
 display_name = _check_and_truncate_name(display_name)
 lrouter_obj = {'display_name': display_name, 'tags': tags, 'routing_config': {'default_route_next_hop': {'gateway_ip_address': nexthop, 'type': 'RouterNextHop'}, 'type': 'SingleDefaultRouteImplicitRoutingConfig'}, 'type': 'LogicalRouterConfig'}
 try:
  return json.loads(do_single_request(HTTP_POST, _build_uri_path(LROUTER_RESOURCE), json.dumps(lrouter_obj), cluster=cluster))
 except NvpApiClient.NvpApiException:
  LOG.exception(_('An exception occured while communicating with the NVP controller for cluster:%s'), cluster.name)
  raise

def create_lrouter ( cluster , tenant_id , display_name , nexthop ) : tags = [ { 'tag' : tenant_id , 'scope' : 'os_tid' } ] display_name = _check_and_truncate_name ( display_name ) lrouter_obj = { 'display_name' : display_name , 'tags' : tags , 'routing_config' : { 'default_route_next_hop' : { 'gateway_ip_address' : nexthop , 'type' : 'RouterNextHop' } , 'type' : 'SingleDefaultRouteImplicitRoutingConfig' } , 'type' : 'LogicalRouterConfig' } try : return json . loads ( do_single_request ( HTTP_POST , _build_uri_path ( LROUTER_RESOURCE ) , json . dumps ( lrouter_obj ) , cluster = cluster ) ) except NvpApiClient . NvpApiException : LOG . exception ( _ ( 'An exception occured while communicating with the NVP controller for cluster:%s' ) , cluster . name ) raise
create a nvp logical router on the specified cluster .