Change HTTP methods for OpenStack block storage
diff --git a/openstack/blockstorage/v1/volumes/requests.go b/openstack/blockstorage/v1/volumes/requests.go
index ad4e574..253aaf7 100644
--- a/openstack/blockstorage/v1/volumes/requests.go
+++ b/openstack/blockstorage/v1/volumes/requests.go
@@ -83,10 +83,8 @@
return res
}
- _, res.Err = client.Request("POST", createURL(client), gophercloud.RequestOpts{
- OkCodes: []int{200, 201},
- JSONBody: &reqBody,
- JSONResponse: &res.Body,
+ _, res.Err = client.Post(createURL(client), reqBody, &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200, 201},
})
return res
}
@@ -94,7 +92,7 @@
// Delete will delete the existing Volume with the provided ID.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{})
+ _, res.Err = client.Delete(deleteURL(client, id), nil)
return res
}
@@ -102,9 +100,7 @@
// from the response, call the Extract method on the GetResult.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
- _, res.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- })
+ _, res.Err = client.Get(getURL(client, id), &res.Body, nil)
return res
}
@@ -200,10 +196,8 @@
return res
}
- _, res.Err = client.Request("PUT", updateURL(client, id), gophercloud.RequestOpts{
- OkCodes: []int{200},
- JSONBody: &reqBody,
- JSONResponse: &res.Body,
+ _, res.Err = client.Put(updateURL(client, id), reqBody, &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
}