Add Networking HTTP operations
diff --git a/openstack/networking/v2/networks/requests.go b/openstack/networking/v2/networks/requests.go
index 2e38839..7be3227 100644
--- a/openstack/networking/v2/networks/requests.go
+++ b/openstack/networking/v2/networks/requests.go
@@ -79,9 +79,7 @@
// Get retrieves a specific network based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
- _, res.Err = c.Request("GET", getURL(c, id), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- })
+ _, res.Err = c.Get(getURL(c, id), &res.Body, nil)
return res
}
@@ -133,11 +131,7 @@
return res
}
- // Send request to API
- _, res.Err = c.Request("POST", createURL(c), gophercloud.RequestOpts{
- JSONBody: &reqBody,
- JSONResponse: &res.Body,
- })
+ _, res.Err = c.Post(createURL(c), reqBody, &res.Body, nil)
return res
}
@@ -182,10 +176,8 @@
}
// Send request to API
- _, res.Err = c.Request("PUT", updateURL(c, networkID), gophercloud.RequestOpts{
- JSONBody: &reqBody,
- JSONResponse: &res.Body,
- OkCodes: []int{200, 201},
+ _, res.Err = c.Put(updateURL(c, networkID), reqBody, &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200, 201},
})
return res
@@ -194,6 +186,6 @@
// Delete accepts a unique ID and deletes the network associated with it.
func Delete(c *gophercloud.ServiceClient, networkID string) DeleteResult {
var res DeleteResult
- _, res.Err = c.Request("DELETE", deleteURL(c, networkID), gophercloud.RequestOpts{})
+ _, res.Err = c.Delete(deleteURL(c, networkID), nil)
return res
}