Explorar o código

Update the routes within commands.go

Guillaume J. Charmes %!s(int64=12) %!d(string=hai) anos
pai
achega
eeaea4e873
Modificáronse 2 ficheiros con 4 adicións e 4 borrados
  1. 1 1
      api.go
  2. 3 3
      commands.go

+ 1 - 1
api.go

@@ -412,7 +412,7 @@ func deleteContainers(srv *Server, w http.ResponseWriter, r *http.Request, vars
 		return nil, fmt.Errorf("Missing parameter")
 		return nil, fmt.Errorf("Missing parameter")
 	}
 	}
 	name := vars["name"]
 	name := vars["name"]
-	removeVolume := r.Form.Get("removeVolume") == "1"
+	removeVolume := r.Form.Get("v") == "1"
 
 
 	if err := srv.ContainerDestroy(name, removeVolume); err != nil {
 	if err := srv.ContainerDestroy(name, removeVolume); err != nil {
 		return nil, err
 		return nil, err

+ 3 - 3
commands.go

@@ -783,7 +783,7 @@ func CmdPs(args ...string) error {
 		v.Set("before", *before)
 		v.Set("before", *before)
 	}
 	}
 
 
-	body, _, err := call("GET", "/containers?"+v.Encode(), nil)
+	body, _, err := call("GET", "/containers/ps?"+v.Encode(), nil)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
@@ -1082,7 +1082,7 @@ func CmdRun(args ...string) error {
 	}
 	}
 
 
 	//create the container
 	//create the container
-	body, statusCode, err := call("POST", "/containers", *config)
+	body, statusCode, err := call("POST", "/containers/create", config)
 	//if image not found try to pull it
 	//if image not found try to pull it
 	if statusCode == 404 {
 	if statusCode == 404 {
 		v := url.Values{}
 		v := url.Values{}
@@ -1091,7 +1091,7 @@ func CmdRun(args ...string) error {
 		if err != nil {
 		if err != nil {
 			return err
 			return err
 		}
 		}
-		body, _, err = call("POST", "/containers", *config)
+		body, _, err = call("POST", "/containers/create", config)
 		if err != nil {
 		if err != nil {
 			return err
 			return err
 		}
 		}