this is my first use time using JAVA api
I just want to save value from my script environment
this is the command I'm using
Code: Select all
public static void main(String[] args) throws Exception
{
ApiConnection con = ApiConnection.connect("10.0.0.1"); // connect to router
con.login("admin","admin"); // log in to router
List<Map<String, String>> rs = con.execute("/system/script/environment/print where name=ID return value ");
for (Map<String,String> r : rs) {
ID = r.toString();
}
System.out.println("this is the router id - " + ID);
con.close(); // disconnect from router
}
Code: Select all
this is the router id - tag=2, data={value=Office1}
Thanks,