aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--api/api.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/api/api.go b/api/api.go
index eaceb3d..3aba924 100644
--- a/api/api.go
+++ b/api/api.go
@@ -66,13 +66,28 @@ func VttRedirect(w http.ResponseWriter, req *http.Request) {
}
func VttStart(w http.ResponseWriter, req *http.Request) {
+ if startVtt(req.Context()) != nil {
+ http.Error(w, "Internal Server Error", http.StatusInternalServerError)
+ return
+ }
+ w.WriteHeader(http.StatusOK)
}
func VttStop(w http.ResponseWriter, req *http.Request) {
+ if stopVtt(req.Context()) != nil {
+ http.Error(w, "Internal Server Error", http.StatusInternalServerError)
+ return
+ }
+ w.WriteHeader(http.StatusOK)
}
func VttRestart(w http.ResponseWriter, req *http.Request) {
+ if restartVtt(req.Context()) != nil {
+ http.Error(w, "Internal Server Error", http.StatusInternalServerError)
+ return
+ }
+ w.WriteHeader(http.StatusOK)
}
func VttLogs(w http.ResponseWriter, req *http.Request) {