From cb48c082ed63590c42ff27315e583649027241e1 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 23 Dec 2014 04:42:05 -0800 Subject: api: fix Neighbor() error handling Also fix some typos. Signed-off-by: FUJITA Tomonori --- api/rest.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'api/rest.go') diff --git a/api/rest.go b/api/rest.go index d7339487..b4b2c314 100644 --- a/api/rest.go +++ b/api/rest.go @@ -118,17 +118,17 @@ func NewRestServer(port int, bgpServerCh chan *RestRequest) *RestServer { // Main thread of rest service. // URL than can receive. // get state of neighbor. -// -- curt -i -X GET http://:3000/v1/bgp/neighbor/ +// -- curl -i -X GET http://:3000/v1/bgp/neighbor/ // get state of neighbors. -// -- curt -i -X GET http://:3000/v1/bgp/neighbors +// -- curl -i -X GET http://:3000/v1/bgp/neighbors // get adj-rib-in of each neighbor. -// -- curt -i -X GET http://:3000/v1/bgp/adj-rib-in/ +// -- curl -i -X GET http://:3000/v1/bgp/adj-rib-in/ // get adj-rib-out of each neighbor. -// -- curt -i -X GET http://:3000/v1/bgp/adj-rib-out/ +// -- curl -i -X GET http://:3000/v1/bgp/adj-rib-out/ // get adj-rib-local of each neighbor. -// -- curt -i -X GET http://:3000/v1/bgp/adj-rib-local/ +// -- curl -i -X GET http://:3000/v1/bgp/adj-rib-local/ // get only best path of adj-rib-local of each neighbor. -// -- curt -i -X GET http://:3000/v1/bgp/adj-rib-local/best/ +// -- curl -i -X GET http://:3000/v1/bgp/adj-rib-local/best/ func (rs *RestServer) Serve() { neighbor := BASE_VERSION + NEIGHBOR // neighbors := BASE_VERSION + NEIGHBORS @@ -164,6 +164,7 @@ func (rs *RestServer) Neighbor(w http.ResponseWriter, r *http.Request) { errStr := "neighbor address is not specified" log.Debug(errStr) http.Error(w, errStr, http.StatusInternalServerError) + return } log.Debugf("Look up neighbor with the remote address : %v", remoteAddr) -- cgit v1.2.3