Floodlight REST API pre-v1.0
The Floodlight REST API
This documentation is for pre-v1.0 versions of Floodlight, such as v0.9 and v0.91. Please consider upgrading to Floodlight v1.0, which has separate documentation here. |
The REST API is the recommended interface to develop applications utilizing Floodlight supported features.
For the REST calls that use switch DPID, you can obtain it from floodlight UI. After the floodlight is up and running, you can go to your browser and type in a URL as follows
http://192.168.110.2:8080/ui/index.html (Replace 192.168.110.2 with the proper inet address).
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 | Method | Description | Arguments |
---|---|---|---|
/wm/core/switch/all/<statType>/json | GET | Retrieve aggregate stats across all switches | statType: port, queue, flow, aggregate, desc, table, features |
/wm/core/switch/<switchId>/<statType>/json | GET | Retrieve per switch stats | switchId: Valid Switch DPID (XX:XX:XX:XX:XX:XX:XX:XX) |
/wm/core/controller/switches/json | GET | List of all switch DPIDs connected to the controller | none |
/wm/core/controller/summary/json | GET | Controller summary (# of Switches, # of Links, etc) | none |
/wm/core/counter/<counterTitle>/json | GET | List of global traffic counters in the controller (across all switches) | counterTitle: "all" or something of the form <DPID>_<COUNTER_NAME>_<SUB_CATEGORY> |
/wm/core/counter/<switchId>/<counterName>/json | GET | List of traffic counters per switch | switchId: Valid Switch DPID |
/wm/core/memory/json | GET | Current controller memory usage | none |
/wm/core/health/json | GET | Status/Health of REST API | none |
/wm/core/system/uptime/json | GET | Controller uptime | none |
/wm/topology/links/json | GET | List all the inter-switch links. Note that these are only for switches connected to the same controller. This is not available in the 0.8 release. | none |
/wm/topology/switchclusters/json | GET | List of all switch clusters connected to the controller. This is not available in the 0.8 release. | none |
/wm/topology/external-links/json | GET | Show "external" links, i.e., multi-hop links discovered by BDDP instead of LLDP packets | none |
/wm/topology/links/json | GET | Show DIRECT and TUNNEL links discovered based on LLDP packets | none |
/wm/device/ | GET | List of all devices tracked by the controller. This includes MACs, IPs, and attachment points. | Passed as GET parameters: mac (colon-separated hex-encoded), ipv4 (dotted decimal), vlan, dpid attachment point DPID (colon-separated hex-encoded) and port the attachment point port. |
/wm/staticflowentrypusher/json | POST/DELETE | Add/Delete static flow | HTTP POST data (add flow), HTTP DELETE (for deletion) |
/wm/staticflowentrypusher/list/<switch>/json | GET | List static flows for a switch or all switches | switch: Valid Switch DPID (XX:XX:XX:XX:XX:XX:XX:XX) or "all" |
/wm/staticflowentrypusher/clear/<switch>/json | GET | Clear static flows for a switch or all switches | switch: Valid Switch DPID (XX:XX:XX:XX:XX:XX:XX:XX) or "all" |
More information available on How to Use Static Flow Pusher API |
|
|
|
/networkService/v1.1/tenants/<tenant>/networks/<network> | PUT/POST/DELETE | Creates a new virtual network. Name and ID are required, gateway is optional. | URI argument: tenant: Currently ignored. network: ID (not name) of the network |
/networkService/v1.1/tenants/<tenant>/networks/<network>/ports/<port>/attachment | PUT/DELETE | Attaches a host to a virtual network. | URI argument: tenant: Currently ignored. network: ID (not name) of the network. port: Logical port name |
/networkService/v1.1/tenants/<tenant>/networks | GET | Shows all networks and their gateway, ID, and hosts mac in json format. | URI argument: tenant: Currently ignored. |
More information available on Virtual Network Filter REST API |
|
|
|
/wm/firewall/module/<op>/json | GET |
| query the status of, enable, and disable the firewall |
/wm/firewall/rules/json | GET/POST/DELETE | GET: None | List all existing rules in json format |
More information available on Firewall REST API |
|
|
|
For Floodlight developers, check out how to add new REST APIs to Floodlight services at How to Add Services to a Module.