| 53 | } |
| 54 | |
| 55 | func (self *BaseRPC) Stop(opts *ActionOpts, success *bool) error { |
| 56 | containerId := opts.ContainerId |
| 57 | log.WithFields(log.Fields{ |
| 58 | "container_id": containerId, |
| 59 | "name": self.base.GetName(), |
| 60 | }).Info("Stopping container") |
| 61 | |
| 62 | err := self.base.Stop(&AppConfig{ContainerId: containerId}) |
| 63 | |
| 64 | if err != nil { |
| 65 | return err |
| 66 | } |
| 67 | *success = true |
| 68 | |
| 69 | log.WithFields(log.Fields{ |
| 70 | "container_id": containerId, |
| 71 | "name": self.base.GetName(), |
| 72 | }).Info("Container stopped") |
| 73 | |
| 74 | return nil |
| 75 | } |
| 76 | func (self *BaseRPC) Restart(opts *ActionOpts, success *bool) error { |
| 77 | containerId := opts.ContainerId |
| 78 | err := self.base.Restart(&AppConfig{ContainerId: containerId}) |