Touching up docs
diff --git a/rackspace/lb/v1/acl/requests.go b/rackspace/lb/v1/acl/requests.go
index 3974923..a87287e 100644
--- a/rackspace/lb/v1/acl/requests.go
+++ b/rackspace/lb/v1/acl/requests.go
@@ -63,6 +63,10 @@
return itemMap{"accessList": items}, nil
}
+// Create is the operation responsible for adding network items to the access
+// rules for a particular load balancer. If network items already exist, the
+// new item will be appended. A single IP address or subnet range is considered
+// unique, and cannot be duplicated.
func Create(client *gophercloud.ServiceClient, loadBalancerID int, opts CreateOptsBuilder) CreateResult {
var res CreateResult
@@ -81,6 +85,8 @@
return res
}
+// BulkDelete will delete multiple network items from a load balancer's access
+// list in a single operation.
func BulkDelete(c *gophercloud.ServiceClient, loadBalancerID int, itemIDs []int) DeleteResult {
var res DeleteResult
@@ -100,6 +106,7 @@
return res
}
+// Delete will remove a single network item from a load balancer's access list.
func Delete(c *gophercloud.ServiceClient, lbID, itemID int) DeleteResult {
var res DeleteResult
_, res.Err = perigee.Request("DELETE", resourceURL(c, lbID, itemID), perigee.Options{
@@ -109,6 +116,8 @@
return res
}
+// DeleteAll will delete the entire contents of a load balancer's access list,
+// effectively resetting it and allowing all traffic.
func DeleteAll(c *gophercloud.ServiceClient, lbID int) DeleteResult {
var res DeleteResult
_, res.Err = perigee.Request("DELETE", rootURL(c, lbID), perigee.Options{
diff --git a/rackspace/lb/v1/acl/results.go b/rackspace/lb/v1/acl/results.go
index ed87be7..815caa7 100644
--- a/rackspace/lb/v1/acl/results.go
+++ b/rackspace/lb/v1/acl/results.go
@@ -7,16 +7,27 @@
"github.com/rackspace/gophercloud/pagination"
)
+// AccessList represents the rules of network access to a particular load
+// balancer.
type AccessList []NetworkItem
+// NetworkItem describes how an IP address or entire subnet may interact with a
+// load balancer.
type NetworkItem struct {
+ // The IP address or subnet (CIDR) that defines the network item.
Address string
- ID int
- Type Type
+
+ // The numeric unique ID for this item.
+ ID int
+
+ // Either ALLOW or DENY.
+ Type Type
}
+// Type defines how an item may connect to the load balancer.
type Type string
+// Convenience consts.
const (
ALLOW Type = "ALLOW"
DENY Type = "DENY"
@@ -50,10 +61,12 @@
return resp.List, err
}
+// CreateResult represents the result of a create operation.
type CreateResult struct {
gophercloud.ErrResult
}
+// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
gophercloud.ErrResult
}