openstack/ :knife: perigee
diff --git a/openstack/identity/v2/tokens/requests.go b/openstack/identity/v2/tokens/requests.go
index 87c923a..db1ac82 100644
--- a/openstack/identity/v2/tokens/requests.go
+++ b/openstack/identity/v2/tokens/requests.go
@@ -1,9 +1,6 @@
package tokens
-import (
- "github.com/racker/perigee"
- "github.com/rackspace/gophercloud"
-)
+import "github.com/rackspace/gophercloud"
// AuthOptionsBuilder describes any argument that may be passed to the Create call.
type AuthOptionsBuilder interface {
@@ -78,10 +75,10 @@
}
var result CreateResult
- _, result.Err = perigee.Request("POST", CreateURL(client), perigee.Options{
- ReqBody: &request,
- Results: &result.Body,
- OkCodes: []int{200, 203},
+ _, result.Err = client.Request("POST", CreateURL(client), gophercloud.RequestOpts{
+ JSONBody: &request,
+ JSONResponse: &result.Body,
+ OkCodes: []int{200, 203},
})
return result
}
diff --git a/openstack/identity/v2/users/requests.go b/openstack/identity/v2/users/requests.go
index 4ce395f..045d9b3 100644
--- a/openstack/identity/v2/users/requests.go
+++ b/openstack/identity/v2/users/requests.go
@@ -91,11 +91,10 @@
return res
}
- _, res.Err = perigee.Request("POST", rootURL(client), perigee.Options{
- Results: &res.Body,
- ReqBody: reqBody,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200, 201},
+ _, res.Err = client.Request("POST", rootURL(client), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ JSONBody: reqBody,
+ OkCodes: []int{200, 201},
})
return res
diff --git a/openstack/identity/v3/endpoints/requests.go b/openstack/identity/v3/endpoints/requests.go
index 7bdb7ce..2cf6b34 100644
--- a/openstack/identity/v3/endpoints/requests.go
+++ b/openstack/identity/v3/endpoints/requests.go
@@ -57,11 +57,10 @@
reqBody.Endpoint.Region = gophercloud.MaybeString(opts.Region)
var result CreateResult
- _, result.Err = perigee.Request("POST", listURL(client), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &result.Body,
- OkCodes: []int{201},
+ _, result.Err = client.Request("POST", listURL(client), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &result.Body,
+ OkCodes: []int{201},
})
return result
}
diff --git a/openstack/identity/v3/services/requests.go b/openstack/identity/v3/services/requests.go
index 1d9aaa8..a3534e5 100644
--- a/openstack/identity/v3/services/requests.go
+++ b/openstack/identity/v3/services/requests.go
@@ -19,11 +19,10 @@
req := request{Type: serviceType}
var result CreateResult
- _, result.Err = perigee.Request("POST", listURL(client), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &req,
- Results: &result.Body,
- OkCodes: []int{201},
+ _, result.Err = client.Request("POST", listURL(client), gophercloud.RequestOpts{
+ JSONBody: &req,
+ JSONResponse: &result.Body,
+ OkCodes: []int{201},
})
return result
}
diff --git a/openstack/identity/v3/tokens/requests.go b/openstack/identity/v3/tokens/requests.go
index 5ca1031..ff958c7 100644
--- a/openstack/identity/v3/tokens/requests.go
+++ b/openstack/identity/v3/tokens/requests.go
@@ -234,10 +234,10 @@
var result CreateResult
var response *perigee.Response
- response, result.Err = perigee.Request("POST", tokenURL(c), perigee.Options{
- ReqBody: &req,
- Results: &result.Body,
- OkCodes: []int{201},
+ response, result.Err = c.Request("POST", tokenURL(c), gophercloud.RequestOpts{
+ JSONBody: &req,
+ JSONResponse: &result.Body,
+ OkCodes: []int{201},
})
if result.Err != nil {
return result
@@ -250,10 +250,10 @@
func Get(c *gophercloud.ServiceClient, token string) GetResult {
var result GetResult
var response *perigee.Response
- response, result.Err = perigee.Request("GET", tokenURL(c), perigee.Options{
- MoreHeaders: subjectTokenHeaders(c, token),
- Results: &result.Body,
- OkCodes: []int{200, 203},
+ response, result.Err = c.Request("GET", tokenURL(c), gophercloud.RequestOpts{
+ MoreHeaders: subjectTokenHeaders(c, token),
+ JSONResponse: &result.Body,
+ OkCodes: []int{200, 203},
})
if result.Err != nil {
return result
@@ -264,7 +264,7 @@
// Validate determines if a specified token is valid or not.
func Validate(c *gophercloud.ServiceClient, token string) (bool, error) {
- response, err := perigee.Request("HEAD", tokenURL(c), perigee.Options{
+ response, err := c.Request("HEAD", tokenURL(c), gophercloud.RequestOpts{
MoreHeaders: subjectTokenHeaders(c, token),
OkCodes: []int{204, 404},
})
@@ -278,7 +278,7 @@
// Revoke immediately makes specified token invalid.
func Revoke(c *gophercloud.ServiceClient, token string) RevokeResult {
var res RevokeResult
- _, res.Err = perigee.Request("DELETE", tokenURL(c), perigee.Options{
+ _, res.Err = c.Request("DELETE", tokenURL(c), gophercloud.RequestOpts{
MoreHeaders: subjectTokenHeaders(c, token),
OkCodes: []int{204},
})