Expose rescue/unrescue functionality.
diff --git a/acceptance/11-rescue-unrescue-server.go b/acceptance/11-rescue-unrescue-server.go
new file mode 100644
index 0000000..4c4d481
--- /dev/null
+++ b/acceptance/11-rescue-unrescue-server.go
@@ -0,0 +1,50 @@
+package main
+
+import (
+ "fmt"
+ "flag"
+ "github.com/rackspace/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)
+ }
+}