blob: c358263a5d004bca420b8f49e1f670cf04803c8c [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 Radoslavovb9fe6b42013-03-27 16:25:05 -070020 router.attach("/add-shortest-path/json", AddShortestPathFlowResource.class);
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -080021 router.attach("/delete/{flow-id}/json", DeleteFlowResource.class);
22 router.attach("/get/{flow-id}/json", GetFlowByIdResource.class);
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -080023 router.attach("/getall/json", GetAllFlowsResource.class);
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070024 router.attach("/getsummary/{flow-id}/{max-flows}/json", GetSummaryFlowsResource.class);
Pavlin Radoslavov5ab68512013-02-18 09:59:33 -080025 return router;
26 }
27
28 /**
29 * Set the base path for the Topology
30 */
31 @Override
32 public String basePath() {
33 return "/wm/flow";
34 }
35}