blob: 4f844b26e30b2f2602d27019c3935058e7a50cc6 [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001package net.floodlightcontroller.topology.web;
2
3import org.restlet.Context;
4import org.restlet.routing.Router;
5
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08006import net.floodlightcontroller.restserver.RestletRoutable;
HIGUCHI Yutaa56fbde2013-06-17 14:26:05 -07007import net.onrc.onos.ofcontroller.linkdiscovery.web.LinksResource;
HIGUCHI Yutaf0499b02013-06-14 15:01:10 -07008import net.onrc.onos.ofcontroller.topology.web.RouteResource;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08009
10public 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}