2015-05-02 01:03:35 +00:00
|
|
|
package daemon
|
|
|
|
|
2015-09-18 17:48:16 +00:00
|
|
|
import (
|
|
|
|
derr "github.com/docker/docker/errors"
|
|
|
|
)
|
2015-05-02 01:03:35 +00:00
|
|
|
|
|
|
|
// ContainerPause pauses a container
|
2015-09-29 17:51:40 +00:00
|
|
|
func (daemon *Daemon) ContainerPause(name string) error {
|
|
|
|
container, err := daemon.Get(name)
|
2015-05-02 01:03:35 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2015-09-29 17:51:40 +00:00
|
|
|
if err := container.pause(); err != nil {
|
2015-09-18 17:48:16 +00:00
|
|
|
return derr.ErrorCodePauseError.WithArgs(name, err)
|
2015-05-02 01:03:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|