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 | |
| 6 | import net.floodlightcontroller.linkdiscovery.web.LinksResource; |
| 7 | import net.floodlightcontroller.restserver.RestletRoutable; |
| 8 | |
| 9 | public class TopologyWebRoutable implements RestletRoutable { |
| 10 | /** |
| 11 | * Create the Restlet router and bind to the proper resources. |
| 12 | */ |
| 13 | @Override |
| 14 | public Router getRestlet(Context context) { |
| 15 | Router router = new Router(context); |
| 16 | router.attach("/links/json", LinksResource.class); |
| 17 | router.attach("/tunnellinks/json", TunnelLinksResource.class); |
| 18 | router.attach("/switchclusters/json", SwitchClustersResource.class); |
| 19 | router.attach("/broadcastdomainports/json", BroadcastDomainPortsResource.class); |
| 20 | router.attach("/enabledports/json", EnabledPortsResource.class); |
| 21 | router.attach("/blockedports/json", BlockedPortsResource.class); |
| 22 | router.attach("/route/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", RouteResource.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/topology"; |
| 32 | } |
| 33 | } |