summaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-27 02:55:08 -0500
committerJeff Carr <[email protected]>2024-10-27 02:55:08 -0500
commit71f83d400048f6d4219793a76a3ffce16b8c63d8 (patch)
tree5e1935b34d87cf27adfce3cb58140cb1059b7e87 /http.go
parentd0767eb9843fcdb9ab0e73200d8a9516e28c200c (diff)
prepare to validate spice ports
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'http.go')
-rw-r--r--http.go26
1 files changed, 17 insertions, 9 deletions
diff --git a/http.go b/http.go
index d00117b..8d819f5 100644
--- a/http.go
+++ b/http.go
@@ -76,11 +76,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
return
}
- if route == "/dumplibvirtxml" {
- virtigoxml.DumpLibvirtxmlDomainNames()
- return
- }
-
if route == "/uptime" {
ok, s := clusterHealthy()
if ok {
@@ -104,10 +99,23 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "hostname is", hostname)
// log.Warn("Handling URL:", tmp, "start droplet", start)
- b, result := Start(hostname)
- log.Warn("Start returned =", b, "result =", result)
- fmt.Fprintln(w, "Start() returned", b)
- fmt.Fprintln(w, "result:", result)
+ ok, result := Start(hostname)
+ if ok {
+ fmt.Fprintln(w, hostname, "started ok")
+ } else {
+ fmt.Fprintln(w, result)
+ fmt.Fprintln(w, hostname, "start failed")
+ }
+ return
+ }
+
+ if route == "/dumpcluster" {
+ dumpCluster(w)
+ return
+ }
+
+ if route == "/dumplibvirtxml" {
+ virtigoxml.DumpLibvirtxmlDomainNames()
return
}