diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-01-07 10:21:27 +0900 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-01-07 10:21:27 +0900 |
commit | dc9de3022b721bdb9d6332a641d55097754390d0 (patch) | |
tree | 44d03670c773a2204688a7ace42ec85afc0d2dc7 | |
parent | 5f7404c9a8fbb74a9942f27d1564223b694f72b3 (diff) |
rest: add stats api
-rw-r--r-- | api/rest.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/api/rest.go b/api/rest.go index a5fdfaa7..29af6d65 100644 --- a/api/rest.go +++ b/api/rest.go @@ -17,6 +17,7 @@ package api import ( log "github.com/Sirupsen/logrus" + "github.com/fukata/golang-stats-api-handler" "github.com/gorilla/mux" "net/http" "strconv" @@ -41,6 +42,7 @@ const ( ADJ_RIB_LOCAL_BEST = "/bgp/adj-rib-local/best" PARAM_REMOTE_PEER_ADDR = "remotePeerAddr" + STATS = "/stats" ) const REST_PORT = 8080 @@ -112,6 +114,8 @@ func (rs *RestServer) Serve() { // r.HandleFunc(adjRibIn+"/{"+PARAM_REMOTE_PEER_ADDR+"}", rs.AdjRibIn).Methods("GET") // r.HandleFunc(adjRibOut+"/{"+PARAM_REMOTE_PEER_ADDR+"}", rs.AdjRibOut).Methods("GET") r.HandleFunc(neighbor+"/{"+PARAM_REMOTE_PEER_ADDR+"}/"+"local-rib", rs.NeighborLocalRib).Methods("GET") + // stats + r.HandleFunc(STATS, stats_api.Handler) // Handler when not found url r.NotFoundHandler = http.HandlerFunc(NotFoundHandler) |