Remove duplication
diff --git a/rackspace/db/v1/backups/requests_test.go b/rackspace/db/v1/backups/requests_test.go
index 14eacc1..60fe064 100644
--- a/rackspace/db/v1/backups/requests_test.go
+++ b/rackspace/db/v1/backups/requests_test.go
@@ -36,7 +36,11 @@
Size: 100,
Status: "NEW",
Updated: "2014-02-13T21:47:16",
- Datastore: Datastore{Version: "5.1", Type: "MySQL", VersionID: "20000000-0000-0000-0000-000000000002"},
+ Datastore: datastores.Datastore{
+ Version: "5.1",
+ Type: "MySQL",
+ VersionID: "20000000-0000-0000-0000-000000000002",
+ },
}
th.AssertDeepEquals(t, expected, instance)
@@ -67,7 +71,11 @@
Size: 0.141026,
Status: "COMPLETED",
Updated: "2014-06-18T21:24:39",
- Datastore: Datastore{Version: "5.1", Type: "MySQL", VersionID: "20000000-0000-0000-0000-000000000002"},
+ Datastore: datastores.Datastore{
+ Version: "5.1",
+ Type: "MySQL",
+ VersionID: "20000000-0000-0000-0000-000000000002",
+ },
},
}
@@ -101,7 +109,11 @@
Size: 100,
Status: "NEW",
Updated: "2014-02-13T21:47:16",
- Datastore: Datastore{Version: "5.1", Type: "MySQL", VersionID: "20000000-0000-0000-0000-000000000002"},
+ Datastore: datastores.Datastore{
+ Version: "5.1",
+ Type: "MySQL",
+ VersionID: "20000000-0000-0000-0000-000000000002",
+ },
}
th.AssertDeepEquals(t, expected, instance)
diff --git a/rackspace/db/v1/backups/results.go b/rackspace/db/v1/backups/results.go
index 89f1fc6..475a41d 100644
--- a/rackspace/db/v1/backups/results.go
+++ b/rackspace/db/v1/backups/results.go
@@ -4,14 +4,9 @@
"github.com/mitchellh/mapstructure"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
+ "github.com/rackspace/gophercloud/rackspace/db/v1/datastores"
)
-type Datastore struct {
- Version string
- Type string
- VersionID string `json:"version_id" mapstructure:"version_id"`
-}
-
type Backup struct {
Description string
ID string
@@ -23,7 +18,7 @@
Status string
Created string
Updated string
- Datastore Datastore
+ Datastore datastores.Datastore
}
type CreateResult struct {
diff --git a/rackspace/db/v1/instances/results.go b/rackspace/db/v1/instances/results.go
index 760e5a7..e0c5aa5 100644
--- a/rackspace/db/v1/instances/results.go
+++ b/rackspace/db/v1/instances/results.go
@@ -5,13 +5,9 @@
"github.com/rackspace/gophercloud"
os "github.com/rackspace/gophercloud/openstack/db/v1/instances"
"github.com/rackspace/gophercloud/pagination"
+ "github.com/rackspace/gophercloud/rackspace/db/v1/datastores"
)
-type Datastore struct {
- Type string
- Version string
-}
-
// Instance represents a remote MySQL instance.
type Instance struct {
// Indicates the datetime that the instance was created
@@ -21,7 +17,7 @@
Updated string //time.Time
// Indicates how the instance stores data.
- Datastore Datastore
+ Datastore datastores.Datastore
// Indicates the hardware flavor the instance uses.
Flavor os.Flavor