make remove network return 204

Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
allencloud 2016-09-28 02:04:36 +08:00
parent 762556c705
commit ea07ef7a7c
3 changed files with 11 additions and 3 deletions

View file

@ -139,7 +139,11 @@ func (n *networkRouter) deleteNetwork(ctx context.Context, w http.ResponseWriter
return err
}
if _, err := n.clusterProvider.GetNetwork(vars["id"]); err == nil {
return n.clusterProvider.RemoveNetwork(vars["id"])
if err = n.clusterProvider.RemoveNetwork(vars["id"]); err != nil {
return err
}
w.WriteHeader(http.StatusNoContent)
return nil
}
if err := n.backend.DeleteNetwork(vars["id"]); err != nil {
return err

View file

@ -4672,7 +4672,9 @@ Stop and remove the service `id`
**Example response**:
HTTP/1.1 200 No Content
HTTP/1.1 200 OK
Content-Length: 0
Content-Type: text/plain; charset=utf-8
**Status codes**:

View file

@ -5040,7 +5040,9 @@ Stop and remove the service `id`
**Example response**:
HTTP/1.1 200 No Content
HTTP/1.1 200 OK
Content-Length: 0
Content-Type: text/plain; charset=utf-8
**Status codes**: