Fixes to nodes
diff --git a/rackspace/lb/v1/nodes/fixtures.go b/rackspace/lb/v1/nodes/fixtures.go
index d5eed13..1eda271 100644
--- a/rackspace/lb/v1/nodes/fixtures.go
+++ b/rackspace/lb/v1/nodes/fixtures.go
@@ -175,8 +175,8 @@
})
}
-func mockListEventsResponse(t *testing.T, lbID, nodeID int) {
- th.Mux.HandleFunc(_nodeURL(lbID, nodeID)+"/events", func(w http.ResponseWriter, r *http.Request) {
+func mockListEventsResponse(t *testing.T, lbID int) {
+ th.Mux.HandleFunc(_rootURL(lbID)+"/events", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "GET")
th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
diff --git a/rackspace/lb/v1/nodes/requests.go b/rackspace/lb/v1/nodes/requests.go
index 28c6bf2..026ecd8 100644
--- a/rackspace/lb/v1/nodes/requests.go
+++ b/rackspace/lb/v1/nodes/requests.go
@@ -118,7 +118,7 @@
MoreHeaders: client.AuthenticatedHeaders(),
ReqBody: &reqBody,
Results: &res.Body,
- OkCodes: []int{200},
+ OkCodes: []int{202},
})
if err != nil {
res.Err = err
@@ -245,7 +245,7 @@
var res DeleteResult
_, res.Err = perigee.Request("DELETE", resourceURL(c, lbID, nodeID), perigee.Options{
MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ OkCodes: []int{202},
})
return res
}
@@ -276,8 +276,8 @@
// associated with the activity between the node and the load balancer. The
// events report errors found with the node. The detailedMessage provides the
// detailed reason for the error.
-func ListEvents(client *gophercloud.ServiceClient, loadBalancerID, nodeID int, opts ListEventsOptsBuilder) pagination.Pager {
- url := eventsURL(client, loadBalancerID, nodeID)
+func ListEvents(client *gophercloud.ServiceClient, loadBalancerID int, opts ListEventsOptsBuilder) pagination.Pager {
+ url := eventsURL(client, loadBalancerID)
if opts != nil {
query, err := opts.ToEventsListQuery()
diff --git a/rackspace/lb/v1/nodes/requests_test.go b/rackspace/lb/v1/nodes/requests_test.go
index 03f4b20..7eabd29 100644
--- a/rackspace/lb/v1/nodes/requests_test.go
+++ b/rackspace/lb/v1/nodes/requests_test.go
@@ -172,11 +172,11 @@
th.SetupHTTP()
defer th.TeardownHTTP()
- mockListEventsResponse(t, lbID, nodeID)
+ mockListEventsResponse(t, lbID)
count := 0
- pager := ListEvents(client.ServiceClient(), lbID, nodeID, ListEventsOpts{})
+ pager := ListEvents(client.ServiceClient(), lbID, ListEventsOpts{})
err := pager.EachPage(func(page pagination.Page) (bool, error) {
count++
diff --git a/rackspace/lb/v1/nodes/urls.go b/rackspace/lb/v1/nodes/urls.go
index 69444c8..2cefee2 100644
--- a/rackspace/lb/v1/nodes/urls.go
+++ b/rackspace/lb/v1/nodes/urls.go
@@ -20,6 +20,6 @@
return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath)
}
-func eventsURL(c *gophercloud.ServiceClient, lbID, nodeID int) string {
- return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath, strconv.Itoa(nodeID), eventPath)
+func eventsURL(c *gophercloud.ServiceClient, lbID int) string {
+ return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath, eventPath)
}