Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.flowcache.web; |
| 2 | |
| 3 | import net.floodlightcontroller.restserver.RestletRoutable; |
| 4 | |
| 5 | import org.restlet.Context; |
| 6 | import org.restlet.Restlet; |
| 7 | import org.restlet.routing.Router; |
| 8 | |
| 9 | public class FlowWebRoutable implements RestletRoutable { |
| 10 | /** |
| 11 | * Create the Restlet router and bind to the proper resources. |
| 12 | */ |
| 13 | @Override |
| 14 | public Restlet getRestlet(Context context) { |
| 15 | Router router = new Router(context); |
| 16 | router.attach("/add/{flow}/json", AddFlowResource.class); |
| 17 | router.attach("/delete/{flow-id}/json", DeleteFlowResource.class); |
| 18 | router.attach("/get/{flow-id}/json", GetFlowByIdResource.class); |
Pavlin Radoslavov | a10a9a8 | 2013-02-22 11:47:54 -0800 | [diff] [blame] | 19 | router.attach("/get/{installer-id}/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", GetFlowByInstallerIdResource.class); |
| 20 | router.attach("/getall/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", GetAllFlowsByEndpointsResource.class); |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 21 | router.attach("/getall/json", GetAllFlowsResource.class); |
| 22 | return router; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Set the base path for the Topology |
| 27 | */ |
| 28 | @Override |
| 29 | public String basePath() { |
| 30 | return "/wm/flow"; |
| 31 | } |
| 32 | } |