func updateNode(t *testing.T, client *gophercloud.ServiceClient, lbID int, nodeID int) { opts := nodes.UpdateOpts{ Weight: gophercloud.IntToPointer(10), Condition: nodes.DRAINING, Type: nodes.SECONDARY, } err := nodes.Update(client, lbID, nodeID, opts).ExtractErr() th.AssertNoErr(t, err) t.Logf("Updated node %d", nodeID) waitForLB(client, lbID, lbs.ACTIVE) }
func TestUpdate(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() mockUpdateResponse(t, lbID, nodeID) opts := UpdateOpts{ Weight: gophercloud.IntToPointer(10), Condition: DRAINING, Type: SECONDARY, } err := Update(client.ServiceClient(), lbID, nodeID, opts).ExtractErr() th.AssertNoErr(t, err) }