O'Reilly logo

JUNOS Automation Cookbook by Adam Chappell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Server application

In step 1, we simply copy the previous recipe collector.js file as a basis for our improvements. In step 2, we modify the variable determining the XML dialog with the network elements so that instead of maintaining a single string, it now maintains a list of strings which we intend the server to cycle through within an polling interval. In order to keep track of where we are in this list, we need a cursor - something to remind us of the message that we sent, and the next message that we should send. So in step 3, we add this to the constructor of JUNOSDevice() as an instance variable.

Next, in step 4, we implement sendNextMsg(), a method that can be used by the XML processing results in order to kick off the next request. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required