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]

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

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)

session.getSALService(NotificationProviderService.class) NodeUpdatedBuilder builder = new NodeUpdatedBuilder(); NodeId nodeId = new NodeId("node_001"); //Setting node id NodeKey nodeKey = new NodeKey(nodeId); InstanceIdentifier<node> 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());

notifService.publish(builder.build());

Same is explained at below link:

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

-Kanika