From 161ea3b25709820991b1b1e17e621eb9a2082865 Mon Sep 17 00:00:00 2001 From: Hiroshi Yokoi Date: Sun, 15 Feb 2015 17:15:04 +0900 Subject: rest: add API to disable and enable neighbor --- api/rest.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'api') 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) } } -- cgit v1.2.3