named return vars
diff --git a/openstack/db/v1/configurations/requests.go b/openstack/db/v1/configurations/requests.go
index eb59cc2..9e1bf05 100644
--- a/openstack/db/v1/configurations/requests.go
+++ b/openstack/db/v1/configurations/requests.go
@@ -29,17 +29,14 @@
// CreateOpts is the struct responsible for configuring new configurations.
type CreateOpts struct {
- // [REQUIRED] The configuration group name
+ // The configuration group name
Name string `json:"name" required:"true"`
-
- // [REQUIRED] A map of user-defined configuration settings that will define
+ // A map of user-defined configuration settings that will define
// how each associated datastore works. Each key/value pair is specific to a
// datastore type.
Values map[string]interface{} `json:"values" required:"true"`
-
// Associates the configuration group with a particular datastore.
Datastore *DatastoreOpts `json:"datastore,omitempty"`
-
// A human-readable explanation for the group.
Description string `json:"description,omitempty"`
}
@@ -50,22 +47,18 @@
}
// Create will create a new configuration group.
-func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult {
- var r CreateResult
+func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) {
b, err := opts.ToConfigCreateMap()
if err != nil {
r.Err = err
- return r
+ return
}
_, r.Err = client.Post(baseURL(client), &b, &r.Body, &gophercloud.RequestOpts{OkCodes: []int{200}})
- return r
}
// Get will retrieve the details for a specified configuration group.
-func Get(client *gophercloud.ServiceClient, configID string) GetResult {
- var r GetResult
+func Get(client *gophercloud.ServiceClient, configID string) (r GetResult) {
_, r.Err = client.Get(resourceURL(client, configID), &r.Body, nil)
- return r
}
// UpdateOptsBuilder is the top-level interface for casting update options into
@@ -96,38 +89,32 @@
// Update will modify an existing configuration group by performing a merge
// between new and existing values. If the key already exists, the new value
// will overwrite. All other keys will remain unaffected.
-func Update(client *gophercloud.ServiceClient, configID string, opts UpdateOptsBuilder) UpdateResult {
- var r UpdateResult
+func Update(client *gophercloud.ServiceClient, configID string, opts UpdateOptsBuilder) (r UpdateResult) {
b, err := opts.ToConfigUpdateMap()
if err != nil {
r.Err = err
- return r
+ return
}
_, r.Err = client.Patch(resourceURL(client, configID), &b, nil, nil)
- return r
}
// Replace will modify an existing configuration group by overwriting the
// entire parameter group with the new values provided. Any existing keys not
// included in UpdateOptsBuilder will be deleted.
-func Replace(client *gophercloud.ServiceClient, configID string, opts UpdateOptsBuilder) ReplaceResult {
- var r ReplaceResult
+func Replace(client *gophercloud.ServiceClient, configID string, opts UpdateOptsBuilder) (r ReplaceResult) {
b, err := opts.ToConfigUpdateMap()
if err != nil {
r.Err = err
- return r
+ return
}
_, r.Err = client.Put(resourceURL(client, configID), &b, nil, nil)
- return r
}
// Delete will permanently delete a configuration group. Please note that
// config groups cannot be deleted whilst still attached to running instances -
// you must detach and then delete them.
-func Delete(client *gophercloud.ServiceClient, configID string) DeleteResult {
- var r DeleteResult
+func Delete(client *gophercloud.ServiceClient, configID string) (r DeleteResult) {
_, r.Err = client.Delete(resourceURL(client, configID), nil)
- return r
}
// ListInstances will list all the instances associated with a particular
@@ -154,10 +141,8 @@
// "innodb_file_per_table" configuration param for MySQL datastores. You will
// need the param's ID first, which can be attained by using the ListDatastoreParams
// operation.
-func GetDatastoreParam(client *gophercloud.ServiceClient, datastoreID, versionID, paramID string) ParamResult {
- var r ParamResult
+func GetDatastoreParam(client *gophercloud.ServiceClient, datastoreID, versionID, paramID string) (r ParamResult) {
_, r.Err = client.Get(getDSParamURL(client, datastoreID, versionID, paramID), &r.Body, nil)
- return r
}
// ListGlobalParams is similar to ListDatastoreParams but does not require a
@@ -170,8 +155,6 @@
// GetGlobalParam is similar to GetDatastoreParam but does not require a
// DatastoreID.
-func GetGlobalParam(client *gophercloud.ServiceClient, versionID, paramID string) ParamResult {
- var r ParamResult
+func GetGlobalParam(client *gophercloud.ServiceClient, versionID, paramID string) (r ParamResult) {
_, r.Err = client.Get(getGlobalParamURL(client, versionID, paramID), &r.Body, nil)
- return r
}