diff options
| author | Jeff Carr <[email protected]> | 2024-10-13 03:49:54 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-13 03:49:54 -0500 |
| commit | 425e75d388beb3f00e527e89ef81a35fd5b6e931 (patch) | |
| tree | 1e844883e716a8ee2f55478443b523e3b21ae85b /http.go | |
| parent | ffe754a96a68e7cf8905344073e3b1eedb78e94b (diff) | |
trigger start over http
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -32,7 +32,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) { // is the cluster running what it should? if tmp == "/droplets" { - var good = true for _, d := range me.droplets { if d.State != "ON" { continue @@ -40,17 +39,11 @@ func okHandler(w http.ResponseWriter, r *http.Request) { dur := time.Since(d.lastpoll) // Calculate the elapsed time if d.CurrentState != "ON" { fmt.Fprintln(w, "BAD STATE ", d.Hostname, "State =", d.State, "CurrentState =", d.CurrentState, shell.FormatDuration(dur)) - good = false } else { dur := time.Since(d.lastpoll) // Calculate the elapsed time fmt.Fprintln(w, "GOOD STATE ON", d.Hostname, d.hname, shell.FormatDuration(dur)) } } - if good { - fmt.Fprintln(w, "Handling URL:", tmp, "GOOD=true") - } else { - fmt.Fprintln(w, "Handling URL:", tmp, "GOOD=false") - } return } @@ -90,6 +83,13 @@ func okHandler(w http.ResponseWriter, r *http.Request) { return } + if tmp == "/start" { + start := r.URL.Query().Get("start") + log.Info("should start droplet here", start) + fmt.Fprintln(w, "should start droplet here", start) + return + } + log.Warn("BAD URL =", tmp) fmt.Fprintln(w, "BAD ZOOT") // badurl(w, r.URL.String()) |
