Rework locations of extracted structs
diff --git a/rackspace/db/v1/instances/requests.go b/rackspace/db/v1/instances/requests.go
index b4bade8..b311289 100644
--- a/rackspace/db/v1/instances/requests.go
+++ b/rackspace/db/v1/instances/requests.go
@@ -4,20 +4,18 @@
"github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
+ "github.com/rackspace/gophercloud/rackspace/db/v1/backups"
)
func GetDefaultConfig(client *gophercloud.ServiceClient, id string) ConfigResult {
var res ConfigResult
- resp, err := perigee.Request("GET", configURL(client, id), perigee.Options{
+ _, res.Err = perigee.Request("GET", configURL(client, id), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
Results: &res.Body,
OkCodes: []int{200},
})
- res.Header = resp.HttpResponse.Header
- res.Err = err
-
return res
}
@@ -28,18 +26,18 @@
var res UpdateResult
- resp, err := perigee.Request("PUT", resourceURL(client, instanceID), perigee.Options{
+ _, res.Err = perigee.Request("PUT", resourceURL(client, instanceID), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
ReqBody: map[string]map[string]string{"instance": reqBody},
OkCodes: []int{202},
})
- res.Header = resp.HttpResponse.Header
- res.Err = err
-
return res
}
func ListBackups(client *gophercloud.ServiceClient, instanceID string) pagination.Pager {
-
+ pageFn := func(r pagination.PageResult) pagination.Page {
+ return backups.BackupPage{pagination.SinglePageBase(r)}
+ }
+ return pagination.NewPager(client, backupsURL(client, instanceID), pageFn)
}