Delete single network item from access list
diff --git a/rackspace/lb/v1/acl/requests.go b/rackspace/lb/v1/acl/requests.go
index 206ec48..90cd7f3 100644
--- a/rackspace/lb/v1/acl/requests.go
+++ b/rackspace/lb/v1/acl/requests.go
@@ -99,3 +99,12 @@
return res
}
+
+func Delete(c *gophercloud.ServiceClient, lbID, itemID int) DeleteResult {
+ var res DeleteResult
+ _, res.Err = perigee.Request("DELETE", resourceURL(c, lbID, itemID), perigee.Options{
+ MoreHeaders: c.AuthenticatedHeaders(),
+ OkCodes: []int{200},
+ })
+ return res
+}
diff --git a/rackspace/lb/v1/acl/requests_test.go b/rackspace/lb/v1/acl/requests_test.go
index 67fb2f1..785acde 100644
--- a/rackspace/lb/v1/acl/requests_test.go
+++ b/rackspace/lb/v1/acl/requests_test.go
@@ -9,9 +9,9 @@
)
const (
- lbID = 12345
- niID1 = 67890
- niID2 = 67891
+ lbID = 12345
+ itemID1 = 67890
+ itemID2 = 67891
)
func TestList(t *testing.T) {
@@ -62,10 +62,20 @@
th.SetupHTTP()
defer th.TeardownHTTP()
- ids := []int{niID1, niID2}
+ ids := []int{itemID1, itemID2}
mockBatchDeleteResponse(t, lbID, ids)
err := BulkDelete(client.ServiceClient(), lbID, ids).ExtractErr()
th.AssertNoErr(t, err)
}
+
+func TestDelete(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ mockDeleteResponse(t, lbID, itemID1)
+
+ err := Delete(client.ServiceClient(), lbID, itemID1).ExtractErr()
+ th.AssertNoErr(t, err)
+}