add image.Delete operation
diff --git a/openstack/compute/v2/images/requests.go b/openstack/compute/v2/images/requests.go
index 5eb19b5..a755ea1 100644
--- a/openstack/compute/v2/images/requests.go
+++ b/openstack/compute/v2/images/requests.go
@@ -63,3 +63,10 @@
_, result.Err = client.Get(getURL(client, id), &result.Body, nil)
return result
}
+
+// Delete deletes the specified image ID.
+func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
+ var result DeleteResult
+ _, result.Err = client.Delete(getURL(client, id), nil)
+ return result
+}
diff --git a/openstack/compute/v2/images/results.go b/openstack/compute/v2/images/results.go
index 493d511..40e814d 100644
--- a/openstack/compute/v2/images/results.go
+++ b/openstack/compute/v2/images/results.go
@@ -11,6 +11,11 @@
gophercloud.Result
}
+// DeleteResult represents the result of an image.Delete operation.
+type DeleteResult struct {
+ gophercloud.ErrResult
+}
+
// Extract interprets a GetResult as an Image.
func (gr GetResult) Extract() (*Image, error) {
if gr.Err != nil {