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
+}
diff --git a/openstack/blockstorage/v1/volumes/volumes.go b/openstack/blockstorage/v1/volumes/volumes.go
index e7eaeea..77f19af 100644
--- a/openstack/blockstorage/v1/volumes/volumes.go
+++ b/openstack/blockstorage/v1/volumes/volumes.go
@@ -1,19 +1,19 @@
package volumes
-type Volume map[string]interface{}
-type CreateOpts map[string]interface{}
-
-/*
-type CreateOpts struct {
- Availability_zone string `json:"size"`
- Source_volid string `json:"source_volid"`
- Display_description string `json:"display_description"`
- Snapshot_id string `json:"snapshot_id"`
- Size int `json:"size"`
- Display_name string `json:"display_name"`
- ImageRef string `json:"imageRef"`
- Volume_type string `json:"volume_type"`
- Bootable bool `json:"bootable"`
- Metadata map[string]string `json:"metadata"`
+type Volume struct {
+ Status string
+ Display_name string
+ Attachments []string
+ Availability_zone string
+ Bootable bool
+ Created_at string
+ Display_description string
+ Volume_type string
+ Snapshot_id string
+ Source_volid string
+ Metadata map[string]string
+ Id string
+ Size int
}
-*/
+type CreateOpts map[string]interface{}
+type DeleteOpts map[string]string