Validating batch delete slices
diff --git a/rackspace/lb/v1/lbs/requests.go b/rackspace/lb/v1/lbs/requests.go
index 98484e9..e4d9f86 100644
--- a/rackspace/lb/v1/lbs/requests.go
+++ b/rackspace/lb/v1/lbs/requests.go
@@ -8,6 +8,7 @@
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
+ "github.com/rackspace/gophercloud/rackspace/lb/v1/nodes"
)
// ListOptsBuilder allows extensions to add additional parameters to the
@@ -76,7 +77,7 @@
Name string
// Optional - nodes to be added.
- Nodes []Node
+ Nodes []nodes.Node
// Required - protocol of the service that is being load balanced.
Protocol Protocol
@@ -242,6 +243,11 @@
func BulkDelete(c *gophercloud.ServiceClient, ids []int) DeleteResult {
var res DeleteResult
+ if len(ids) > 10 || len(ids) == 0 {
+ res.Err = errors.New("You must provide a minimum of 1 and a maximum of 10 LB IDs")
+ return res
+ }
+
url := rootURL(c)
for k, v := range ids {
if k == 0 {