Decouple OpenStack implementation from Rackspace provider
diff --git a/rackspace/db/v1/instances/results.go b/rackspace/db/v1/instances/results.go
index 66b3ce1..df13aed 100644
--- a/rackspace/db/v1/instances/results.go
+++ b/rackspace/db/v1/instances/results.go
@@ -3,6 +3,7 @@
import (
"github.com/mitchellh/mapstructure"
"github.com/rackspace/gophercloud"
+ os "github.com/rackspace/gophercloud/openstack/db/v1/instances"
)
type Datastore struct {
@@ -10,40 +11,24 @@
Version string
}
-type Flavor struct {
- ID string
- Links []gophercloud.Link
-}
-
-type Volume struct {
- Size int
-}
-
type Instance struct {
Created string //time.Time
Updated string //time.Time
Datastore Datastore
- Flavor Flavor
+ Flavor os.Flavor
Hostname string
ID string
Links []gophercloud.Link
Name string
Status string
- Volume Volume
+ Volume os.Volume
}
// CreateResult represents the result of a Create operation.
type CreateResult struct {
- gophercloud.Result
+ os.CreateResult
}
-// func handleInstanceConversion(from reflect.Kind, to reflect.Kind, data interface{}) (interface{}, error) {
-// if (from == reflect.String) && (to == reflect.Map) {
-// return map[string]interface{}{}, nil
-// }
-// return data, nil
-// }
-
func (r CreateResult) Extract() (*Instance, error) {
if r.Err != nil {
return nil, r.Err