Adding missing doc comments for block storage
diff --git a/openstack/blockstorage/v1/apiversions/requests.go b/openstack/blockstorage/v1/apiversions/requests.go
index b3a39f7..79a939c 100644
--- a/openstack/blockstorage/v1/apiversions/requests.go
+++ b/openstack/blockstorage/v1/apiversions/requests.go
@@ -7,7 +7,7 @@
"github.com/racker/perigee"
)
-// ListVersions lists all the Cinder API versions available to end-users.
+// List lists all the Cinder API versions available to end-users.
func List(c *gophercloud.ServiceClient) pagination.Pager {
return pagination.NewPager(c, listURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
return APIVersionPage{pagination.SinglePageBase(r)}
diff --git a/openstack/blockstorage/v1/apiversions/results.go b/openstack/blockstorage/v1/apiversions/results.go
index eeff132..c4ac157 100644
--- a/openstack/blockstorage/v1/apiversions/results.go
+++ b/openstack/blockstorage/v1/apiversions/results.go
@@ -44,10 +44,12 @@
return resp.Versions, nil
}
+// GetResult represents the result of a get operation.
type GetResult struct {
gophercloud.CommonResult
}
+// Extract is a function that accepts a result and extracts an API version resource.
func (r GetResult) Extract() (*APIVersion, error) {
var resp struct {
Version *APIVersion `mapstructure:"version"`
diff --git a/openstack/blockstorage/v1/snapshots/requests.go b/openstack/blockstorage/v1/snapshots/requests.go
index 40b44d8..f3180d7 100644
--- a/openstack/blockstorage/v1/snapshots/requests.go
+++ b/openstack/blockstorage/v1/snapshots/requests.go
@@ -100,15 +100,16 @@
return pagination.NewPager(client, url, createPage)
}
-// UpdateOpts contain options for updating an existing Snapshot. This object is
-// passed to the snapshots.Update function. For more information about the
-// parameters, see the Snapshot object.
+// UpdateMetadataOpts contain options for updating an existing Snapshot. This
+// object is passed to the snapshots.Update function. For more information
+// about the parameters, see the Snapshot object.
type UpdateMetadataOpts struct {
Metadata map[string]interface{}
}
-// Update will update the Snapshot with provided information. To extract the updated
-// Snapshot from the response, call the ExtractMetadata method on the UpdateResult.
+// UpdateMetadata will update the Snapshot with provided information. To
+// extract the updated Snapshot from the response, call the ExtractMetadata
+// method on the UpdateMetadataResult.
func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts *UpdateMetadataOpts) UpdateMetadataResult {
type request struct {
Metadata map[string]interface{} `json:"metadata,omitempty"`
diff --git a/openstack/blockstorage/v1/snapshots/util.go b/openstack/blockstorage/v1/snapshots/util.go
index b882875..64cdc60 100644
--- a/openstack/blockstorage/v1/snapshots/util.go
+++ b/openstack/blockstorage/v1/snapshots/util.go
@@ -4,6 +4,8 @@
"github.com/rackspace/gophercloud"
)
+// WaitForStatus will continually poll the resource, checking for a particular
+// status. It will do this for the amount of seconds defined.
func WaitForStatus(c *gophercloud.ServiceClient, id, status string, secs int) error {
return gophercloud.WaitFor(secs, func() (bool, error) {
current, err := Get(c, id).Extract()