mirror of
https://github.com/moby/moby.git
synced 2026-01-11 02:31:44 +00:00
Add option- and output structs for; - Client.ContainerKill - Client.ContainerPause - Client.ContainerRemove - Client.ContainerResize - Client.ContainerRestart - Client.ContainerStart - Client.ContainerStop - Client.ContainerUnpause Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
29 lines
861 B
Go
29 lines
861 B
Go
package client
|
|
|
|
import "context"
|
|
|
|
// ContainerPauseOptions holds options for [Client.ContainerPause].
|
|
type ContainerPauseOptions struct {
|
|
// Add future optional parameters here.
|
|
}
|
|
|
|
// ContainerPauseResult holds the result of [Client.ContainerPause],
|
|
type ContainerPauseResult struct {
|
|
// Add future fields here.
|
|
}
|
|
|
|
// ContainerPause pauses the main process of a given container without terminating it.
|
|
func (cli *Client) ContainerPause(ctx context.Context, containerID string, options ContainerPauseOptions) (ContainerPauseResult, error) {
|
|
containerID, err := trimID("container", containerID)
|
|
if err != nil {
|
|
return ContainerPauseResult{}, err
|
|
}
|
|
|
|
resp, err := cli.post(ctx, "/containers/"+containerID+"/pause", nil, nil, nil)
|
|
defer ensureReaderClosed(resp)
|
|
if err != nil {
|
|
return ContainerPauseResult{}, err
|
|
}
|
|
return ContainerPauseResult{}, nil
|
|
}
|