Pavlin Radoslavov | da7ef61 | 2013-10-30 16:12:14 -0700 | [diff] [blame] | 1 | package net.onrc.onos.datagrid.web; |
| 2 | |
| 3 | import net.floodlightcontroller.restserver.RestletRoutable; |
| 4 | |
| 5 | import org.restlet.Context; |
| 6 | import org.restlet.Restlet; |
| 7 | import org.restlet.routing.Router; |
| 8 | |
| 9 | /** |
| 10 | * REST API implementation for the Datagrid. |
| 11 | */ |
| 12 | public 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 Koide | 3738ee5 | 2014-02-12 14:57:39 -0800 | [diff] [blame] | 20 | router.attach("/add/intent/json", IntentResource.class); |
Pavlin Radoslavov | da7ef61 | 2013-10-30 16:12:14 -0700 | [diff] [blame] | 21 | return router; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Set the base path for the Topology |
| 26 | */ |
| 27 | @Override |
| 28 | public String basePath() { |
Naoki Shiota | 862cc3b | 2013-12-13 15:42:50 -0800 | [diff] [blame] | 29 | return "/wm/onos/datagrid"; |
Pavlin Radoslavov | da7ef61 | 2013-10-30 16:12:14 -0700 | [diff] [blame] | 30 | } |
| 31 | } |