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


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

asked 2014-11-11 13:07:19 -0700

scurtis gravatar image

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);
} catch (ConstructionException e) {

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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-06-25 19:35:23 -0700

jeffcavalcante gravatar image

updated 2015-06-25 19:37:42 -0700

You have to save them on the network-topology container of ODL's database.

Create an InstanceIdentifier to the network-topology/topology, then create a WriteOnly transaction and save the Node object you've created.

Hope I've helped.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools



Asked: 2014-11-11 13:07:19 -0700

Seen: 68 times

Last updated: Jun 25 '15