Adding documentation
diff --git a/openstack/db/v1/flavors/doc.go b/openstack/db/v1/flavors/doc.go
index 5822e1b..4d281d5 100644
--- a/openstack/db/v1/flavors/doc.go
+++ b/openstack/db/v1/flavors/doc.go
@@ -1,7 +1,7 @@
// Package flavors provides information and interaction with the flavor API
-// resource in the OpenStack Compute service.
+// resource in the OpenStack Database service.
//
-// A flavor is an available hardware configuration for a server. Each flavor
-// has a unique combination of disk space, memory capacity and priority for CPU
-// time.
+// A flavor is an available hardware configuration for a database instance.
+// Each flavor has a unique combination of disk space, memory capacity and
+// priority for CPU time.
package flavors
diff --git a/openstack/db/v1/flavors/fixtures.go b/openstack/db/v1/flavors/fixtures.go
index f0016bc..c7102e7 100644
--- a/openstack/db/v1/flavors/fixtures.go
+++ b/openstack/db/v1/flavors/fixtures.go
@@ -26,7 +26,7 @@
`
var (
- flavorID = "{flavorID}"
+ flavorID = 1
_baseURL = "/flavors"
resURL = "/flavors/" + flavorID
)
diff --git a/openstack/db/v1/flavors/requests.go b/openstack/db/v1/flavors/requests.go
index b67a07b..beeeddc 100644
--- a/openstack/db/v1/flavors/requests.go
+++ b/openstack/db/v1/flavors/requests.go
@@ -5,6 +5,9 @@
"github.com/rackspace/gophercloud/pagination"
)
+// List will list all available hardware flavors that an instance can use. The
+// operation is identical to the one supported by the Nova API, but without the
+// "disk" property.
func List(client *gophercloud.ServiceClient) pagination.Pager {
createPage := func(r pagination.PageResult) pagination.Page {
return FlavorPage{pagination.LinkedPageBase{PageResult: r}}
@@ -13,7 +16,8 @@
return pagination.NewPager(client, listURL(client), createPage)
}
-func Get(client *gophercloud.ServiceClient, id string) GetResult {
+// Get will retrieve information for a specified hardware flavor.
+func Get(client *gophercloud.ServiceClient, id int) GetResult {
var gr GetResult
_, gr.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
diff --git a/openstack/db/v1/flavors/results.go b/openstack/db/v1/flavors/results.go
index 5aac5ce..d3f507e 100644
--- a/openstack/db/v1/flavors/results.go
+++ b/openstack/db/v1/flavors/results.go
@@ -1,16 +1,11 @@
package flavors
import (
- "errors"
-
"github.com/mitchellh/mapstructure"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
-// ErrCannotInterpret is returned by an Extract call if the response body doesn't have the expected structure.
-var ErrCannotInterpet = errors.New("Unable to interpret a response body.")
-
// GetResult temporarily holds the response from a Get call.
type GetResult struct {
gophercloud.Result
@@ -32,15 +27,16 @@
// Flavor records represent (virtual) hardware configurations for server resources in a region.
type Flavor struct {
- // The Id field contains the flavor's unique identifier.
- // For example, this identifier will be useful when specifying which hardware configuration to use for a new server instance.
+ // The flavor's unique identifier.
ID int `mapstructure:"id"`
+ // The RAM capacity for the flavor.
RAM int `mapstructure:"ram"`
// The Name field provides a human-readable moniker for the flavor.
Name string `mapstructure:"name"`
+ // Links to access the flavor.
Links []gophercloud.Link
}