Adding support for network/id/endpoints in api

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal
2015-05-22 09:53:19 -07:00
parent 17bfe1f3f5
commit 1f0f737948
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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": {
+2 -2
View File
@@ -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)