Start work on backups :monkey:
diff --git a/rackspace/db/v1/backups/results.go b/rackspace/db/v1/backups/results.go
new file mode 100644
index 0000000..16a3e66
--- /dev/null
+++ b/rackspace/db/v1/backups/results.go
@@ -0,0 +1,73 @@
+package backups
+
+import (
+ "github.com/mitchellh/mapstructure"
+ "github.com/rackspace/gophercloud"
+ "github.com/rackspace/gophercloud/pagination"
+)
+
+type Backup struct {
+ Description string
+ ID string
+ InstanceID string `json:"instance_id" mapstructure:"instance_id"`
+ LocationRef string
+ Name string
+ ParentID string `json:"parent_id" mapstructure:"parent_id"`
+ Size float64
+ Status string
+ Created string
+ Updated string
+}
+
+type CreateResult struct {
+ commonResult
+}
+
+type GetResult struct {
+ commonResult
+}
+
+type commonResult struct {
+ gophercloud.Result
+}
+
+func (r commonResult) Extract() (*Backup, error) {
+ if r.Err != nil {
+ return nil, r.Err
+ }
+
+ var response struct {
+ Backup Backup `mapstructure:"backup"`
+ }
+
+ err := mapstructure.Decode(r.Body, &response)
+ return &response.Backup, err
+}
+
+type DeleteResult struct {
+ gophercloud.ErrResult
+}
+
+type BackupPage struct {
+ pagination.SinglePageBase
+}
+
+// IsEmpty checks whether an BackupPage struct is empty.
+func (r BackupPage) IsEmpty() (bool, error) {
+ is, err := ExtractBackups(r)
+ if err != nil {
+ return true, err
+ }
+ return len(is) == 0, nil
+}
+
+func ExtractBackups(page pagination.Page) ([]Backup, error) {
+ casted := page.(BackupPage).Body
+
+ var resp struct {
+ Backups []Backup `mapstructure:"backups" json:"backups"`
+ }
+
+ err := mapstructure.Decode(casted, &resp)
+ return resp.Backups, err
+}