You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mscohen02 edited this page Jan 2, 2012
·
2 revisions
The Floodlight REST API
Floodlight supports a RESTful API for accessing state. While the functions available in this API are evolving, several key functions are supported today. The API is available at port 8080 of the controller.
An example REST call is:
curl http://192.168.110.2:8080/wm/core/controller/switches/json
Other functions available via REST:
!URI
!Description
!Arguments
Extending the REST API
The Floodlight REST API is based on [Restlet|http://www.restlet.org]. Its best to walk through the Restlet documentation as a first step. The steps to adding a new Restlet include:
Registering a Restlet in net.floodlightcontroller.controller.internal.Controller. You can see the main restlet registered as "restlets.add(new CoreWebRoutable());".
Implement a new class like CoreWebRoutable (or extend it directly) that provides getRestlet() and basePath() functions.
Implement a class like net.floodlightcontroller.core.web.SwitchStatisticsResource that extends ServerResource() and implements a @Get or @Put function.
The REST API mechanism is Floodlight is not stable / finalized at this point.