SDN Tutorials

Software Defined Networking For Beginners

  • Home
  • SDN Tools
  • SDN Resources
  • MD-SAL
  • Troubleshooting
  • QA
  • Contribute*

How to Lookup all NodeConnectors of a Node in MD-SAL

Posted by Kanika

Let’s say we have a node “node_oo1” and we want to lookup all the node connectors associated with this node in MD-SAL. First we create an instance identifier using the nodeId and nodeKey and then we lookup the node from MD-SAL. Once we get the node, we invoke getNodeConnector() api to get a list of node connectors.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
....
....
....
//session is an object of type ProviderContext
DataProviderService dataProviderService = session.getSALService(DataProviderService.class);
 
NodeId nodeId = new NodeId("node_oo1");
NodeKey nodeKey = new NodeKey(nodeId);
InstanceIdentifier<Node><Node> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).
                                                child(Node.class,nodeKey).toInstance();
Node node = (Node) dataProviderService.readOperationalData(nodeIdentifier);
List<NodeConnector> nodeConnetorList = node.getNodeConnector();

 

You might also like to read:

  • How To Publish Node To MD-SAL
  • How To Publish NodeConnector To MD-SAL
  • How To Look Up Data In MD-SAL
  • How To Publish Link To MD-SAL

Filed Under: MD-SAL, OpenDaylight

Comments

  1. cheap Holiday deals to Marrakech says

    July 25, 2015 at 5:01 am

    Keep all receipts relating to medication that
    you are still weather in marrakech in september the owner and are necessary for its well being.
    Never has a police officer to direct us to our next destination.

    Reply
  2. Karthik says

    January 27, 2016 at 5:10 am

    How to use data broker to read details from Operational Data?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

SUBSCRIBE TO OUR NEWSLETTER

Search This Site

Categories

  • MD-SAL
  • OpenDaylight
  • SDN
  • SDN Apps
  • Setup
  • Tutorials

Recent Comments

  • thiết kế nội thất phòng khách hiện đại on How To Publish NodeConnector To MD-SAL
  • thiết kế phòng khách chung cư on Steps To Install PlantUML On Windows 7
  • nâng mũi on Steps To Install PlantUML On Windows 7
  • bảng giá chung cư 31 láng hạ on Creating InstanceIdentifier For Binding Aware & Binding Independent Components
  • nâng mũi giá bao nhiêu on How To Import Maven Project From OpendayLight Git Repository To Eclipse

Copyright © 2019 · SDN Tutorials · Contact Us · Disclaimer · Privacy Policy