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 to insert data to md-sal data model?!

asked 2014-11-05 22:59:59 -0700

Seunghyeon gravatar image

updated 2014-11-06 00:27:50 -0700

i created my model as

container fresco-db{

     list fresco-db-inner {
         description "Dynamic data area
             Write - fresco modules when those produce result of processing
             Read - fresco module has dependency with previous modules   -Core have to register onDataChange about this data for providing scheduler
             Remove - fresco module has dependency with previous modules, after read data";
         key "application-module-id";
         leaf application-module-id {
             description " unique identificaion for fresco-db (e.g., fresco db for module 5 in application number 1 is represented as   1-5  ";
             type string;
         leaf identifier {
             type int32;
         container outdata {
             list outdata-inner {
                 key "event-id";
                 leaf event-id {
                     description "identificaion of event";
                     type int32;
                 leaf output-data {
                     description "(e.g., Data-type;result, condition; results …)";
                     type binary;
         leaf global-output-data {
             description "(e.g., Data-type;result, condition; results …)";
             type binary;
     } // end of list fresco-db

and i hope to insert my data from txtfile.yangElement The textfile.yangElemnet as

{ "fresco-db-inner" : { "application-module-id":"temp", "identifier":"123", "outdata" : { "event-id" .... }

How can i do that? please give me a references

or how to parse json to yang data model ?

Last question is thow can i use restAPI for rpc?

i already defined the rpc ~~ { input : ... }

And implenents myservice, But i can not access the rpc Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2014-11-06 16:23:27 -0700

anu.nair gravatar image

You don't have to do anything. ODL takes care of json to yang model and put in data store.

The rest API's can be accessed from api doc. try the POST and GET of your container from this page

API explorer is accesible at http://localhost:8080/apidoc/explorer

Karaf: http://localhost:8181/apidoc/explorer/index.html

edit flag offensive delete publish link more


Thanks for your answer. I have solved this problem through RestAPI. Um, by the way, do you know about the other method without RestAPI? I analysis RestAPI call stack for extracting core functions to decrypt payload to MD-sal datastore. However, it is quite complex. If i have enough time to analyze this, i supposed to know about that. If you know about the other method, please teach me. Thanks again

Seunghyeon ( 2014-11-09 17:20:43 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-11-05 22:59:59 -0700

Seen: 327 times

Last updated: Nov 06 '14