Ask Your Question
0

How to Write own REST API

asked 2015-02-03 05:59:10 -0700

anonymous user

Anonymous

Hello, I want to access packet count hitting controller. I am able to retrieve same by writing a module in opendaylight controller. Now I want to access packet count using REST calls. I don't know how to expose these services to SAL. Basically, how should I proceed with writing own REST API? Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-06-25 19:32:03 -0700

jeffcavalcante gravatar image

In MD-SAL, you create a YANG model with the data you want to expose and it will be available for REST calls, then set up your features plugin to install the feature through karaf.

Check this example on how to generate a simple set of modules, including a model and a provider:

https://wiki.opendaylight.org/view/OpenDaylightToolkit:MD-SAL-SimpleArchetype#WhatdoestheMD-SALArchetypeProvidefor_us.3F

Hope I've helped.

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

Question Tools

Follow
1 follower

Stats

Asked: 2015-02-03 05:59:10 -0700

Seen: 88 times

Last updated: Jun 25 '15