Create, delete, and query server
diff --git a/openstack/compute/servers/servers.go b/openstack/compute/servers/servers.go
index 7061993..c02cf9f 100644
--- a/openstack/compute/servers/servers.go
+++ b/openstack/compute/servers/servers.go
@@ -75,3 +75,15 @@
return servers, nil
}
+// GetServer interprets the result of a call expected to return data on a single server.
+func GetServer(sr ServerResult) (*Server, error) {
+ so, ok := sr["server"]
+ if !ok {
+ return nil, ErrNotImplemented
+ }
+ serverObj := so.(map[string]interface{})
+ s := new(Server)
+ err := mapstructure.Decode(serverObj, s)
+ return s, err
+}
+