Ray Milkey | a34ed04 | 2014-07-17 16:19:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.metrics.web; |
Ray Milkey | 26921af | 2014-06-30 16:27:40 -0700 | [diff] [blame] | 2 | |
| 3 | import net.floodlightcontroller.restserver.RestletRoutable; |
| 4 | import org.restlet.Context; |
| 5 | import org.restlet.Restlet; |
| 6 | import org.restlet.routing.Router; |
| 7 | |
| 8 | /** |
| 9 | * Restlet Router for Metrics REST APIs. |
| 10 | */ |
| 11 | public class MetricsWebRoutable implements RestletRoutable { |
| 12 | /** |
| 13 | * Creates the Restlet router and binds to the proper resources. |
Ray Milkey | 40eb9c8 | 2014-07-18 10:28:11 -0700 | [diff] [blame] | 14 | * |
| 15 | * @param context Context to use for the restlet |
| 16 | * @return the router for Metrics REST calls |
Ray Milkey | 26921af | 2014-06-30 16:27:40 -0700 | [diff] [blame] | 17 | */ |
| 18 | @Override |
| 19 | public Restlet getRestlet(Context context) { |
| 20 | Router router = new Router(context); |
| 21 | // GET all metrics |
| 22 | router.attach("", MetricsResource.class); |
| 23 | return router; |
| 24 | } |
| 25 | |
| 26 | |
| 27 | /** |
Ray Milkey | 40eb9c8 | 2014-07-18 10:28:11 -0700 | [diff] [blame] | 28 | * Defines the base path for the Metrics. |
| 29 | * |
| 30 | * @return base path for Metrics REST APIs |
Ray Milkey | 26921af | 2014-06-30 16:27:40 -0700 | [diff] [blame] | 31 | */ |
| 32 | @Override |
| 33 | public String basePath() { |
| 34 | return "/wm/onos/metrics"; |
| 35 | } |
| 36 | } |