Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.topology.web; |
| 2 | |
| 3 | import org.restlet.Context; |
| 4 | import org.restlet.routing.Router; |
| 5 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 6 | import net.floodlightcontroller.restserver.RestletRoutable; |
HIGUCHI Yuta | a56fbde | 2013-06-17 14:26:05 -0700 | [diff] [blame] | 7 | import net.onrc.onos.ofcontroller.linkdiscovery.web.LinksResource; |
HIGUCHI Yuta | f0499b0 | 2013-06-14 15:01:10 -0700 | [diff] [blame] | 8 | import net.onrc.onos.ofcontroller.topology.web.RouteResource; |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 9 | |
| 10 | public class TopologyWebRoutable implements RestletRoutable { |
| 11 | /** |
| 12 | * Create the Restlet router and bind to the proper resources. |
| 13 | */ |
| 14 | @Override |
| 15 | public Router getRestlet(Context context) { |
| 16 | Router router = new Router(context); |
| 17 | router.attach("/links/json", LinksResource.class); |
| 18 | router.attach("/tunnellinks/json", TunnelLinksResource.class); |
| 19 | router.attach("/switchclusters/json", SwitchClustersResource.class); |
| 20 | router.attach("/broadcastdomainports/json", BroadcastDomainPortsResource.class); |
| 21 | router.attach("/enabledports/json", EnabledPortsResource.class); |
| 22 | router.attach("/blockedports/json", BlockedPortsResource.class); |
| 23 | router.attach("/route/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", RouteResource.class); |
| 24 | return router; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Set the base path for the Topology |
| 29 | */ |
| 30 | @Override |
| 31 | public String basePath() { |
| 32 | return "/wm/topology"; |
| 33 | } |
| 34 | } |