02-15-2016 09:05 PM
I’m looking for easiest way to execute a "show ip dhcp binding“ command on a Cisco device. As far as I can see this is not covered with NED and modelled in Yang. I see classes NedWorked, NedMux, SSHConnection but don’t understand how they fit together. Any example on how to put it together would be much appreciated.
Solved! Go to Solution.
02-15-2016 09:06 PM
Just like any other action:
--------
NavuAction action1 = device.container("live-status").
container("ios-stats","exec").
action("show");
ConfXMLParam[] args1 = new ConfXMLParam[1];
Conflict l1 = new ConfList();
l1.addElem(new ConfBuf(“ip dhcp binding"));
args1[0] = new ConfXMLParamValue("ios-stats", "args", l1);
// I execute the action and receive response as XML
ConfXMLParam[] resArr1 = action1.call(args1);
--------
You then need to navigate the output XML array…there are different ways, depending of your taste. Check the JavaDoc for ConfXMLParam[].
02-15-2016 09:05 PM
admin@ncs> request devices device ce0 live-status ios-stats:exec show args ip dhcp binding
02-15-2016 09:06 PM
Sorry, forgot to mention that I would like to do it from Java package…
02-15-2016 09:06 PM
Just like any other action:
--------
NavuAction action1 = device.container("live-status").
container("ios-stats","exec").
action("show");
ConfXMLParam[] args1 = new ConfXMLParam[1];
Conflict l1 = new ConfList();
l1.addElem(new ConfBuf(“ip dhcp binding"));
args1[0] = new ConfXMLParamValue("ios-stats", "args", l1);
// I execute the action and receive response as XML
ConfXMLParam[] resArr1 =