Adjust regexps and do another pass.
diff --git a/rackspace/blockstorage/v1/snapshots/delegate.go b/rackspace/blockstorage/v1/snapshots/delegate.go
index b338c36..1cd1b6e 100644
--- a/rackspace/blockstorage/v1/snapshots/delegate.go
+++ b/rackspace/blockstorage/v1/snapshots/delegate.go
@@ -3,8 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
-
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
@@ -123,11 +121,10 @@
}
// Send request to API
- _, res.Err = perigee.Request("PUT", updateURL(c, snapshotID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200, 201},
+ _, res.Err = c.Request("PUT", updateURL(c, snapshotID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200, 201},
})
return res
diff --git a/rackspace/compute/v2/networks/requests.go b/rackspace/compute/v2/networks/requests.go
index 1ae14e6..3aefb0c 100644
--- a/rackspace/compute/v2/networks/requests.go
+++ b/rackspace/compute/v2/networks/requests.go
@@ -5,8 +5,6 @@
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
-
- "github.com/racker/perigee"
)
// List returns a Pager which allows you to iterate over a collection of
@@ -23,10 +21,9 @@
// Get retrieves a specific network based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", getURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", getURL(c, id), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -92,9 +89,8 @@
// 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 = perigee.Request("DELETE", deleteURL(c, networkID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", deleteURL(c, networkID), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/rackspace/compute/v2/virtualinterfaces/requests.go b/rackspace/compute/v2/virtualinterfaces/requests.go
index bfe3487..3c81ef8 100644
--- a/rackspace/compute/v2/virtualinterfaces/requests.go
+++ b/rackspace/compute/v2/virtualinterfaces/requests.go
@@ -3,8 +3,6 @@
import (
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
-
- "github.com/racker/perigee"
)
// List returns a Pager which allows you to iterate over a collection of
@@ -30,11 +28,10 @@
}
// Send request to API
- _, res.Err = perigee.Request("POST", createURL(c, instanceID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200, 201, 202},
+ _, res.Err = c.Request("POST", createURL(c, instanceID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200, 201, 202},
})
return res
}
@@ -43,9 +40,8 @@
// instanceID.
func Delete(c *gophercloud.ServiceClient, instanceID, interfaceID string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(c, instanceID, interfaceID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{200, 204},
+ _, res.Err = c.Request("DELETE", deleteURL(c, instanceID, interfaceID), gophercloud.RequestOpts{
+ OkCodes: []int{200, 204},
})
return res
}
diff --git a/rackspace/identity/v2/roles/delegate.go b/rackspace/identity/v2/roles/delegate.go
index a6c01e4..a6ee851 100644
--- a/rackspace/identity/v2/roles/delegate.go
+++ b/rackspace/identity/v2/roles/delegate.go
@@ -1,7 +1,6 @@
package roles
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
@@ -20,9 +19,8 @@
func AddUserRole(client *gophercloud.ServiceClient, userID, roleID string) UserRoleResult {
var result UserRoleResult
- _, result.Err = perigee.Request("PUT", userRoleURL(client, userID, roleID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200, 201},
+ _, result.Err = client.Request("PUT", userRoleURL(client, userID, roleID), gophercloud.RequestOpts{
+ OkCodes: []int{200, 201},
})
return result
@@ -34,9 +32,8 @@
func DeleteUserRole(client *gophercloud.ServiceClient, userID, roleID string) UserRoleResult {
var result UserRoleResult
- _, result.Err = perigee.Request("DELETE", userRoleURL(client, userID, roleID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, result.Err = client.Request("DELETE", userRoleURL(client, userID, roleID), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return result
diff --git a/rackspace/identity/v2/users/delegate.go b/rackspace/identity/v2/users/delegate.go
index ae2acde..6135bec 100644
--- a/rackspace/identity/v2/users/delegate.go
+++ b/rackspace/identity/v2/users/delegate.go
@@ -3,7 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
os "github.com/rackspace/gophercloud/openstack/identity/v2/users"
"github.com/rackspace/gophercloud/pagination"
@@ -116,11 +115,10 @@
func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult {
var result UpdateResult
- _, result.Err = perigee.Request("POST", os.ResourceURL(client, id), perigee.Options{
- Results: &result.Body,
- ReqBody: opts.ToUserUpdateMap(),
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, result.Err = client.Request("POST", os.ResourceURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ JSONBody: opts.ToUserUpdateMap(),
+ OkCodes: []int{200},
})
return result
@@ -135,10 +133,9 @@
func ResetAPIKey(client *gophercloud.ServiceClient, id string) ResetAPIKeyResult {
var result ResetAPIKeyResult
- _, result.Err = perigee.Request("POST", resetAPIKeyURL(client, id), perigee.Options{
- Results: &result.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, result.Err = client.Request("POST", resetAPIKeyURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ OkCodes: []int{200},
})
return result
diff --git a/rackspace/lb/v1/acl/requests.go b/rackspace/lb/v1/acl/requests.go
index 8e88ae3..94d98e3 100644
--- a/rackspace/lb/v1/acl/requests.go
+++ b/rackspace/lb/v1/acl/requests.go
@@ -4,7 +4,6 @@
"errors"
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -75,10 +74,9 @@
return res
}
- _, res.Err = perigee.Request("POST", rootURL(client, loadBalancerID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- OkCodes: []int{202},
+ _, res.Err = client.Request("POST", rootURL(client, loadBalancerID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ OkCodes: []int{202},
})
return res
@@ -107,9 +105,8 @@
// Delete will remove a single network item from a load balancer's access list.
func Delete(c *gophercloud.ServiceClient, lbID, itemID int) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, lbID, itemID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = c.Request("DELETE", resourceURL(c, lbID, itemID), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
}
@@ -118,9 +115,8 @@
// effectively resetting it and allowing all traffic.
func DeleteAll(c *gophercloud.ServiceClient, lbID int) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = c.Request("DELETE", rootURL(c, lbID), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
}
diff --git a/rackspace/lb/v1/lbs/requests.go b/rackspace/lb/v1/lbs/requests.go
index 0b677f2..49a46f6 100644
--- a/rackspace/lb/v1/lbs/requests.go
+++ b/rackspace/lb/v1/lbs/requests.go
@@ -4,7 +4,6 @@
"errors"
"github.com/mitchellh/mapstructure"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
@@ -244,10 +243,9 @@
func Get(c *gophercloud.ServiceClient, id int) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", resourceURL(c, id), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -282,9 +280,8 @@
func Delete(c *gophercloud.ServiceClient, id int) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = c.Request("DELETE", resourceURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
@@ -366,10 +363,9 @@
return res
}
- _, res.Err = perigee.Request("PUT", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- OkCodes: []int{202},
+ _, res.Err = c.Request("PUT", resourceURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ OkCodes: []int{202},
})
return res
@@ -398,10 +394,9 @@
func IsLoggingEnabled(client *gophercloud.ServiceClient, id int) (bool, error) {
var body interface{}
- _, err := perigee.Request("GET", loggingURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &body,
- OkCodes: []int{200},
+ _, err := client.Request("GET", loggingURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &body,
+ OkCodes: []int{200},
})
if err != nil {
return false, err
@@ -428,10 +423,9 @@
reqBody := toConnLoggingMap(true)
var res gophercloud.ErrResult
- _, res.Err = perigee.Request("PUT", loggingURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- OkCodes: []int{202},
+ _, res.Err = client.Request("PUT", loggingURL(client, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ OkCodes: []int{202},
})
return res
@@ -442,10 +436,9 @@
reqBody := toConnLoggingMap(false)
var res gophercloud.ErrResult
- _, res.Err = perigee.Request("PUT", loggingURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- OkCodes: []int{202},
+ _, res.Err = client.Request("PUT", loggingURL(client, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ OkCodes: []int{202},
})
return res
@@ -455,10 +448,9 @@
func GetErrorPage(client *gophercloud.ServiceClient, id int) ErrorPageResult {
var res ErrorPageResult
- _, res.Err = perigee.Request("GET", errorPageURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = client.Request("GET", errorPageURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -472,11 +464,10 @@
type stringMap map[string]string
reqBody := map[string]stringMap{"errorpage": stringMap{"content": html}}
- _, res.Err = perigee.Request("PUT", errorPageURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &res.Body,
- ReqBody: &reqBody,
- OkCodes: []int{200},
+ _, res.Err = client.Request("PUT", errorPageURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ JSONBody: &reqBody,
+ OkCodes: []int{200},
})
return res
@@ -486,9 +477,8 @@
func DeleteErrorPage(client *gophercloud.ServiceClient, id int) gophercloud.ErrResult {
var res gophercloud.ErrResult
- _, res.Err = perigee.Request("DELETE", errorPageURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, res.Err = client.Request("DELETE", errorPageURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
@@ -498,10 +488,9 @@
func GetStats(client *gophercloud.ServiceClient, id int) StatsResult {
var res StatsResult
- _, res.Err = perigee.Request("GET", statsURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = client.Request("GET", statsURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -518,10 +507,9 @@
func IsContentCached(client *gophercloud.ServiceClient, id int) (bool, error) {
var body interface{}
- _, err := perigee.Request("GET", cacheURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &body,
- OkCodes: []int{200},
+ _, err := client.Request("GET", cacheURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &body,
+ OkCodes: []int{200},
})
if err != nil {
return false, err
@@ -548,10 +536,9 @@
reqBody := toCachingMap(true)
var res gophercloud.ErrResult
- _, res.Err = perigee.Request("PUT", cacheURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- OkCodes: []int{202},
+ _, res.Err = client.Request("PUT", cacheURL(client, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ OkCodes: []int{202},
})
return res
@@ -562,10 +549,9 @@
reqBody := toCachingMap(false)
var res gophercloud.ErrResult
- _, res.Err = perigee.Request("PUT", cacheURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- OkCodes: []int{202},
+ _, res.Err = client.Request("PUT", cacheURL(client, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ OkCodes: []int{202},
})
return res
diff --git a/rackspace/lb/v1/monitors/requests.go b/rackspace/lb/v1/monitors/requests.go
index cfc35d2..917282c 100644
--- a/rackspace/lb/v1/monitors/requests.go
+++ b/rackspace/lb/v1/monitors/requests.go
@@ -3,8 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
-
"github.com/rackspace/gophercloud"
)
@@ -143,10 +141,9 @@
return res
}
- _, res.Err = perigee.Request("PUT", rootURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- OkCodes: []int{202},
+ _, res.Err = c.Request("PUT", rootURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ OkCodes: []int{202},
})
return res
@@ -156,10 +153,9 @@
func Get(c *gophercloud.ServiceClient, id int) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", rootURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", rootURL(c, id), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -169,9 +165,8 @@
func Delete(c *gophercloud.ServiceClient, id int) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", rootURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = c.Request("DELETE", rootURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
diff --git a/rackspace/lb/v1/nodes/requests.go b/rackspace/lb/v1/nodes/requests.go
index 5c926a9..86fe5d7 100644
--- a/rackspace/lb/v1/nodes/requests.go
+++ b/rackspace/lb/v1/nodes/requests.go
@@ -4,7 +4,6 @@
"errors"
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -113,18 +112,17 @@
return res
}
- resp, err := perigee.Request("POST", rootURL(client, loadBalancerID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{202},
+ resp, err := client.Request("POST", rootURL(client, loadBalancerID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{202},
})
if err != nil {
res.Err = err
return res
}
- pr, err := pagination.PageResultFrom(&resp.HttpResponse)
+ pr, err := pagination.PageResultFrom(resp)
if err != nil {
res.Err = err
return res
@@ -158,10 +156,9 @@
func Get(c *gophercloud.ServiceClient, lbID, nodeID int) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", resourceURL(c, lbID, nodeID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", resourceURL(c, lbID, nodeID), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -216,10 +213,9 @@
return res
}
- _, res.Err = perigee.Request("PUT", resourceURL(c, lbID, nodeID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- OkCodes: []int{202},
+ _, res.Err = c.Request("PUT", resourceURL(c, lbID, nodeID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ OkCodes: []int{202},
})
return res
@@ -228,9 +224,8 @@
// Delete is the operation responsible for permanently deleting a node.
func Delete(c *gophercloud.ServiceClient, lbID, nodeID int) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, lbID, nodeID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = c.Request("DELETE", resourceURL(c, lbID, nodeID), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
}
diff --git a/rackspace/lb/v1/sessions/requests.go b/rackspace/lb/v1/sessions/requests.go
index 9853ad1..5572407 100644
--- a/rackspace/lb/v1/sessions/requests.go
+++ b/rackspace/lb/v1/sessions/requests.go
@@ -3,8 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
-
"github.com/rackspace/gophercloud"
)
@@ -44,11 +42,10 @@
return res
}
- _, res.Err = perigee.Request("PUT", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{202},
+ _, res.Err = c.Request("PUT", rootURL(c, lbID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{202},
})
return res
@@ -59,10 +56,9 @@
func Get(c *gophercloud.ServiceClient, lbID int) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", rootURL(c, lbID), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -73,9 +69,8 @@
func Disable(c *gophercloud.ServiceClient, lbID int) DisableResult {
var res DisableResult
- _, res.Err = perigee.Request("DELETE", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = c.Request("DELETE", rootURL(c, lbID), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
diff --git a/rackspace/lb/v1/ssl/requests.go b/rackspace/lb/v1/ssl/requests.go
index 84b2712..e9c6514 100644
--- a/rackspace/lb/v1/ssl/requests.go
+++ b/rackspace/lb/v1/ssl/requests.go
@@ -3,8 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
-
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -87,11 +85,10 @@
return res
}
- _, res.Err = perigee.Request("PUT", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("PUT", rootURL(c, lbID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -102,10 +99,9 @@
func Get(c *gophercloud.ServiceClient, lbID int) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", rootURL(c, lbID), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -116,9 +112,8 @@
func Delete(c *gophercloud.ServiceClient, lbID int) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, res.Err = c.Request("DELETE", rootURL(c, lbID), gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
@@ -185,11 +180,10 @@
return res
}
- _, res.Err = perigee.Request("POST", certURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("POST", certURL(c, lbID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -199,10 +193,9 @@
func GetCert(c *gophercloud.ServiceClient, lbID, certID int) GetCertResult {
var res GetCertResult
- _, res.Err = perigee.Request("GET", certResourceURL(c, lbID, certID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", certResourceURL(c, lbID, certID), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -254,11 +247,10 @@
return res
}
- _, res.Err = perigee.Request("PUT", certResourceURL(c, lbID, certID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{202},
+ _, res.Err = c.Request("PUT", certResourceURL(c, lbID, certID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{202},
})
return res
@@ -269,9 +261,8 @@
func DeleteCert(c *gophercloud.ServiceClient, lbID, certID int) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", certResourceURL(c, lbID, certID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, res.Err = c.Request("DELETE", certResourceURL(c, lbID, certID), gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
diff --git a/rackspace/lb/v1/throttle/requests.go b/rackspace/lb/v1/throttle/requests.go
index 8c2e4be..2680a89 100644
--- a/rackspace/lb/v1/throttle/requests.go
+++ b/rackspace/lb/v1/throttle/requests.go
@@ -3,8 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
-
"github.com/rackspace/gophercloud"
)
@@ -57,11 +55,10 @@
return res
}
- _, res.Err = perigee.Request("PUT", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{202},
+ _, res.Err = c.Request("PUT", rootURL(c, lbID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{202},
})
return res
@@ -72,10 +69,9 @@
func Get(c *gophercloud.ServiceClient, lbID int) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", rootURL(c, lbID), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -86,9 +82,8 @@
func Delete(c *gophercloud.ServiceClient, lbID int) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = c.Request("DELETE", rootURL(c, lbID), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
diff --git a/rackspace/lb/v1/vips/requests.go b/rackspace/lb/v1/vips/requests.go
index f9b2d37..d52a73a 100644
--- a/rackspace/lb/v1/vips/requests.go
+++ b/rackspace/lb/v1/vips/requests.go
@@ -3,8 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
-
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -69,11 +67,10 @@
return res
}
- _, res.Err = perigee.Request("POST", rootURL(c, lbID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{202},
+ _, res.Err = c.Request("POST", rootURL(c, lbID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{202},
})
return res
@@ -103,9 +100,8 @@
// Delete is the operation responsible for permanently deleting a VIP.
func Delete(c *gophercloud.ServiceClient, lbID, vipID int) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, lbID, vipID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = c.Request("DELETE", resourceURL(c, lbID, vipID), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
}
diff --git a/rackspace/objectstorage/v1/cdncontainers/requests.go b/rackspace/objectstorage/v1/cdncontainers/requests.go
index 05b1939..8e4abbe 100644
--- a/rackspace/objectstorage/v1/cdncontainers/requests.go
+++ b/rackspace/objectstorage/v1/cdncontainers/requests.go
@@ -3,7 +3,6 @@
import (
"strconv"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
)
@@ -50,11 +49,11 @@
}
}
- resp, err := perigee.Request("PUT", enableURL(c, containerName), perigee.Options{
+ resp, err := c.Request("PUT", enableURL(c, containerName), gophercloud.RequestOpts{
MoreHeaders: h,
OkCodes: []int{201, 202, 204},
})
- res.Header = resp.HttpResponse.Header
+ res.Header = resp.Header
res.Err = err
return res
}
@@ -64,11 +63,10 @@
// function.
func Get(c *gophercloud.ServiceClient, containerName string) GetResult {
var res GetResult
- resp, err := perigee.Request("HEAD", getURL(c, containerName), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{200, 204},
+ resp, err := c.Request("HEAD", getURL(c, containerName), gophercloud.RequestOpts{
+ OkCodes: []int{200, 204},
})
- res.Header = resp.HttpResponse.Header
+ res.Header = resp.Header
res.Err = err
return res
}
@@ -147,11 +145,11 @@
}
}
- resp, err := perigee.Request("POST", updateURL(c, containerName), perigee.Options{
+ resp, err := c.Request("POST", updateURL(c, containerName), gophercloud.RequestOpts{
MoreHeaders: h,
OkCodes: []int{202, 204},
})
- res.Header = resp.HttpResponse.Header
+ res.Header = resp.Header
res.Err = err
return res
}