Change HTTP methods for OpenStack Compute
diff --git a/openstack/compute/v2/extensions/defsecrules/requests.go b/openstack/compute/v2/extensions/defsecrules/requests.go
index c29d46f..9f27ef1 100644
--- a/openstack/compute/v2/extensions/defsecrules/requests.go
+++ b/openstack/compute/v2/extensions/defsecrules/requests.go
@@ -73,10 +73,8 @@
return result
}
- _, result.Err = client.Request("POST", rootURL(client), gophercloud.RequestOpts{
- JSONResponse: &result.Body,
- JSONBody: &reqBody,
- OkCodes: []int{200},
+ _, result.Err = client.Post(rootURL(client), reqBody, &result.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return result
@@ -85,19 +83,13 @@
// Get will return details for a particular default rule.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var result GetResult
-
- _, result.Err = client.Request("GET", resourceURL(client, id), gophercloud.RequestOpts{
- JSONResponse: &result.Body,
- })
-
+ _, result.Err = client.Get(resourceURL(client, id), &result.Body, nil)
return result
}
// Delete will permanently delete a default rule from the project.
func Delete(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult {
var result gophercloud.ErrResult
-
- _, result.Err = client.Request("DELETE", resourceURL(client, id), gophercloud.RequestOpts{})
-
+ _, result.Err = client.Delete(resourceURL(client, id), nil)
return result
}