diff options
Diffstat (limited to 'pkg/api')
-rw-r--r-- | pkg/api/handlers/compat/networks.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go index b4f3aa2f1..fe13971b0 100644 --- a/pkg/api/handlers/compat/networks.go +++ b/pkg/api/handlers/compat/networks.go @@ -271,11 +271,16 @@ func CreateNetwork(w http.ResponseWriter, r *http.Request) { return } + net, err := getNetworkResourceByNameOrID(name, runtime, nil) + if err != nil { + utils.InternalServerError(w, err) + return + } body := struct { Id string Warning []string }{ - Id: name, + Id: net.ID, } utils.WriteResponse(w, http.StatusCreated, body) } @@ -320,7 +325,7 @@ func RemoveNetwork(w http.ResponseWriter, r *http.Request) { return } - utils.WriteResponse(w, http.StatusNoContent, "") + utils.WriteResponse(w, http.StatusNoContent, nil) } // Connect adds a container to a network |