(w http.ResponseWriter, r *http.Request)
| 716 | } |
| 717 | |
| 718 | func (s *DockerServer) stopContainer(w http.ResponseWriter, r *http.Request) { |
| 719 | id := mux.Vars(r)["id"] |
| 720 | container, err := s.findContainer(id) |
| 721 | if err != nil { |
| 722 | http.Error(w, err.Error(), http.StatusNotFound) |
| 723 | return |
| 724 | } |
| 725 | s.cMut.Lock() |
| 726 | defer s.cMut.Unlock() |
| 727 | if !container.State.Running { |
| 728 | http.Error(w, "Container not running", http.StatusBadRequest) |
| 729 | return |
| 730 | } |
| 731 | w.WriteHeader(http.StatusNoContent) |
| 732 | container.State.Running = false |
| 733 | s.notify(container) |
| 734 | } |
| 735 | |
| 736 | func (s *DockerServer) pauseContainer(w http.ResponseWriter, r *http.Request) { |
| 737 | id := mux.Vars(r)["id"] |
nothing calls this directly
no test coverage detected