blob: 82a1157ac54a2b7b9a390a32a6553847bce47fea [file] [log] [blame]
Pavlin Radoslavovda7ef612013-10-30 16:12:14 -07001package net.onrc.onos.datagrid.web;
2
3import net.floodlightcontroller.restserver.RestletRoutable;
4
5import org.restlet.Context;
6import org.restlet.Restlet;
7import org.restlet.routing.Router;
8
9/**
10 * REST API implementation for the Datagrid.
11 */
12public class DatagridWebRoutable 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);
19 router.attach("/get/map/{map-name}/json", GetMapResource.class);
Nick Karanatsios8abe7172014-02-19 20:31:48 -080020 router.attach("/add/intents/json", IntentResource.class);
Nick Karanatsios88948d32014-02-18 15:14:30 -080021 router.attach("/get/intents/json", IntentResource.class);
Nick Karanatsiosed645df2014-02-20 23:22:29 -080022 router.attach("/get/intent/{intent_id}/json", IntentResource.class);
Jonathan Hart10a7e2b2014-02-21 18:30:08 -080023 router.attach("/get/ng-events/json", GetNGEventsResource.class);
Pavlin Radoslavov42706b92014-02-28 01:22:55 -080024 router.attach("/get/ng-flows/summary/json", GetNGFlowsSummaryResource.class);
Nick Karanatsios87e8be72014-02-21 23:45:37 -080025 router.attach("/get/intents/{category}/json", IntentResource.class);
26 router.attach("/get/intent/{category}/{intent_id}/json", IntentResource.class);
Nick Karanatsios1f4defb2014-02-23 19:34:47 -080027 router.attach("/delete/intents/json", IntentResource.class);
Pavlin Radoslavovda7ef612013-10-30 16:12:14 -070028 return router;
29 }
30
31 /**
32 * Set the base path for the Topology
33 */
34 @Override
35 public String basePath() {
Naoki Shiota862cc3b2013-12-13 15:42:50 -080036 return "/wm/onos/datagrid";
Pavlin Radoslavovda7ef612013-10-30 16:12:14 -070037 }
38}