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); |
Pavlin Radoslavov | 0e0525e | 2013-03-04 15:49:11 -0800 | [diff] [blame] | 16 | router.attach("/add/json", AddFlowResource.class); |
Pavlin Radoslavov | 916832f | 2013-03-14 17:48:41 -0700 | [diff] [blame] | 17 | router.attach("/clear/{flow-id}/json", ClearFlowResource.class); |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 18 | router.attach("/delete/{flow-id}/json", DeleteFlowResource.class); |
| 19 | router.attach("/get/{flow-id}/json", GetFlowByIdResource.class); |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 20 | router.attach("/getall-by-installer-id/{installer-id}/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", GetAllFlowsByInstallerIdResource.class); |
| 21 | router.attach("/getall-by-endpoints/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", GetAllFlowsByEndpointsResource.class); |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 22 | router.attach("/getall/json", GetAllFlowsResource.class); |
| 23 | return router; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Set the base path for the Topology |
| 28 | */ |
| 29 | @Override |
| 30 | public String basePath() { |
| 31 | return "/wm/flow"; |
| 32 | } |
| 33 | } |