Rename Result.Resp to Result.Body.
diff --git a/openstack/blockstorage/v1/snapshots/requests.go b/openstack/blockstorage/v1/snapshots/requests.go
index 7fac925..792e7dd 100644
--- a/openstack/blockstorage/v1/snapshots/requests.go
+++ b/openstack/blockstorage/v1/snapshots/requests.go
@@ -73,7 +73,7 @@
MoreHeaders: client.Provider.AuthenticatedHeaders(),
OkCodes: []int{200, 201},
ReqBody: &reqBody,
- Results: &res.Resp,
+ Results: &res.Body,
})
return res
}
@@ -92,7 +92,7 @@
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
_, res.Err = perigee.Request("GET", getURL(client, id), perigee.Options{
- Results: &res.Resp,
+ Results: &res.Body,
MoreHeaders: client.Provider.AuthenticatedHeaders(),
OkCodes: []int{200},
})
@@ -181,7 +181,7 @@
MoreHeaders: client.Provider.AuthenticatedHeaders(),
OkCodes: []int{200},
ReqBody: &reqBody,
- Results: &res.Resp,
+ Results: &res.Body,
})
return res
}
diff --git a/openstack/blockstorage/v1/snapshots/results.go b/openstack/blockstorage/v1/snapshots/results.go
index c5c3470..d414a7d 100644
--- a/openstack/blockstorage/v1/snapshots/results.go
+++ b/openstack/blockstorage/v1/snapshots/results.go
@@ -11,28 +11,40 @@
type Snapshot struct {
// Currect status of the Snapshot.
Status string `mapstructure:"status"`
+
// Display name.
Name string `mapstructure:"display_name"`
+
// Instances onto which the Snapshot is attached.
Attachments []string `mapstructure:"attachments"`
+
// Logical group.
AvailabilityZone string `mapstructure:"availability_zone"`
+
// Is the Snapshot bootable?
Bootable string `mapstructure:"bootable"`
+
// Date created.
CreatedAt string `mapstructure:"created_at"`
+
// Display description.
Description string `mapstructure:"display_discription"`
+
// See VolumeType object for more information.
VolumeType string `mapstructure:"volume_type"`
+
// ID of the Snapshot from which this Snapshot was created.
SnapshotID string `mapstructure:"snapshot_id"`
+
// ID of the Volume from which this Snapshot was created.
VolumeID string `mapstructure:"volume_id"`
+
// User-defined key-value pairs.
Metadata map[string]string `mapstructure:"metadata"`
+
// Unique identifier.
ID string `mapstructure:"id"`
+
// Size of the Snapshot, in GB.
Size int `mapstructure:"size"`
}
@@ -82,9 +94,8 @@
return nil, r.Err
}
- m := r.Resp["metadata"].(map[string]interface{})
-
- return m, nil
+ m := r.Body.(map[string]interface{})["metadata"]
+ return m.(map[string]interface{}), nil
}
type commonResult struct {
@@ -101,7 +112,7 @@
Snapshot *Snapshot `json:"snapshot"`
}
- err := mapstructure.Decode(r.Resp, &res)
+ err := mapstructure.Decode(r.Body, &res)
return res.Snapshot, err
}