Jonathan Hart | 4701671 | 2014-02-07 12:41:35 -0800 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.networkgraph.web; |
| 2 | |
| 3 | import org.restlet.Context; |
| 4 | import org.restlet.Restlet; |
| 5 | import org.restlet.routing.Router; |
| 6 | |
| 7 | import net.floodlightcontroller.restserver.RestletRoutable; |
| 8 | |
| 9 | public class NetworkGraphWebRoutable implements RestletRoutable { |
| 10 | |
| 11 | @Override |
| 12 | public Restlet getRestlet(Context context) { |
| 13 | Router router = new Router(context); |
Jonathan Hart | 891d050 | 2014-02-10 10:04:08 -0800 | [diff] [blame] | 14 | router.attach("/rc/switches/json", RamcloudSwitchesResource.class); |
| 15 | router.attach("/rc/links/json", RamcloudLinksResource.class); |
Jonathan Hart | 69864df | 2014-02-13 10:44:12 -0800 | [diff] [blame] | 16 | router.attach("/rc/ports/json", RamcloudPortsResource.class); |
Jonathan Hart | 891d050 | 2014-02-10 10:04:08 -0800 | [diff] [blame] | 17 | router.attach("/ng/switches/json", NetworkGraphSwitchesResource.class); |
| 18 | router.attach("/ng/links/json", NetworkGraphLinksResource.class); |
Pavlin Radoslavov | 97af90a | 2014-02-25 18:34:02 -0800 | [diff] [blame] | 19 | router.attach("/ng/shortest-path/{src-dpid}/{dst-dpid}/json", NetworkGraphShortestPathResource.class); |
Jonathan Hart | 49bfa4d | 2014-03-26 10:16:40 -0700 | [diff] [blame] | 20 | |
| 21 | // Old URLs for compatibility |
| 22 | router.attach("/topology/switches/json", NetworkGraphSwitchesResource.class); |
| 23 | router.attach("/topology/links/json", NetworkGraphLinksResource.class); |
| 24 | |
Jonathan Hart | 4701671 | 2014-02-07 12:41:35 -0800 | [diff] [blame] | 25 | return router; |
| 26 | } |
| 27 | |
| 28 | @Override |
| 29 | public String basePath() { |
Jonathan Hart | 891d050 | 2014-02-10 10:04:08 -0800 | [diff] [blame] | 30 | return "/wm/onos"; |
Jonathan Hart | 4701671 | 2014-02-07 12:41:35 -0800 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | } |