Validating batch delete slices
diff --git a/rackspace/lb/v1/nodes/requests.go b/rackspace/lb/v1/nodes/requests.go
index abf7037..a1524dc 100644
--- a/rackspace/lb/v1/nodes/requests.go
+++ b/rackspace/lb/v1/nodes/requests.go
@@ -1,6 +1,7 @@
package nodes
import (
+ "errors"
"fmt"
"strconv"
@@ -94,6 +95,11 @@
func BulkDelete(c *gophercloud.ServiceClient, loadBalancerID int, nodeIDs []int) DeleteResult {
var res DeleteResult
+ if len(nodeIDs) > 10 || len(nodeIDs) == 0 {
+ res.Err = errors.New("You must provide a minimum of 1 and a maximum of 10 node IDs")
+ return res
+ }
+
url := rootURL(c, loadBalancerID)
for k, v := range nodeIDs {
if k == 0 {