diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-02-15 17:15:04 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-02-16 10:13:40 +0900 |
commit | 161ea3b25709820991b1b1e17e621eb9a2082865 (patch) | |
tree | 96a57224234371f5c3c00d57f136cdce3d858a3e /api | |
parent | 979fdad86cac0ba67851cd2cf28582f32be2f838 (diff) |
rest: add API to disable and enable neighbor
Diffstat (limited to 'api')
-rw-r--r-- | api/rest.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/api/rest.go b/api/rest.go index bea5781b..18edfe57 100644 --- a/api/rest.go +++ b/api/rest.go @@ -36,6 +36,8 @@ const ( REQ_NEIGHBOR_SOFT_RESET REQ_NEIGHBOR_SOFT_RESET_IN REQ_NEIGHBOR_SOFT_RESET_OUT + REQ_NEIGHBOR_ENABLE + REQ_NEIGHBOR_DISABLE ) const ( @@ -118,6 +120,8 @@ func (rs *RestServer) Serve() { r.HandleFunc(neighbor+perPeerURL+"/"+"softreset", rs.NeighborPostHandler).Methods("POST") r.HandleFunc(neighbor+perPeerURL+"/"+"softresetin", rs.NeighborPostHandler).Methods("POST") r.HandleFunc(neighbor+perPeerURL+"/"+"softresetout", rs.NeighborPostHandler).Methods("POST") + r.HandleFunc(neighbor+perPeerURL+"/"+"enable", rs.NeighborPostHandler).Methods("POST") + r.HandleFunc(neighbor+perPeerURL+"/"+"disable", rs.NeighborPostHandler).Methods("POST") // stats r.HandleFunc(STATS, stats_api.Handler).Methods("GET") @@ -172,6 +176,10 @@ func (rs *RestServer) NeighborPostHandler(w http.ResponseWriter, r *http.Request rs.neighbor(w, r, REQ_NEIGHBOR_SOFT_RESET_IN) case "softresetout": rs.neighbor(w, r, REQ_NEIGHBOR_SOFT_RESET_OUT) + case "enable": + rs.neighbor(w, r, REQ_NEIGHBOR_ENABLE) + case "disable": + rs.neighbor(w, r, REQ_NEIGHBOR_DISABLE) } } |