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.
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[].
admin@ncs> request devices device ce0 live-status ios-stats:exec show args ip dhcp binding
Sorry, forgot to mention that I would like to do it from Java package…
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[].
THANKS!!!! Just the thing I needed!