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 | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 20 | router.attach("/delete/{flow-id}/json", DeleteFlowResource.class); |
| 21 | router.attach("/get/{flow-id}/json", GetFlowByIdResource.class); |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 22 | router.attach("/getall/json", GetAllFlowsResource.class); |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 23 | router.attach("/getsummary/{flow-id}/{max-flows}/json", GetSummaryFlowsResource.class); |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 24 | return router; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Set the base path for the Topology |
| 29 | */ |
| 30 | @Override |
| 31 | public String basePath() { |
Naoki Shiota | 862cc3b | 2013-12-13 15:42:50 -0800 | [diff] [blame] | 32 | return "/wm/onos/flows"; |
Pavlin Radoslavov | 5ab6851 | 2013-02-18 09:59:33 -0800 | [diff] [blame] | 33 | } |
| 34 | } |