2016-01-05 02:26:13 +03:00
|
|
|
package client
|
2015-12-06 06:53:52 +03:00
|
|
|
|
2016-04-14 16:13:42 +03:00
|
|
|
import (
|
|
|
|
"net/url"
|
|
|
|
|
|
|
|
"golang.org/x/net/context"
|
2016-06-01 04:45:36 +03:00
|
|
|
|
|
|
|
"github.com/docker/engine-api/types"
|
2016-04-14 16:13:42 +03:00
|
|
|
)
|
2016-03-08 07:38:46 +03:00
|
|
|
|
2015-12-06 06:53:52 +03:00
|
|
|
// ContainerStart sends a request to the docker daemon to start a container.
|
2016-06-01 04:45:36 +03:00
|
|
|
func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error {
|
2016-04-14 16:13:42 +03:00
|
|
|
query := url.Values{}
|
2016-06-01 04:45:36 +03:00
|
|
|
if len(options.CheckpointID) != 0 {
|
|
|
|
query.Set("checkpoint", options.CheckpointID)
|
|
|
|
}
|
2016-04-14 16:13:42 +03:00
|
|
|
|
|
|
|
resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil)
|
2015-12-06 06:53:52 +03:00
|
|
|
ensureReaderClosed(resp)
|
|
|
|
return err
|
|
|
|
}
|