Tizen_4.0 base
[platform/upstream/docker-engine.git] / vendor / github.com / opencontainers / runc / pause.go
1 // +build linux
2
3 package runc
4
5 import "github.com/urfave/cli"
6
7 var pauseCommand = cli.Command{
8         Name:  "pause",
9         Usage: "pause suspends all processes inside the container",
10         ArgsUsage: `<container-id>
11
12 Where "<container-id>" is the name for the instance of the container to be
13 paused. `,
14         Description: `The pause command suspends all processes in the instance of the container.
15
16 Use runc list to identiy instances of containers and their current status.`,
17         Action: func(context *cli.Context) error {
18                 if err := checkArgs(context, 1, exactArgs); err != nil {
19                         return err
20                 }
21                 container, err := getContainer(context)
22                 if err != nil {
23                         return err
24                 }
25                 if err := container.Pause(); err != nil {
26                         return err
27                 }
28
29                 return nil
30         },
31 }
32
33 var resumeCommand = cli.Command{
34         Name:  "resume",
35         Usage: "resumes all processes that have been previously paused",
36         ArgsUsage: `<container-id>
37
38 Where "<container-id>" is the name for the instance of the container to be
39 resumed.`,
40         Description: `The resume command resumes all processes in the instance of the container.
41
42 Use runc list to identiy instances of containers and their current status.`,
43         Action: func(context *cli.Context) error {
44                 if err := checkArgs(context, 1, exactArgs); err != nil {
45                         return err
46                 }
47                 container, err := getContainer(context)
48                 if err != nil {
49                         return err
50                 }
51                 if err := container.Resume(); err != nil {
52                         return err
53                 }
54
55                 return nil
56         },
57 }