Adjust regexps and do another pass.
diff --git a/openstack/cdn/v1/flavors/requests.go b/openstack/cdn/v1/flavors/requests.go
index 88ac891..138fd97 100644
--- a/openstack/cdn/v1/flavors/requests.go
+++ b/openstack/cdn/v1/flavors/requests.go
@@ -1,7 +1,6 @@
package flavors
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -18,10 +17,9 @@
// Get retrieves a specific flavor 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
}
diff --git a/openstack/common/extensions/requests.go b/openstack/common/extensions/requests.go
index 3ca6e12..dfd81c9 100755
--- a/openstack/common/extensions/requests.go
+++ b/openstack/common/extensions/requests.go
@@ -1,7 +1,6 @@
package extensions
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -9,10 +8,9 @@
// Get retrieves information for a specific extension using its alias.
func Get(c *gophercloud.ServiceClient, alias string) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", ExtensionURL(c, alias), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", ExtensionURL(c, alias), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
diff --git a/openstack/compute/v2/extensions/defsecrules/requests.go b/openstack/compute/v2/extensions/defsecrules/requests.go
index b0355f0..294bae3 100644
--- a/openstack/compute/v2/extensions/defsecrules/requests.go
+++ b/openstack/compute/v2/extensions/defsecrules/requests.go
@@ -3,8 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
-
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -88,10 +86,9 @@
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var result GetResult
- _, result.Err = perigee.Request("GET", resourceURL(client, id), perigee.Options{
- Results: &result.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, result.Err = client.Request("GET", resourceURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ OkCodes: []int{200},
})
return result
@@ -101,9 +98,8 @@
func Delete(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult {
var result gophercloud.ErrResult
- _, result.Err = perigee.Request("DELETE", resourceURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, result.Err = client.Request("DELETE", resourceURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return result
diff --git a/openstack/compute/v2/extensions/keypairs/requests.go b/openstack/compute/v2/extensions/keypairs/requests.go
index 715b494..287e412 100644
--- a/openstack/compute/v2/extensions/keypairs/requests.go
+++ b/openstack/compute/v2/extensions/keypairs/requests.go
@@ -3,7 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/openstack/compute/v2/servers"
"github.com/rackspace/gophercloud/pagination"
@@ -93,10 +92,9 @@
// Get returns public data about a previously uploaded KeyPair.
func Get(client *gophercloud.ServiceClient, name string) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", getURL(client, name), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = client.Request("GET", getURL(client, name), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -104,9 +102,8 @@
// Delete requests the deletion of a previous stored KeyPair from the server.
func Delete(client *gophercloud.ServiceClient, name string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(client, name), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = client.Request("DELETE", deleteURL(client, name), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
}
diff --git a/openstack/compute/v2/extensions/secgroups/requests.go b/openstack/compute/v2/extensions/secgroups/requests.go
index 3ebbf89..4292894 100644
--- a/openstack/compute/v2/extensions/secgroups/requests.go
+++ b/openstack/compute/v2/extensions/secgroups/requests.go
@@ -3,8 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
-
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -125,11 +123,10 @@
return result
}
- _, result.Err = perigee.Request("PUT", resourceURL(client, id), perigee.Options{
- Results: &result.Body,
- ReqBody: &reqBody,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, result.Err = client.Request("PUT", resourceURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ JSONBody: &reqBody,
+ OkCodes: []int{200},
})
return result
@@ -139,10 +136,9 @@
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var result GetResult
- _, result.Err = perigee.Request("GET", resourceURL(client, id), perigee.Options{
- Results: &result.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, result.Err = client.Request("GET", resourceURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ OkCodes: []int{200},
})
return result
@@ -152,9 +148,8 @@
func Delete(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult {
var result gophercloud.ErrResult
- _, result.Err = perigee.Request("DELETE", resourceURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, result.Err = client.Request("DELETE", resourceURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return result
@@ -252,9 +247,8 @@
func DeleteRule(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult {
var result gophercloud.ErrResult
- _, result.Err = perigee.Request("DELETE", resourceRuleURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, result.Err = client.Request("DELETE", resourceRuleURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return result
@@ -271,11 +265,10 @@
func AddServerToGroup(client *gophercloud.ServiceClient, serverID, groupName string) gophercloud.ErrResult {
var result gophercloud.ErrResult
- _, result.Err = perigee.Request("POST", serverActionURL(client, serverID), perigee.Options{
- Results: &result.Body,
- ReqBody: actionMap("add", groupName),
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, result.Err = client.Request("POST", serverActionURL(client, serverID), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ JSONBody: actionMap("add", groupName),
+ OkCodes: []int{202},
})
return result
@@ -285,11 +278,10 @@
func RemoveServerFromGroup(client *gophercloud.ServiceClient, serverID, groupName string) gophercloud.ErrResult {
var result gophercloud.ErrResult
- _, result.Err = perigee.Request("POST", serverActionURL(client, serverID), perigee.Options{
- Results: &result.Body,
- ReqBody: actionMap("remove", groupName),
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, result.Err = client.Request("POST", serverActionURL(client, serverID), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ JSONBody: actionMap("remove", groupName),
+ OkCodes: []int{202},
})
return result
diff --git a/openstack/compute/v2/extensions/startstop/requests.go b/openstack/compute/v2/extensions/startstop/requests.go
index 99c91b0..04b5909 100644
--- a/openstack/compute/v2/extensions/startstop/requests.go
+++ b/openstack/compute/v2/extensions/startstop/requests.go
@@ -1,9 +1,6 @@
package startstop
-import (
- "github.com/racker/perigee"
- "github.com/rackspace/gophercloud"
-)
+import "github.com/rackspace/gophercloud"
func actionURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL("servers", id, "action")
@@ -15,10 +12,9 @@
reqBody := map[string]interface{}{"os-start": nil}
- _, res.Err = perigee.Request("POST", actionURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: reqBody,
- OkCodes: []int{202},
+ _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
+ JSONBody: reqBody,
+ OkCodes: []int{202},
})
return res
@@ -30,10 +26,9 @@
reqBody := map[string]interface{}{"os-stop": nil}
- _, res.Err = perigee.Request("POST", actionURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: reqBody,
- OkCodes: []int{202},
+ _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
+ JSONBody: reqBody,
+ OkCodes: []int{202},
})
return res
diff --git a/openstack/compute/v2/extensions/volumeattach/requests.go b/openstack/compute/v2/extensions/volumeattach/requests.go
index a1d26f8..79709fd 100644
--- a/openstack/compute/v2/extensions/volumeattach/requests.go
+++ b/openstack/compute/v2/extensions/volumeattach/requests.go
@@ -3,7 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -55,11 +54,10 @@
return res
}
- _, res.Err = perigee.Request("POST", createURL(client, serverId), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: reqBody,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = client.Request("POST", createURL(client, serverId), gophercloud.RequestOpts{
+ JSONBody: reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -67,10 +65,9 @@
// Get returns public data about a previously created VolumeAttachment.
func Get(client *gophercloud.ServiceClient, serverId, aId string) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", getURL(client, serverId, aId), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = client.Request("GET", getURL(client, serverId, aId), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -78,9 +75,8 @@
// Delete requests the deletion of a previous stored VolumeAttachment from the server.
func Delete(client *gophercloud.ServiceClient, serverId, aId string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(client, serverId, aId), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = client.Request("DELETE", deleteURL(client, serverId, aId), gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
}
diff --git a/openstack/compute/v2/images/requests.go b/openstack/compute/v2/images/requests.go
index fe07d4a..9e9c3b1 100644
--- a/openstack/compute/v2/images/requests.go
+++ b/openstack/compute/v2/images/requests.go
@@ -3,8 +3,6 @@
import (
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
-
- "github.com/racker/perigee"
)
// ListOptsBuilder allows extensions to add additional parameters to the
@@ -62,10 +60,9 @@
// Use ExtractImage() to interpret the result as an openstack Image.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var result GetResult
- _, result.Err = perigee.Request("GET", getURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &result.Body,
- OkCodes: []int{200},
+ _, result.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ OkCodes: []int{200},
})
return result
}
diff --git a/openstack/compute/v2/servers/requests.go b/openstack/compute/v2/servers/requests.go
index dde566d..b7c1611 100644
--- a/openstack/compute/v2/servers/requests.go
+++ b/openstack/compute/v2/servers/requests.go
@@ -5,7 +5,6 @@
"errors"
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -228,9 +227,8 @@
// Delete requests that a server previously provisioned be removed from your account.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
@@ -238,10 +236,9 @@
// Get requests details on a single server, by ID.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var result GetResult
- _, result.Err = perigee.Request("GET", getURL(client, id), perigee.Options{
- Results: &result.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200, 203},
+ _, result.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ OkCodes: []int{200, 203},
})
return result
}
@@ -283,10 +280,9 @@
// Update requests that various attributes of the indicated server be changed.
func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult {
var result UpdateResult
- _, result.Err = perigee.Request("PUT", updateURL(client, id), perigee.Options{
- Results: &result.Body,
- ReqBody: opts.ToServerUpdateMap(),
- MoreHeaders: client.AuthenticatedHeaders(),
+ _, result.Err = client.Request("PUT", updateURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ JSONBody: opts.ToServerUpdateMap(),
})
return result
}
@@ -303,10 +299,9 @@
var res ActionResult
- _, res.Err = perigee.Request("POST", actionURL(client, id), perigee.Options{
- ReqBody: req,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
+ JSONBody: req,
+ OkCodes: []int{202},
})
return res
@@ -372,14 +367,13 @@
return res
}
- _, res.Err = perigee.Request("POST", actionURL(client, id), perigee.Options{
- ReqBody: struct {
+ _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
+ JSONBody: struct {
C map[string]string `json:"reboot"`
}{
map[string]string{"type": string(how)},
},
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ OkCodes: []int{202},
})
return res
@@ -474,11 +468,10 @@
return result
}
- _, result.Err = perigee.Request("POST", actionURL(client, id), perigee.Options{
- ReqBody: &reqBody,
- Results: &result.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, result.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &result.Body,
+ OkCodes: []int{202},
})
return result
@@ -521,10 +514,9 @@
return res
}
- _, res.Err = perigee.Request("POST", actionURL(client, id), perigee.Options{
- ReqBody: reqBody,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
+ JSONBody: reqBody,
+ OkCodes: []int{202},
})
return res
@@ -535,10 +527,9 @@
func ConfirmResize(client *gophercloud.ServiceClient, id string) ActionResult {
var res ActionResult
- _, res.Err = perigee.Request("POST", actionURL(client, id), perigee.Options{
- ReqBody: map[string]interface{}{"confirmResize": nil},
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
+ JSONBody: map[string]interface{}{"confirmResize": nil},
+ OkCodes: []int{204},
})
return res
@@ -549,10 +540,9 @@
func RevertResize(client *gophercloud.ServiceClient, id string) ActionResult {
var res ActionResult
- _, res.Err = perigee.Request("POST", actionURL(client, id), perigee.Options{
- ReqBody: map[string]interface{}{"revertResize": nil},
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
+ _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
+ JSONBody: map[string]interface{}{"revertResize": nil},
+ OkCodes: []int{202},
})
return res
@@ -596,11 +586,10 @@
return result
}
- _, result.Err = perigee.Request("POST", actionURL(client, id), perigee.Options{
- Results: &result.Body,
- ReqBody: &reqBody,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, result.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ JSONBody: &reqBody,
+ OkCodes: []int{200},
})
return result
@@ -636,10 +625,9 @@
res.Err = err
return res
}
- _, res.Err = perigee.Request("PUT", metadataURL(client, id), perigee.Options{
- ReqBody: metadata,
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
+ _, res.Err = client.Request("PUT", metadataURL(client, id), gophercloud.RequestOpts{
+ JSONBody: metadata,
+ JSONResponse: &res.Body,
})
return res
}
@@ -647,9 +635,8 @@
// Metadata requests all the metadata for the given server ID.
func Metadata(client *gophercloud.ServiceClient, id string) GetMetadataResult {
var res GetMetadataResult
- _, res.Err = perigee.Request("GET", metadataURL(client, id), perigee.Options{
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
+ _, res.Err = client.Request("GET", metadataURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
})
return res
}
@@ -670,10 +657,9 @@
res.Err = err
return res
}
- _, res.Err = perigee.Request("POST", metadataURL(client, id), perigee.Options{
- ReqBody: metadata,
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
+ _, res.Err = client.Request("POST", metadataURL(client, id), gophercloud.RequestOpts{
+ JSONBody: metadata,
+ JSONResponse: &res.Body,
})
return res
}
@@ -709,10 +695,9 @@
return res
}
- _, res.Err = perigee.Request("PUT", metadatumURL(client, id, key), perigee.Options{
- ReqBody: metadatum,
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
+ _, res.Err = client.Request("PUT", metadatumURL(client, id, key), gophercloud.RequestOpts{
+ JSONBody: metadatum,
+ JSONResponse: &res.Body,
})
return res
}
@@ -720,9 +705,8 @@
// Metadatum requests the key-value pair with the given key for the given server ID.
func Metadatum(client *gophercloud.ServiceClient, id, key string) GetMetadatumResult {
var res GetMetadatumResult
- _, res.Err = perigee.Request("GET", metadatumURL(client, id, key), perigee.Options{
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
+ _, res.Err = client.Request("GET", metadatumURL(client, id, key), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
})
return res
}
@@ -730,9 +714,8 @@
// DeleteMetadatum will delete the key-value pair with the given key for the given server ID.
func DeleteMetadatum(client *gophercloud.ServiceClient, id, key string) DeleteMetadatumResult {
var res DeleteMetadatumResult
- _, res.Err = perigee.Request("DELETE", metadatumURL(client, id, key), perigee.Options{
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
+ _, res.Err = client.Request("DELETE", metadatumURL(client, id, key), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
})
return res
}
diff --git a/openstack/identity/v2/extensions/admin/roles/requests.go b/openstack/identity/v2/extensions/admin/roles/requests.go
index 152031a..bbdf76a 100644
--- a/openstack/identity/v2/extensions/admin/roles/requests.go
+++ b/openstack/identity/v2/extensions/admin/roles/requests.go
@@ -1,7 +1,6 @@
package roles
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -21,9 +20,8 @@
func AddUserRole(client *gophercloud.ServiceClient, tenantID, userID, roleID string) UserRoleResult {
var result UserRoleResult
- _, result.Err = perigee.Request("PUT", userRoleURL(client, tenantID, userID, roleID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200, 201},
+ _, result.Err = client.Request("PUT", userRoleURL(client, tenantID, userID, roleID), gophercloud.RequestOpts{
+ OkCodes: []int{200, 201},
})
return result
@@ -35,9 +33,8 @@
func DeleteUserRole(client *gophercloud.ServiceClient, tenantID, userID, roleID string) UserRoleResult {
var result UserRoleResult
- _, result.Err = perigee.Request("DELETE", userRoleURL(client, tenantID, userID, roleID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, result.Err = client.Request("DELETE", userRoleURL(client, tenantID, userID, roleID), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return result
diff --git a/openstack/identity/v2/users/requests.go b/openstack/identity/v2/users/requests.go
index 045d9b3..2afe62a 100644
--- a/openstack/identity/v2/users/requests.go
+++ b/openstack/identity/v2/users/requests.go
@@ -3,7 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -104,10 +103,9 @@
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var result GetResult
- _, result.Err = perigee.Request("GET", ResourceURL(client, id), perigee.Options{
- Results: &result.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, result.Err = client.Request("GET", ResourceURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ OkCodes: []int{200},
})
return result
@@ -148,11 +146,10 @@
func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult {
var result UpdateResult
- _, result.Err = perigee.Request("PUT", ResourceURL(client, id), perigee.Options{
- Results: &result.Body,
- ReqBody: opts.ToUserUpdateMap(),
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, result.Err = client.Request("PUT", ResourceURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ JSONBody: opts.ToUserUpdateMap(),
+ OkCodes: []int{200},
})
return result
@@ -162,9 +159,8 @@
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var result DeleteResult
- _, result.Err = perigee.Request("DELETE", ResourceURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, result.Err = client.Request("DELETE", ResourceURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return result
diff --git a/openstack/identity/v3/endpoints/requests.go b/openstack/identity/v3/endpoints/requests.go
index 2cf6b34..3e09b2a 100644
--- a/openstack/identity/v3/endpoints/requests.go
+++ b/openstack/identity/v3/endpoints/requests.go
@@ -1,7 +1,6 @@
package endpoints
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -112,11 +111,10 @@
reqBody.Endpoint.ServiceID = gophercloud.MaybeString(opts.ServiceID)
var result UpdateResult
- _, result.Err = perigee.Request("PATCH", endpointURL(client, endpointID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &result.Body,
- OkCodes: []int{200},
+ _, result.Err = client.Request("PATCH", endpointURL(client, endpointID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &result.Body,
+ OkCodes: []int{200},
})
return result
}
@@ -124,9 +122,8 @@
// Delete removes an endpoint from the service catalog.
func Delete(client *gophercloud.ServiceClient, endpointID string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", endpointURL(client, endpointID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = client.Request("DELETE", endpointURL(client, endpointID), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/identity/v3/services/requests.go b/openstack/identity/v3/services/requests.go
index a3534e5..c6820c7 100644
--- a/openstack/identity/v3/services/requests.go
+++ b/openstack/identity/v3/services/requests.go
@@ -1,7 +1,6 @@
package services
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -52,10 +51,9 @@
// Get returns additional information about a service, given its ID.
func Get(client *gophercloud.ServiceClient, serviceID string) GetResult {
var result GetResult
- _, result.Err = perigee.Request("GET", serviceURL(client, serviceID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- Results: &result.Body,
- OkCodes: []int{200},
+ _, result.Err = client.Request("GET", serviceURL(client, serviceID), gophercloud.RequestOpts{
+ JSONResponse: &result.Body,
+ OkCodes: []int{200},
})
return result
}
@@ -69,11 +67,10 @@
req := request{Type: serviceType}
var result UpdateResult
- _, result.Err = perigee.Request("PATCH", serviceURL(client, serviceID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &req,
- Results: &result.Body,
- OkCodes: []int{200},
+ _, result.Err = client.Request("PATCH", serviceURL(client, serviceID), gophercloud.RequestOpts{
+ JSONBody: &req,
+ JSONResponse: &result.Body,
+ OkCodes: []int{200},
})
return result
}
@@ -82,9 +79,8 @@
// It either deletes all associated endpoints, or fails until all endpoints are deleted.
func Delete(client *gophercloud.ServiceClient, serviceID string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", serviceURL(client, serviceID), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = client.Request("DELETE", serviceURL(client, serviceID), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/networking/v2/extensions/layer3/floatingips/requests.go b/openstack/networking/v2/extensions/layer3/floatingips/requests.go
index eb09e10..46f2b22 100644
--- a/openstack/networking/v2/extensions/layer3/floatingips/requests.go
+++ b/openstack/networking/v2/extensions/layer3/floatingips/requests.go
@@ -3,7 +3,6 @@
import (
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -121,10 +120,9 @@
// Get retrieves a particular floating IP resource based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) 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
}
@@ -161,11 +159,10 @@
// Send request to API
var res UpdateResult
- _, res.Err = perigee.Request("PUT", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("PUT", resourceURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -176,9 +173,8 @@
// internal ports.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", resourceURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/networking/v2/extensions/layer3/routers/requests.go b/openstack/networking/v2/extensions/layer3/routers/requests.go
index 6557b62..12640de 100755
--- a/openstack/networking/v2/extensions/layer3/routers/requests.go
+++ b/openstack/networking/v2/extensions/layer3/routers/requests.go
@@ -3,7 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -93,10 +92,9 @@
// Get retrieves a particular router based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) 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
}
@@ -135,11 +133,10 @@
// Send request to API
var res UpdateResult
- _, res.Err = perigee.Request("PUT", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("PUT", resourceURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -148,9 +145,8 @@
// Delete will permanently delete a particular router based on its unique ID.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", resourceURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
@@ -201,11 +197,10 @@
body := request{SubnetID: opts.SubnetID, PortID: opts.PortID}
- _, res.Err = perigee.Request("PUT", addInterfaceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &body,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("PUT", addInterfaceURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &body,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
@@ -234,11 +229,10 @@
body := request{SubnetID: opts.SubnetID, PortID: opts.PortID}
- _, res.Err = perigee.Request("PUT", removeInterfaceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &body,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("PUT", removeInterfaceURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &body,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
diff --git a/openstack/networking/v2/extensions/lbaas/members/requests.go b/openstack/networking/v2/extensions/lbaas/members/requests.go
index 86c49c3..023a04d 100644
--- a/openstack/networking/v2/extensions/lbaas/members/requests.go
+++ b/openstack/networking/v2/extensions/lbaas/members/requests.go
@@ -1,7 +1,6 @@
package members
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -91,10 +90,9 @@
// Get retrieves a particular pool member based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) 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
}
@@ -118,11 +116,10 @@
// Send request to API
var res UpdateResult
- _, res.Err = perigee.Request("PUT", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("PUT", resourceURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -130,9 +127,8 @@
// Delete will permanently delete a particular member based on its unique ID.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", resourceURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/networking/v2/extensions/lbaas/monitors/requests.go b/openstack/networking/v2/extensions/lbaas/monitors/requests.go
index a3795ff..de6f688 100644
--- a/openstack/networking/v2/extensions/lbaas/monitors/requests.go
+++ b/openstack/networking/v2/extensions/lbaas/monitors/requests.go
@@ -3,7 +3,6 @@
import (
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -189,10 +188,9 @@
// Get retrieves a particular health monitor based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) 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
}
@@ -260,11 +258,10 @@
AdminStateUp: opts.AdminStateUp,
}}
- _, res.Err = perigee.Request("PUT", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200, 202},
+ _, res.Err = c.Request("PUT", resourceURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200, 202},
})
return res
@@ -273,9 +270,8 @@
// Delete will permanently delete a particular monitor based on its unique ID.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", resourceURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/networking/v2/extensions/lbaas/pools/requests.go b/openstack/networking/v2/extensions/lbaas/pools/requests.go
index b3ffc65..e7e6d94 100644
--- a/openstack/networking/v2/extensions/lbaas/pools/requests.go
+++ b/openstack/networking/v2/extensions/lbaas/pools/requests.go
@@ -1,7 +1,6 @@
package pools
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -111,10 +110,9 @@
// Get retrieves a particular pool based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) 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
}
@@ -147,11 +145,10 @@
// Send request to API
var res UpdateResult
- _, res.Err = perigee.Request("PUT", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("PUT", resourceURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -159,9 +156,8 @@
// Delete will permanently delete a particular pool based on its unique ID.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", resourceURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
@@ -182,11 +178,10 @@
reqBody := request{hm{ID: monitorID}}
var res AssociateResult
- _, res.Err = perigee.Request("POST", associateURL(c, poolID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{201},
+ _, res.Err = c.Request("POST", associateURL(c, poolID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{201},
})
return res
}
@@ -196,9 +191,8 @@
// check for the health of the members of the pool.
func DisassociateMonitor(c *gophercloud.ServiceClient, poolID, monitorID string) AssociateResult {
var res AssociateResult
- _, res.Err = perigee.Request("DELETE", disassociateURL(c, poolID, monitorID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", disassociateURL(c, poolID, monitorID), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/networking/v2/extensions/lbaas/vips/requests.go b/openstack/networking/v2/extensions/lbaas/vips/requests.go
index 95e444a..5b0bfd9 100644
--- a/openstack/networking/v2/extensions/lbaas/vips/requests.go
+++ b/openstack/networking/v2/extensions/lbaas/vips/requests.go
@@ -3,7 +3,6 @@
import (
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -191,10 +190,9 @@
// Get retrieves a particular virtual IP based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) 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
}
@@ -251,11 +249,10 @@
}
var res UpdateResult
- _, res.Err = perigee.Request("PUT", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200, 202},
+ _, res.Err = c.Request("PUT", resourceURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200, 202},
})
return res
@@ -264,9 +261,8 @@
// Delete will permanently delete a particular virtual IP based on its unique ID.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", resourceURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/networking/v2/extensions/security/groups/requests.go b/openstack/networking/v2/extensions/security/groups/requests.go
index defe80f..c07508b 100644
--- a/openstack/networking/v2/extensions/security/groups/requests.go
+++ b/openstack/networking/v2/extensions/security/groups/requests.go
@@ -3,7 +3,6 @@
import (
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -87,10 +86,9 @@
// Get retrieves a particular security group based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) 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
}
@@ -98,9 +96,8 @@
// Delete will permanently delete a particular security group based on its unique ID.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", resourceURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/networking/v2/extensions/security/rules/requests.go b/openstack/networking/v2/extensions/security/rules/requests.go
index 497bc21..108acf6 100644
--- a/openstack/networking/v2/extensions/security/rules/requests.go
+++ b/openstack/networking/v2/extensions/security/rules/requests.go
@@ -3,7 +3,6 @@
import (
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -163,10 +162,9 @@
// Get retrieves a particular security group based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) 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
}
@@ -174,9 +172,8 @@
// Delete will permanently delete a particular security group based on its unique ID.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", resourceURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", resourceURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/networking/v2/networks/requests.go b/openstack/networking/v2/networks/requests.go
index 672e464..b0db67e 100644
--- a/openstack/networking/v2/networks/requests.go
+++ b/openstack/networking/v2/networks/requests.go
@@ -3,8 +3,6 @@
import (
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
-
- "github.com/racker/perigee"
)
// AdminState gives users a solid type to work with for create and update
@@ -81,10 +79,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
}
@@ -187,11 +184,10 @@
}
// Send request to API
- _, res.Err = perigee.Request("PUT", updateURL(c, networkID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200, 201},
+ _, res.Err = c.Request("PUT", updateURL(c, networkID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200, 201},
})
return res
@@ -200,9 +196,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/openstack/networking/v2/ports/requests.go b/openstack/networking/v2/ports/requests.go
index 18bb426..01d550f 100644
--- a/openstack/networking/v2/ports/requests.go
+++ b/openstack/networking/v2/ports/requests.go
@@ -3,8 +3,6 @@
import (
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
-
- "github.com/racker/perigee"
)
// AdminState gives users a solid type to work with for create and update
@@ -81,10 +79,9 @@
// Get retrieves a specific port 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
}
@@ -223,11 +220,10 @@
return res
}
- _, res.Err = perigee.Request("PUT", updateURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200, 201},
+ _, res.Err = c.Request("PUT", updateURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200, 201},
})
return res
}
@@ -235,9 +231,8 @@
// Delete accepts a unique ID and deletes the port associated with it.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", deleteURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/networking/v2/subnets/requests.go b/openstack/networking/v2/subnets/requests.go
index 3853b70..63ac290 100644
--- a/openstack/networking/v2/subnets/requests.go
+++ b/openstack/networking/v2/subnets/requests.go
@@ -3,8 +3,6 @@
import (
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
-
- "github.com/racker/perigee"
)
// AdminState gives users a solid type to work with for create and update
@@ -80,10 +78,9 @@
// Get retrieves a specific subnet 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
}
@@ -232,11 +229,10 @@
return res
}
- _, res.Err = perigee.Request("PUT", updateURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200, 201},
+ _, res.Err = c.Request("PUT", updateURL(c, id), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200, 201},
})
return res
@@ -245,9 +241,8 @@
// Delete accepts a unique ID and deletes the subnet associated with it.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(c, id), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", deleteURL(c, id), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
diff --git a/openstack/objectstorage/v1/containers/requests.go b/openstack/objectstorage/v1/containers/requests.go
index 9f3b2af..a29d7da 100644
--- a/openstack/objectstorage/v1/containers/requests.go
+++ b/openstack/objectstorage/v1/containers/requests.go
@@ -1,7 +1,6 @@
package containers
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -111,11 +110,11 @@
}
}
- resp, err := perigee.Request("PUT", createURL(c, containerName), perigee.Options{
+ resp, err := c.Request("PUT", createURL(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
}
@@ -123,9 +122,8 @@
// Delete is a function that deletes a container.
func Delete(c *gophercloud.ServiceClient, containerName string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(c, containerName), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{202, 204},
+ _, res.Err = c.Request("DELETE", deleteURL(c, containerName), gophercloud.RequestOpts{
+ OkCodes: []int{202, 204},
})
return res
}
@@ -180,11 +178,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
}
@@ -194,11 +192,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
}
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
}