block storage v1 comments
diff --git a/openstack/blockstorage/v1/snapshots/requests.go b/openstack/blockstorage/v1/snapshots/requests.go
index 7dcbc46..0e4e8f8 100644
--- a/openstack/blockstorage/v1/snapshots/requests.go
+++ b/openstack/blockstorage/v1/snapshots/requests.go
@@ -8,14 +8,20 @@
"github.com/racker/perigee"
)
+// CreateOpts contains options for creating a Snapshot. This object is passed to
+// the snapshots.Create function. For more information about these parameters,
+// see the Snapshot object.
type CreateOpts struct {
- Description string
- Force bool
- Metadata map[string]interface{}
- Name string
- VolumeID string
+ Description string // OPTIONAL
+ Force bool // OPTIONAL
+ Metadata map[string]interface{} // OPTIONAL
+ Name string // OPTIONAL
+ VolumeID string // REQUIRED
}
+// Create will create a new Snapshot based on the values in CreateOpts. To extract
+// the Snapshot object from the response, call the Extract method on the
+// CreateResult.
func Create(client *gophercloud.ServiceClient, opts *CreateOpts) CreateResult {
type snapshot struct {
Description *string `json:"display_description,omitempty"`
@@ -49,6 +55,7 @@
return res
}
+// Delete will delete the existing Snapshot with the provided ID.
func Delete(client *gophercloud.ServiceClient, id string) error {
_, err := perigee.Request("DELETE", deleteURL(client, id), perigee.Options{
MoreHeaders: client.Provider.AuthenticatedHeaders(),
@@ -57,6 +64,8 @@
return err
}
+// Get retrieves the Snapshot with the provided ID. To extract the Snapshot object
+// from the response, call the Extract method on the GetResult.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
_, res.Err = perigee.Request("GET", getURL(client, id), perigee.Options{
@@ -67,12 +76,15 @@
return res
}
+// ListOpts hold options for listing Snapshots. It is passed to the
+// snapshots.List function.
type ListOpts struct {
Name string `q:"display_name"`
Status string `q:"status"`
VolumeID string `q:"volume_id"`
}
+// List returns Snapshots optionally limited by the conditions provided in ListOpts.
func List(client *gophercloud.ServiceClient, opts *ListOpts) pagination.Pager {
url := listURL(client)
if opts != nil {
@@ -89,11 +101,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.
type UpdateOpts struct {
Description string
Name string
}
+// Update will update the Snapshot with provided information. To extract the updated
+// Snapshot from the response, call the Extract method on the UpdateResult.
func Update(client *gophercloud.ServiceClient, id string, opts *UpdateOpts) UpdateResult {
type update struct {
Description *string `json:"display_description,omitempty"`