blob: 8f32f8a17978edc726a298c24fb89db19a7943ce [file] [log] [blame]
Jonathan Hart472062d2014-04-03 10:56:48 -07001package net.onrc.onos.core.topology.web;
Jonathan Hart47016712014-02-07 12:41:35 -08002
Jonathan Harta99ec672014-04-03 11:30:34 -07003import net.floodlightcontroller.restserver.RestletRoutable;
4
Jonathan Hart47016712014-02-07 12:41:35 -08005import org.restlet.Context;
6import org.restlet.Restlet;
7import org.restlet.routing.Router;
8
Jonathan Hart47016712014-02-07 12:41:35 -08009public class NetworkGraphWebRoutable implements RestletRoutable {
10
Ray Milkey269ffb92014-04-03 14:43:30 -070011 @Override
12 public Restlet getRestlet(Context context) {
13 Router router = new Router(context);
14 // 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);
Yuta HIGUCHIfe1ffe42014-03-26 10:31:46 -070018
Ray Milkey269ffb92014-04-03 14:43:30 -070019 // 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);
Yuta HIGUCHIfe1ffe42014-03-26 10:31:46 -070023
Ray Milkey269ffb92014-04-03 14:43:30 -070024 router.attach("/ng/switches/json", NetworkGraphSwitchesResource.class);
25 router.attach("/ng/links/json", NetworkGraphLinksResource.class);
26 router.attach("/ng/shortest-path/{src-dpid}/{dst-dpid}/json", NetworkGraphShortestPathResource.class);
Jonathan Hart47016712014-02-07 12:41:35 -080027
Ray Milkey269ffb92014-04-03 14:43:30 -070028 // Old URLs for compatibility
29 router.attach("/topology/switches/json", NetworkGraphSwitchesResource.class);
30 router.attach("/topology/links/json", NetworkGraphLinksResource.class);
31
32 return router;
33 }
34
35 @Override
36 public String basePath() {
37 return "/wm/onos";
38 }
Jonathan Hart47016712014-02-07 12:41:35 -080039
40}