blob: 3a3f4939469a4200939494a41dfc7f8c8158d8b8 [file] [log] [blame]
Ray Milkeya34ed042014-07-17 16:19:52 -07001package net.onrc.onos.core.metrics.web;
Ray Milkey26921af2014-06-30 16:27:40 -07002
3import net.floodlightcontroller.restserver.RestletRoutable;
4import org.restlet.Context;
5import org.restlet.Restlet;
6import org.restlet.routing.Router;
7
8/**
9 * Restlet Router for Metrics REST APIs.
10 */
11public class MetricsWebRoutable implements RestletRoutable {
12 /**
13 * Creates the Restlet router and binds to the proper resources.
Ray Milkey40eb9c82014-07-18 10:28:11 -070014 *
15 * @param context Context to use for the restlet
16 * @return the router for Metrics REST calls
Ray Milkey26921af2014-06-30 16:27:40 -070017 */
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 Milkey40eb9c82014-07-18 10:28:11 -070028 * Defines the base path for the Metrics.
29 *
30 * @return base path for Metrics REST APIs
Ray Milkey26921af2014-06-30 16:27:40 -070031 */
32 @Override
33 public String basePath() {
34 return "/wm/onos/metrics";
35 }
36}