Ray Milkey | 26921af | 2014-06-30 16:27:40 -0700 | [diff] [blame^] | 1 | package net.onrc.onos.core.metrics; |
| 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. |
| 14 | */ |
| 15 | @Override |
| 16 | public Restlet getRestlet(Context context) { |
| 17 | Router router = new Router(context); |
| 18 | // GET all metrics |
| 19 | router.attach("", MetricsResource.class); |
| 20 | return router; |
| 21 | } |
| 22 | |
| 23 | |
| 24 | /** |
| 25 | * Sets the base path for the Metrics. |
| 26 | */ |
| 27 | @Override |
| 28 | public String basePath() { |
| 29 | return "/wm/onos/metrics"; |
| 30 | } |
| 31 | } |