Finalize Rackspace acceptance tests and fix various things
diff --git a/openstack/db/v1/instances/requests.go b/openstack/db/v1/instances/requests.go
index 63406c7..1872d75 100644
--- a/openstack/db/v1/instances/requests.go
+++ b/openstack/db/v1/instances/requests.go
@@ -14,6 +14,19 @@
ToInstanceCreateMap() (map[string]interface{}, error)
}
+// DatastoreOpts represents the configuration for how an instance stores data.
+type DatastoreOpts struct {
+ Version string
+ Type string
+}
+
+func (opts DatastoreOpts) ToMap() (map[string]string, error) {
+ return map[string]string{
+ "version": opts.Version,
+ "type": opts.Type,
+ }, nil
+}
+
// CreateOpts is the struct responsible for configuring a new database instance.
type CreateOpts struct {
// Either the integer UUID (in string form) of the flavor, or its URI
@@ -33,6 +46,10 @@
// A slice of user information options.
Users users.BatchCreateOpts
+
+ // Options to configure the type of datastore the instance will use. This is
+ // optional, and if excluded will default to MySQL.
+ Datastore *DatastoreOpts
}
// ToInstanceCreateMap will render a JSON map.
@@ -162,7 +179,7 @@
var res ActionResult
_, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
- JSONBody: map[string]bool{"restart": true},
+ JSONBody: map[string]interface{}{"restart": map[string]string{}},
OkCodes: []int{202},
})
diff --git a/openstack/db/v1/instances/results.go b/openstack/db/v1/instances/results.go
index f85db81..b7eeb86 100644
--- a/openstack/db/v1/instances/results.go
+++ b/openstack/db/v1/instances/results.go
@@ -6,6 +6,7 @@
"github.com/rackspace/gophercloud/openstack/db/v1/flavors"
"github.com/rackspace/gophercloud/openstack/db/v1/users"
"github.com/rackspace/gophercloud/pagination"
+ "github.com/rackspace/gophercloud/rackspace/db/v1/datastores"
)
// Volume represents information about an attached volume for a database instance.
@@ -49,6 +50,9 @@
// Information about the attached volume of the instance.
Volume Volume
+
+ // Indicates how the instance stores data.
+ Datastore datastores.DatastorePartial
}
type commonResult struct {