Properties properties = new Properties();
properties.put("url","http://localhost:8666");
properties.put("user","admin");
properties.put("password","coolgeek");
properties.put("command","addremoteserver");
properties.put("host","xxx.myserver.com");
properties.put("remoteserverid","rserver1");
properties.put("authmethod","password");
properties.put("remoteserverpassword","tiger");
//publickey requires calling the generateremoteserverpk prior.
//properties.put("authmethod","publickey");
//properties.put("authmethod","privatekey");
//properties.put("privatekeyinputfile","in.key");
//properties.put("port","22");
//properties.put("remotetype","linux");
String result = NGAPIClient.exec(properties);
|