Fixes
diff --git a/rackspace/db/v1/instances/delegate.go b/rackspace/db/v1/instances/delegate.go
index ca585e2..f072d84 100644
--- a/rackspace/db/v1/instances/delegate.go
+++ b/rackspace/db/v1/instances/delegate.go
@@ -109,30 +109,45 @@
return os.List(client)
}
+// Get retrieves the status and information for a specified database instance.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
return GetResult{os.Get(client, id)}
}
+// Delete permanently destroys the database instance.
func Delete(client *gophercloud.ServiceClient, id string) os.DeleteResult {
return os.Delete(client, id)
}
+// EnableRootUser enables the login from any host for the root user and
+// provides the user with a generated root password.
func EnableRootUser(client *gophercloud.ServiceClient, id string) os.UserRootResult {
return os.EnableRootUser(client, id)
}
+// IsRootEnabled checks an instance to see if root access is enabled. It returns
+// True if root user is enabled for the specified database instance or False
+// otherwise.
func IsRootEnabled(client *gophercloud.ServiceClient, id string) (bool, error) {
return os.IsRootEnabled(client, id)
}
+// RestartService will restart only the MySQL Instance. Restarting MySQL will
+// erase any dynamic configuration settings that you have made within MySQL.
+// The MySQL service will be unavailable until the instance restarts.
func RestartService(client *gophercloud.ServiceClient, id string) os.ActionResult {
return os.RestartService(client, id)
}
+// ResizeInstance changes the memory size of the instance, assuming a valid
+// flavorRef is provided. It will also restart the MySQL service.
func ResizeInstance(client *gophercloud.ServiceClient, id, flavorRef string) os.ActionResult {
return os.ResizeInstance(client, id, flavorRef)
}
+// ResizeVolume will resize the attached volume for an instance. It supports
+// only increasing the volume size and does not support decreasing the size.
+// The volume size is in gigabytes (GB) and must be an integer.
func ResizeVolume(client *gophercloud.ServiceClient, id string, size int) os.ActionResult {
return os.ResizeVolume(client, id, size)
}
diff --git a/rackspace/db/v1/instances/results.go b/rackspace/db/v1/instances/results.go
index c2c68e1..d2eff6b 100644
--- a/rackspace/db/v1/instances/results.go
+++ b/rackspace/db/v1/instances/results.go
@@ -11,17 +11,42 @@
Version string
}
+// Instance represents a remote MySQL instance.
type Instance struct {
- Created string //time.Time
- Updated string //time.Time
+ // Indicates the datetime that the instance was created
+ Created string //time.Time
+
+ // Indicates the most recent datetime that the instance was updated.
+ Updated string //time.Time
+
+ // Indicates how the instance stores data.
Datastore Datastore
- Flavor os.Flavor
- Hostname string
- ID string
- Links []gophercloud.Link
- Name string
- Status string
- Volume os.Volume
+
+ // Indicates the hardware flavor the instance uses.
+ Flavor os.Flavor
+
+ // A DNS-resolvable hostname associated with the database instance (rather
+ // than an IPv4 address). Since the hostname always resolves to the correct
+ // IP address of the database instance, this relieves the user from the task
+ // of maintaining the mapping. Note that although the IP address may likely
+ // change on resizing, migrating, and so forth, the hostname always resolves
+ // to the correct database instance.
+ Hostname string
+
+ // Indicates the unique identifier for the instance resource.
+ ID string
+
+ // Exposes various links that reference the instance resource.
+ Links []gophercloud.Link
+
+ // The human-readable name of the instance.
+ Name string
+
+ // The build status of the instance.
+ Status string
+
+ // Information about the attached volume of the instance.
+ Volume os.Volume
}
func commonExtract(err error, body interface{}) (*Instance, error) {
@@ -46,10 +71,12 @@
return commonExtract(r.Err, r.Body)
}
+// GetResult represents the result of a Get operation.
type GetResult struct {
os.GetResult
}
+// Extract will extract an Instance from a GetResult.
func (r GetResult) Extract() (*Instance, error) {
return commonExtract(r.Err, r.Body)
}
@@ -58,6 +85,8 @@
gophercloud.Result
}
+// Extract will extract the configuration information (in the form of a map)
+// about a particular instance.
func (r ConfigResult) Extract() (map[string]string, error) {
if r.Err != nil {
return nil, r.Err
@@ -73,6 +102,7 @@
return response.Instance.Config, err
}
+// UpdateResult represents the result of an Update operation.
type UpdateResult struct {
gophercloud.ErrResult
}