Adjust regexps and do another pass.
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
}