use interfaces rather than concrete types
diff --git a/openstack/db/v1/instances/requests.go b/openstack/db/v1/instances/requests.go
index e2b8ad0..f4a63b8 100644
--- a/openstack/db/v1/instances/requests.go
+++ b/openstack/db/v1/instances/requests.go
@@ -42,10 +42,10 @@
Name string
// A slice of database information options.
- Databases db.BatchCreateOpts
+ Databases db.CreateOptsBuilder
// A slice of user information options.
- Users users.BatchCreateOpts
+ Users users.CreateOptsBuilder
// Options to configure the type of datastore the instance will use. This is
// optional, and if excluded will default to MySQL.
@@ -69,14 +69,14 @@
if opts.Name != "" {
instance["name"] = opts.Name
}
- if len(opts.Databases) > 0 {
+ if opts.Databases != nil {
dbs, err := opts.Databases.ToDBCreateMap()
if err != nil {
return nil, err
}
instance["databases"] = dbs["databases"]
}
- if len(opts.Users) > 0 {
+ if opts.Users != nil {
users, err := opts.Users.ToUserCreateMap()
if err != nil {
return nil, err
diff --git a/rackspace/db/v1/instances/requests.go b/rackspace/db/v1/instances/requests.go
index c8876da..f4df692 100644
--- a/rackspace/db/v1/instances/requests.go
+++ b/rackspace/db/v1/instances/requests.go
@@ -24,10 +24,10 @@
Name string
// A slice of database information options.
- Databases osDBs.BatchCreateOpts
+ Databases osDBs.CreateOptsBuilder
// A slice of user information options.
- Users osUsers.BatchCreateOpts
+ Users osUsers.CreateOptsBuilder
// ID of the configuration group to associate with the instance. Optional.
ConfigID string
diff --git a/rackspace/db/v1/users/requests.go b/rackspace/db/v1/users/requests.go
index aab7e41..74e47ab 100644
--- a/rackspace/db/v1/users/requests.go
+++ b/rackspace/db/v1/users/requests.go
@@ -29,7 +29,7 @@
ChangePassword(client, "instance_id", opts)
*/
-func ChangePassword(client *gophercloud.ServiceClient, instanceID string, opts os.BatchCreateOpts) UpdatePasswordsResult {
+func ChangePassword(client *gophercloud.ServiceClient, instanceID string, opts os.CreateOptsBuilder) UpdatePasswordsResult {
var res UpdatePasswordsResult
reqBody, err := opts.ToUserCreateMap()
@@ -142,7 +142,7 @@
GrantAccess(client, "instance_id", "user_name", opts)
*/
-func GrantAccess(client *gophercloud.ServiceClient, instanceID, userName string, opts db.BatchCreateOpts) GrantAccessResult {
+func GrantAccess(client *gophercloud.ServiceClient, instanceID, userName string, opts db.CreateOptsBuilder) GrantAccessResult {
var res GrantAccessResult
reqBody, err := opts.ToDBCreateMap()