Clarify which statuses are reached at which points.
diff --git a/openstack/compute/v2/servers/requests.go b/openstack/compute/v2/servers/requests.go
index 9e65817..da93ff1 100644
--- a/openstack/compute/v2/servers/requests.go
+++ b/openstack/compute/v2/servers/requests.go
@@ -49,7 +49,7 @@
return p
}
- return pagination.NewPager(client, getListURL(client), createPage)
+ return pagination.NewPager(client, getDetailURL(client), createPage)
}
// Create requests a server to be provisioned to the user in the current tenant.
@@ -100,12 +100,16 @@
// ChangeAdminPassword alters the administrator or root password for a specified server.
func ChangeAdminPassword(client *gophercloud.ServiceClient, id, newPassword string) error {
+ var req struct {
+ ChangePassword struct {
+ AdminPass string `json:"adminPass"`
+ } `json:"changePassword"`
+ }
+
+ req.ChangePassword.AdminPass = newPassword
+
_, err := perigee.Request("POST", getActionURL(client, id), perigee.Options{
- ReqBody: struct {
- C map[string]string `json:"changePassword"`
- }{
- map[string]string{"adminPass": newPassword},
- },
+ ReqBody: req,
MoreHeaders: client.Provider.AuthenticatedHeaders(),
OkCodes: []int{202},
})
diff --git a/openstack/compute/v2/servers/urls.go b/openstack/compute/v2/servers/urls.go
index 3440de1..7cfda39 100644
--- a/openstack/compute/v2/servers/urls.go
+++ b/openstack/compute/v2/servers/urls.go
@@ -3,11 +3,11 @@
import "github.com/rackspace/gophercloud"
func getListURL(client *gophercloud.ServiceClient) string {
- return client.ServiceURL("servers", "detail")
+ return client.ServiceURL("servers")
}
-func getCreateURL(client *gophercloud.ServiceClient) string {
- return client.ServiceURL("servers")
+func getDetailURL(client *gophercloud.ServiceClient) string {
+ return client.ServiceURL("servers", "detail")
}
func getServerURL(client *gophercloud.ServiceClient, id string) string {