def server_add(s_name, s_ip, s_state=None, **connection_args):
 ret = True
 if server_exists(s_name, **connection_args):
  return False
 nitro = _connect(**connection_args)
 if (nitro is None):
  return False
 server = NSServer()
 server.set_name(s_name)
 server.set_ipaddress(s_ip)
 if (s_state is not None):
  server.set_state(s_state)
 try:
  NSServer.add(nitro, server)
 except NSNitroError as error:
  log.debug('netscaler module error - NSServer.add() failed: {0}'.format(error))
  ret = False
 _disconnect(nitro)
 return ret

def server_add ( s_name , s_ip , s_state = None , ** connection_args ) : ret = True if server_exists ( s_name , ** connection_args ) : return False nitro = _connect ( ** connection_args ) if ( nitro is None ) : return False server = NSServer ( ) server . set_name ( s_name ) server . set_ipaddress ( s_ip ) if ( s_state is not None ) : server . set_state ( s_state ) try : NSServer . add ( nitro , server ) except NSNitroError as error : log . debug ( 'netscaler module error - NSServer.add() failed: {0}' . format ( error ) ) ret = False _disconnect ( nitro ) return ret
add a server note: the default server state is enabled cli example: .