delete volume
diff --git a/openstack/blockstorage/v1/volumes/requests.go b/openstack/blockstorage/v1/volumes/requests.go
index 34ae20e..a6d51fb 100644
--- a/openstack/blockstorage/v1/volumes/requests.go
+++ b/openstack/blockstorage/v1/volumes/requests.go
@@ -13,7 +13,9 @@
}
url := c.GetVolumesURL()
_, err = perigee.Request("POST", url, perigee.Options{
- Results: &v,
+ Results: &struct {
+ Volume *Volume `json:"volume"`
+ }{&v},
ReqBody: map[string]interface{}{
"volume": opts,
},
@@ -21,3 +23,15 @@
})
return v, err
}
+
+func Delete(c *blockstorage.Client, opts DeleteOpts) error {
+ h, err := c.GetHeaders()
+ if err != nil {
+ return err
+ }
+ url := c.GetVolumeURL(opts["id"])
+ _, err = perigee.Request("DELETE", url, perigee.Options{
+ MoreHeaders: h,
+ })
+ return err
+}