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); |
Nick Karanatsios | 8abe717 | 2014-02-19 20:31:48 -0800 | [diff] [blame] | 19 | router.attach("/add/intents/json", IntentResource.class); |
Nick Karanatsios | 88948d3 | 2014-02-18 15:14:30 -0800 | [diff] [blame] | 20 | router.attach("/get/intents/json", IntentResource.class); |
Nick Karanatsios | ed645df | 2014-02-20 23:22:29 -0800 | [diff] [blame] | 21 | router.attach("/get/intent/{intent_id}/json", IntentResource.class); |
Jonathan Hart | 10a7e2b | 2014-02-21 18:30:08 -0800 | [diff] [blame] | 22 | router.attach("/get/ng-events/json", GetNGEventsResource.class); |
Pavlin Radoslavov | 42706b9 | 2014-02-28 01:22:55 -0800 | [diff] [blame] | 23 | router.attach("/get/ng-flows/summary/json", GetNGFlowsSummaryResource.class); |
Nick Karanatsios | 87e8be7 | 2014-02-21 23:45:37 -0800 | [diff] [blame] | 24 | router.attach("/get/intents/{category}/json", IntentResource.class); |
| 25 | router.attach("/get/intent/{category}/{intent_id}/json", IntentResource.class); |
Nick Karanatsios | 1f4defb | 2014-02-23 19:34:47 -0800 | [diff] [blame] | 26 | router.attach("/delete/intents/json", IntentResource.class); |
Pavlin Radoslavov | da7ef61 | 2013-10-30 16:12:14 -0700 | [diff] [blame] | 27 | return router; |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Set the base path for the Topology |
| 32 | */ |
| 33 | @Override |
| 34 | public String basePath() { |
Naoki Shiota | 862cc3b | 2013-12-13 15:42:50 -0800 | [diff] [blame] | 35 | return "/wm/onos/datagrid"; |
Pavlin Radoslavov | da7ef61 | 2013-10-30 16:12:14 -0700 | [diff] [blame] | 36 | } |
| 37 | } |