blob: 73a39369a4f229fe7a610469d7153509a26682ae [file] [log] [blame]
HIGUCHI Yuta60a10142013-06-14 15:50:10 -07001package net.onrc.onos.ofcontroller.flowmanager.web;
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -08002
3import net.floodlightcontroller.restserver.RestletRoutable;
4
5import org.restlet.Context;
6import org.restlet.Restlet;
7import org.restlet.routing.Router;
8
admin944ef4f2013-10-08 17:48:37 -07009/**
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070010 * REST API implementation for the Flow Manager.
admin944ef4f2013-10-08 17:48:37 -070011 */
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -080012public class FlowWebRoutable implements RestletRoutable {
13 /**
14 * Create the Restlet router and bind to the proper resources.
15 */
16 @Override
17 public Restlet getRestlet(Context context) {
18 Router router = new Router(context);
Pavlin Radoslavov0e0525e2013-03-04 15:49:11 -080019 router.attach("/add/json", AddFlowResource.class);
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -080020 router.attach("/delete/{flow-id}/json", DeleteFlowResource.class);
21 router.attach("/get/{flow-id}/json", GetFlowByIdResource.class);
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -080022 router.attach("/getall/json", GetAllFlowsResource.class);
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070023 router.attach("/getsummary/{flow-id}/{max-flows}/json", GetSummaryFlowsResource.class);
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -080024 return router;
25 }
26
27 /**
28 * Set the base path for the Topology
29 */
30 @Override
31 public String basePath() {
Naoki Shiota862cc3b2013-12-13 15:42:50 -080032 return "/wm/onos/flows";
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -080033 }
34}