Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

Revision history [back]

click to hide/show revision 1
initial version

How do I programatically load new switches into ODL so they are visible in the console

I'm trying to programatically create switches in a custom plugin that loads some set inventory so it is visible in the ODL console. The code doing the work makes use of the switch manager service as follows:

try {
    Node node = new Node(Node.NodeIDType.OPENFLOW, Long.valueOf(1L));
    Switch newSwitch = new Switch(node);
    switchManager.getNetworkDevices().add(newSwitch);
} catch (ConstructionException e) {
    e.printStackTrace();
}

I don't get any exceptions thrown but I also don't get any switches visible. When I print the contents of the devices out after the fact the new switch does not appear in the list.

Is this the correct way to do something like this or am I bypassing some internal caching somewhere.

When I get this working I'd also like to programatically create host devices as well.

Thanks in advance.