How To Access Data In MD-SAL From MountPoint

MD-SAL provides three different APIs to access data in the common data store:

  • Java generated DTOs – Binding Aware
  • DOM APIs – Binding Independent
  • HTTP Restconf APIs

In this post we will see how to access data in MD-SAL using each of this method. For first two, we need to get MountService from Provider context  and then get the MountInstance for inventory path to the device so that we can read configuration data, invoke RPCs and so on.

Let’s say we have an instance of node “node_001″ in MD-SAL and we want to get the mount instance of this node.

YANG/XML representation of this node will be:

 Accessing MD-SAL Data From Binding Aware Components

Carefully note:

  • The packages imported (sal.binding.api & yang.binding)
  • Session is an instance of ProviderContext
  • Use of method getSALService
  • The way of creating instance identifier

 Accessing MD-SAL Data From Binding Independent Components

Carefully note:

  • The packages imported (sal.core.api & yang.data)
  • Session is an instance of ProviderSession
  • Use of method getService
  • The way of creating instance identifier

 Accessing MD-SAL Data Using RESTCONF APIs

Below RESTCONF APIs can be used to access data:

  • http://<controller-ip>:8080/restconf/operational/opendaylight-inventory:nodes/
  • http://<controller-ip>:8080/restconf/config/opendaylight-inventory:nodes/opendaylight-inventory:node/node_001/yang-ext:mount/

References

  • https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Developer_Guide

Comments

  1. baogege says

    Hi,I am a newby to the ODL, I want to get the options attribute from ovsdb.yang,I don’t know how to use the method you gave,is there any other method to get it?

Leave a Reply

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