Jonathan Hart | 382623d | 2014-04-03 09:48:11 -0700 | [diff] [blame] | 1 | package net.onrc.onos.apps.bgproute; |
pingping-lin | a2cbfad | 2013-03-07 08:39:21 +0800 | [diff] [blame] | 2 | |
Jonathan Hart | a99ec67 | 2014-04-03 11:30:34 -0700 | [diff] [blame] | 3 | import net.floodlightcontroller.restserver.RestletRoutable; |
| 4 | |
pingping-lin | a2cbfad | 2013-03-07 08:39:21 +0800 | [diff] [blame] | 5 | import org.restlet.Context; |
| 6 | import org.restlet.Restlet; |
| 7 | import org.restlet.routing.Router; |
| 8 | |
Jonathan Hart | 4e7c22e | 2014-04-09 10:59:34 -0700 | [diff] [blame^] | 9 | /** |
| 10 | * REST URL router for SDN-IP REST calls. |
| 11 | */ |
pingping-lin | a2cbfad | 2013-03-07 08:39:21 +0800 | [diff] [blame] | 12 | public class BgpRouteWebRoutable implements RestletRoutable { |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 13 | @Override |
| 14 | public Restlet getRestlet(Context context) { |
| 15 | Router router = new Router(context); |
| 16 | router.attach("/json", BgpRouteResource.class); |
| 17 | router.attach("/rib/{dest}", BgpRouteResource.class); |
| 18 | router.attach("/{sysuptime}/{sequence}/{routerid}/{prefix}/{mask}/{nexthop}", BgpRouteResource.class); |
| 19 | router.attach("/{routerid}/{prefix}/{mask}/{nexthop}/synch", BgpRouteResourceSynch.class); |
| 20 | router.attach("/{routerid}/{capability}", BgpRouteResource.class); |
| 21 | return router; |
| 22 | } |
| 23 | |
| 24 | @Override |
| 25 | public String basePath() { |
| 26 | return "/wm/bgp"; |
| 27 | } |
pingping-lin | a2cbfad | 2013-03-07 08:39:21 +0800 | [diff] [blame] | 28 | } |