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

0

Is there a way to set the Id's on the nodes?

asked 2014-06-03 11:25:57 -0700

CobyS gravatar image

The node ids in open daylight appear to be pseudo random. Is there a way to programmatically set them to something else?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-06-03 21:53:44 -0700

updated 2014-06-03 21:55:00 -0700

Hi CobyS,

Not sure if this is what you are looking for - but this is how you can set the NodeId before publishing the Node to MD-SAL:

NotificationProviderService notifService = session.getSALService(NotificationProviderService.class)
NodeUpdatedBuilder builder = new NodeUpdatedBuilder();
NodeId nodeId = new NodeId("node_001"); //Setting node id
NodeKey nodeKey = new NodeKey(nodeId);
InstanceIdentifier<Node> identifier = InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeKey).toInstance();
NodeRef nodeRef = new NodeRef(identifier);
builder.setId(nodeId);
builder.setNodeRef(nodeRef);
notifService.publish(builder.build());

Same is explained at below link:

http://sdntutorials.com/how-to-publish-node-to-md-sal/

-Kanika

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

Question Tools

Follow
1 follower

Stats

Asked: 2014-06-03 11:25:57 -0700

Seen: 228 times

Last updated: Jun 03 '14