Refactor to use new client.Request
diff --git a/openstack/db/v1/databases/requests.go b/openstack/db/v1/databases/requests.go
index 300e177..4d10878 100644
--- a/openstack/db/v1/databases/requests.go
+++ b/openstack/db/v1/databases/requests.go
@@ -3,7 +3,6 @@
import (
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -68,16 +67,12 @@
return res
}
- resp, err := perigee.Request("POST", baseURL(client, instanceID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{202},
+ _, res.Err = client.Request("POST", baseURL(client, instanceID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{202},
})
- res.Header = resp.HttpResponse.Header
- res.Err = err
-
return res
}
@@ -92,14 +87,10 @@
func Delete(client *gophercloud.ServiceClient, instanceID, dbName string) DeleteResult {
var res DeleteResult
- resp, err := perigee.Request("DELETE", dbURL(client, instanceID, dbName), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{202},
+ _, res.Err = client.Request("DELETE", dbURL(client, instanceID, dbName), gophercloud.RequestOpts{
+ JSONBody: &res.Body,
+ OkCodes: []int{202},
})
- res.Header = resp.HttpResponse.Header
- res.Err = err
-
return res
}