HIGUCHI Yuta | 60a1014 | 2013-06-14 15:50:10 -0700 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.flowmanager.web; |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 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 | |
admin | 944ef4f | 2013-10-08 17:48:37 -0700 | [diff] [blame] | 9 | /** |
HIGUCHI Yuta | eb567aa | 2013-10-08 19:27:35 -0700 | [diff] [blame] | 10 | * REST API implementation for the Flow Manager. |
admin | 944ef4f | 2013-10-08 17:48:37 -0700 | [diff] [blame] | 11 | */ |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 12 | public class FlowWebRoutable implements RestletRoutable { |
| 13 | /** |
| 14 | * Create the Restlet router and bind to the proper resources. |
| 15 | */ |
| 16 | @Override |
| 17 | public Restlet getRestlet(Context context) { |
| 18 | Router router = new Router(context); |
Pavlin Radoslavov | 0e0525e | 2013-03-04 15:49:11 -0800 | [diff] [blame] | 19 | router.attach("/add/json", AddFlowResource.class); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 20 | router.attach("/add-shortest-path/json", AddShortestPathFlowResource.class); |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 21 | router.attach("/delete/{flow-id}/json", DeleteFlowResource.class); |
| 22 | router.attach("/get/{flow-id}/json", GetFlowByIdResource.class); |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 23 | router.attach("/getall/json", GetAllFlowsResource.class); |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 24 | router.attach("/getsummary/{flow-id}/{max-flows}/json", GetSummaryFlowsResource.class); |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 25 | return router; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Set the base path for the Topology |
| 30 | */ |
| 31 | @Override |
| 32 | public String basePath() { |
| 33 | return "/wm/flow"; |
| 34 | } |
| 35 | } |