Explorar el Código

Implement docker unpause with standalone client lib.

Signed-off-by: David Calavera <david.calavera@gmail.com>
David Calavera hace 9 años
padre
commit
b8be62e28e
Se han modificado 2 ficheros con 9 adiciones y 1 borrados
  1. 8 0
      api/client/lib/container_unpause.go
  2. 1 1
      api/client/unpause.go

+ 8 - 0
api/client/lib/container_unpause.go

@@ -0,0 +1,8 @@
+package lib
+
+// ContainerUnpause resumes the process execution within a container
+func (cli *Client) ContainerUnpause(containerID string) error {
+	resp, err := cli.POST("/containers/"+containerID+"/unpause", nil, nil, nil)
+	ensureReaderClosed(resp)
+	return err
+}

+ 1 - 1
api/client/unpause.go

@@ -18,7 +18,7 @@ func (cli *DockerCli) CmdUnpause(args ...string) error {
 
 	var errNames []string
 	for _, name := range cmd.Args() {
-		if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/unpause", name), nil, nil)); err != nil {
+		if err := cli.client.ContainerUnpause(name); err != nil {
 			fmt.Fprintf(cli.err, "%s\n", err)
 			errNames = append(errNames, name)
 		} else {