blob: 90c7a18cc3852a116f22f491c80c84ce996fbbc8 [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);
Toshio Koide3738ee52014-02-12 14:57:39 -080020 router.attach("/add/intent/json", IntentResource.class);
Nick Karanatsios88948d32014-02-18 15:14:30 -080021 router.attach("/get/intents/json", IntentResource.class);
Pavlin Radoslavovda7ef612013-10-30 16:12:14 -070022 return router;
23 }
24
25 /**
26 * Set the base path for the Topology
27 */
28 @Override
29 public String basePath() {
Naoki Shiota862cc3b2013-12-13 15:42:50 -080030 return "/wm/onos/datagrid";
Pavlin Radoslavovda7ef612013-10-30 16:12:14 -070031 }
32}