list volumes
diff --git a/openstack/blockstorage/v1/volumes/requests.go b/openstack/blockstorage/v1/volumes/requests.go
index 5dcbca0..c4a72c2 100644
--- a/openstack/blockstorage/v1/volumes/requests.go
+++ b/openstack/blockstorage/v1/volumes/requests.go
@@ -24,6 +24,27 @@
return v, err
}
+func List(c *blockstorage.Client, opts ListOpts) ([]Volume, error) {
+ var v []Volume
+ var url string
+ h, err := c.GetHeaders()
+ if err != nil {
+ return v, err
+ }
+ if full := opts["full"]; full {
+ url = c.GetVolumesURL()
+ } else {
+ url = c.GetVolumeURL("detail")
+ }
+ _, err = perigee.Request("GET", url, perigee.Options{
+ Results: &struct {
+ Volume *[]Volume `json:"volumes"`
+ }{&v},
+ MoreHeaders: h,
+ })
+ return v, err
+}
+
func Get(c *blockstorage.Client, opts GetOpts) (Volume, error) {
var v Volume
h, err := c.GetHeaders()