package main

import (
	"fmt"
	"flag"
	"github.com/maxlinc/gophercloud"
)

var quiet = flag.Bool("quiet", false, "Quiet mode, for acceptance testing.  $? still indicates errors though.")

func main() {
	flag.Parse()
	withIdentity(false, func(acc gophercloud.AccessProvider) {
		withServerApi(acc, func(servers gophercloud.CloudServersProvider) {
			log("Creating server")
			id, err := createServer(servers, "", "", "", "")
			if err != nil {
				panic(err)
			}
			waitForServerState(servers, id, "ACTIVE")
			defer servers.DeleteServerById(id)

			log("Rescuing server")
			adminPass, err := servers.RescueServer(id)
			if err != nil {
				panic(err)
			}
			log("  Admin password = " + adminPass)
			if len(adminPass) < 1 {
				panic("Empty admin password")
			}
			waitForServerState(servers, id, "RESCUE")

			log("Unrescuing server")
			err = servers.UnrescueServer(id)
			if err != nil {
				panic(err)
			}
			waitForServerState(servers, id, "ACTIVE")

			log("Done")
		})
	})
}

func log(s string) {
	if !*quiet {
		fmt.Println(s)
	}
}
