blob: 95cb3928d91d041abd5ad2e3e3a4d8bf45bd95eb [file] [log] [blame]
Jonathan Hart47016712014-02-07 12:41:35 -08001package net.onrc.onos.ofcontroller.networkgraph.web;
2
3import org.restlet.Context;
4import org.restlet.Restlet;
5import org.restlet.routing.Router;
6
7import net.floodlightcontroller.restserver.RestletRoutable;
8
9public class NetworkGraphWebRoutable implements RestletRoutable {
10
11 @Override
12 public Restlet getRestlet(Context context) {
13 Router router = new Router(context);
Yuta HIGUCHIfe1ffe42014-03-26 10:31:46 -070014 // leaving old path there for compatibility
15 router.attach("/rc/switches/json", DatastoreSwitchesResource.class);
16 router.attach("/rc/links/json", DatastoreLinksResource.class);
17 router.attach("/rc/ports/json", DatastorePortsResource.class);
18
19 // debug API to dump datastore content
20 router.attach("/ds/switches/json", DatastoreSwitchesResource.class);
21 router.attach("/ds/links/json", DatastoreLinksResource.class);
22 router.attach("/ds/ports/json", DatastorePortsResource.class);
23
Jonathan Hart891d0502014-02-10 10:04:08 -080024 router.attach("/ng/switches/json", NetworkGraphSwitchesResource.class);
25 router.attach("/ng/links/json", NetworkGraphLinksResource.class);
Pavlin Radoslavov97af90a2014-02-25 18:34:02 -080026 router.attach("/ng/shortest-path/{src-dpid}/{dst-dpid}/json", NetworkGraphShortestPathResource.class);
Jonathan Hart49bfa4d2014-03-26 10:16:40 -070027
28 // Old URLs for compatibility
29 router.attach("/topology/switches/json", NetworkGraphSwitchesResource.class);
30 router.attach("/topology/links/json", NetworkGraphLinksResource.class);
31
Jonathan Hart47016712014-02-07 12:41:35 -080032 return router;
33 }
34
35 @Override
36 public String basePath() {
Jonathan Hart891d0502014-02-10 10:04:08 -080037 return "/wm/onos";
Jonathan Hart47016712014-02-07 12:41:35 -080038 }
39
40}