diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2024-10-15 18:01:17 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2024-10-15 18:01:17 -0400 |
| commit | 35974fa96d9b30a6af0b419d45ee1ef9c6075095 (patch) | |
| tree | 94b4f7d1cb3a0ef6bbcce50fab8a4fd88b6365c0 /api | |
| parent | 54cd78b2c2bafe2fc9b191f7375d652d17e15e95 (diff) | |
Add start, stop, restart handlers
Diffstat (limited to 'api')
| -rw-r--r-- | api/api.go | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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) { |
