From b5a6c849e30d1d12d161b0768f147dcc196c052f Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Fri, 22 May 2015 07:53:41 -0700 Subject: [PATCH] Adding support for network/id/endpoints in api Signed-off-by: Madhu Venugopal --- libnetwork/api/api.go | 2 +- libnetwork/api/api_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libnetwork/api/api.go b/libnetwork/api/api.go index 8981f5f6c8..a3ab77e7c5 100644 --- a/libnetwork/api/api.go +++ b/libnetwork/api/api.go @@ -89,7 +89,7 @@ func (h *httpHandler) initRouter() { {"/networks/" + nwID, nil, procGetNetwork}, {"/networks/" + nwID + "/endpoints", []string{"name", epName}, procGetEndpoints}, {"/networks/" + nwID + "/endpoints", []string{"partial-id", epPID}, procGetEndpoints}, - + {"/networks/" + nwID + "/endpoints", nil, procGetEndpoints}, {"/networks/" + nwID + "/endpoints/" + epID, nil, procGetEndpoint}, }, "POST": { diff --git a/libnetwork/api/api_test.go b/libnetwork/api/api_test.go index 416cebb3b6..cb35ecfe31 100644 --- a/libnetwork/api/api_test.go +++ b/libnetwork/api/api_test.go @@ -1391,8 +1391,8 @@ func TestEndToEnd(t *testing.T) { t.Fatal(err) } handleRequest(rsp, req) - if rsp.statusCode != http.StatusNotFound { - t.Fatalf("Expected StatusNotFound. Got (%d): %s", rsp.statusCode, rsp.body) + if rsp.statusCode != http.StatusOK { + t.Fatalf("Expected StatusOK. Got (%d): %s", rsp.statusCode, rsp.body) } req, err = http.NewRequest("GET", "/networks/"+nid+"/endpoints?name=bla", nil)