blob: 95cb3928d91d041abd5ad2e3e3a4d8bf45bd95eb [file] [log] [blame]
package net.onrc.onos.ofcontroller.networkgraph.web;
import org.restlet.Context;
import org.restlet.Restlet;
import org.restlet.routing.Router;
import net.floodlightcontroller.restserver.RestletRoutable;
public class NetworkGraphWebRoutable implements RestletRoutable {
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
// leaving old path there for compatibility
router.attach("/rc/switches/json", DatastoreSwitchesResource.class);
router.attach("/rc/links/json", DatastoreLinksResource.class);
router.attach("/rc/ports/json", DatastorePortsResource.class);
// debug API to dump datastore content
router.attach("/ds/switches/json", DatastoreSwitchesResource.class);
router.attach("/ds/links/json", DatastoreLinksResource.class);
router.attach("/ds/ports/json", DatastorePortsResource.class);
router.attach("/ng/switches/json", NetworkGraphSwitchesResource.class);
router.attach("/ng/links/json", NetworkGraphLinksResource.class);
router.attach("/ng/shortest-path/{src-dpid}/{dst-dpid}/json", NetworkGraphShortestPathResource.class);
// Old URLs for compatibility
router.attach("/topology/switches/json", NetworkGraphSwitchesResource.class);
router.attach("/topology/links/json", NetworkGraphLinksResource.class);
return router;
}
@Override
public String basePath() {
return "/wm/onos";
}
}