aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/api
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2024-10-15 18:01:17 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2024-10-15 18:01:17 -0400
commit35974fa96d9b30a6af0b419d45ee1ef9c6075095 (patch)
tree94b4f7d1cb3a0ef6bbcce50fab8a4fd88b6365c0 /api
parent54cd78b2c2bafe2fc9b191f7375d652d17e15e95 (diff)
Add start, stop, restart handlers
Diffstat (limited to 'api')
-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) {