def vserver_add(v_name, v_ip, v_port, v_type, **connection_args):
 ret = True
 if vserver_exists(v_name, **connection_args):
  return False
 nitro = _connect(**connection_args)
 if (nitro is None):
  return False
 vserver = NSLBVServer()
 vserver.set_name(v_name)
 vserver.set_ipv46(v_ip)
 vserver.set_port(v_port)
 vserver.set_servicetype(v_type.upper())
 try:
  NSLBVServer.add(nitro, vserver)
 except NSNitroError as error:
  log.debug('netscaler module error - NSLBVServer.add() failed: {0}'.format(error))
  ret = False
 _disconnect(nitro)
 return ret

def vserver_add ( v_name , v_ip , v_port , v_type , ** connection_args ) : ret = True if vserver_exists ( v_name , ** connection_args ) : return False nitro = _connect ( ** connection_args ) if ( nitro is None ) : return False vserver = NSLBVServer ( ) vserver . set_name ( v_name ) vserver . set_ipv46 ( v_ip ) vserver . set_port ( v_port ) vserver . set_servicetype ( v_type . upper ( ) ) try : NSLBVServer . add ( nitro , vserver ) except NSNitroError as error : log . debug ( 'netscaler module error - NSLBVServer.add() failed: {0}' . format ( error ) ) ret = False _disconnect ( nitro ) return ret
add a new lb vserver cli example: .