dana-i2cat/opennaas — pull request #938 by adrian-rosello (2014-10-02 15:31:53+00:00)
Title: Feature/router topology discovery capab

The TopologyDiscovery capability discovers the neighbours of a specific router device. This pull request includes the capability implementation and the JunOS 10.10 actionset.

The actions use the capability model, so the capability directly returns the actions response. The implementation contains there different Actions. They can be divided in two groups:

Group1 (use xPATH to parse response, don't use Velocity Template)

For this group, a new type of Command needed to be executed. The already existing ones fulfilled the rpc message with many elements. The GenericJunosCommand accepts any xml and inserts it just as child of the tag. The two actions using this approach are:

* getLocalInformation: Returns the deviceId and the different interfaces with their portId and interfaceName. It uses xPATH to parse de Response, and it does not use a velocity template.
* getNeighbours: Returns the to which remotes devices (deviceId) all the interfaces are connected to.

Group2 (use xPATH to parse response, use Velocity Template)

Since Erik's switches does not response the remote port Id a port is connected to (using the getNeighbours action), we needed to iterat through all the individual interfaces.

* getInterfaceNeighbour: Returns the id of the remote port id this interface is connected to.