diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-23 04:42:05 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-23 04:42:05 -0800 |
commit | cb48c082ed63590c42ff27315e583649027241e1 (patch) | |
tree | 1cce91fe4c357b3291b3a33752969eb13625a16e /api/rest.go | |
parent | 13e9aefa1d7ec92600d46a004d5f38a4ff95ac7e (diff) |
api: fix Neighbor() error handling
Also fix some typos.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'api/rest.go')
-rw-r--r-- | api/rest.go | 13 |
1 files changed, 7 insertions, 6 deletions
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://<ownIP>:3000/v1/bgp/neighbor/<remote address of target neighbor> +// -- curl -i -X GET http://<ownIP>:3000/v1/bgp/neighbor/<remote address of target neighbor> // get state of neighbors. -// -- curt -i -X GET http://<ownIP>:3000/v1/bgp/neighbors +// -- curl -i -X GET http://<ownIP>:3000/v1/bgp/neighbors // get adj-rib-in of each neighbor. -// -- curt -i -X GET http://<ownIP>:3000/v1/bgp/adj-rib-in/<remote address of target neighbor> +// -- curl -i -X GET http://<ownIP>:3000/v1/bgp/adj-rib-in/<remote address of target neighbor> // get adj-rib-out of each neighbor. -// -- curt -i -X GET http://<ownIP>:3000/v1/bgp/adj-rib-out/<remote address of target neighbor> +// -- curl -i -X GET http://<ownIP>:3000/v1/bgp/adj-rib-out/<remote address of target neighbor> // get adj-rib-local of each neighbor. -// -- curt -i -X GET http://<ownIP>:3000/v1/bgp/adj-rib-local/<remote address of target neighbor> +// -- curl -i -X GET http://<ownIP>:3000/v1/bgp/adj-rib-local/<remote address of target neighbor> // get only best path of adj-rib-local of each neighbor. -// -- curt -i -X GET http://<ownIP>:3000/v1/bgp/adj-rib-local/best/<remote address of target neighbor> +// -- curl -i -X GET http://<ownIP>:3000/v1/bgp/adj-rib-local/best/<remote address of target neighbor> 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) |