acl

package
v0.4.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2015 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package acl provides information and interaction with the access lists feature of the Rackspace Cloud Load Balancer service.

The access list management feature allows fine-grained network access controls to be applied to the load balancer's virtual IP address. A single IP address, multiple IP addresses, or entire network subnets can be added. Items that are configured with the ALLOW type always takes precedence over items with the DENY type. To reject traffic from all items except for those with the ALLOW type, add a networkItem with an address of "0.0.0.0/0" and a DENY type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *gophercloud.ServiceClient, lbID int) pagination.Pager

List is the operation responsible for returning a paginated collection of network items that define a load balancer's access list.

Types

type AccessList

type AccessList []NetworkItem

AccessList represents the rules of network access to a particular load balancer.

func ExtractAccessList

func ExtractAccessList(page pagination.Page) (AccessList, error)

ExtractAccessList accepts a Page struct, specifically an AccessListPage struct, and extracts the elements into a slice of NetworkItem structs. In other words, a generic collection is mapped into a relevant slice.

type AccessListPage

type AccessListPage struct {
	pagination.SinglePageBase
}

AccessListPage is the page returned by a pager for traversing over a collection of network items in an access list.

func (AccessListPage) IsEmpty

func (p AccessListPage) IsEmpty() (bool, error)

IsEmpty checks whether an AccessListPage struct is empty.

type CreateOpt

type CreateOpt struct {
	// Required - the IP address or CIDR for item to add to access list.
	Address string

	// Required - the type of the node. Either ALLOW or DENY.
	Type Type
}

CreateOpt represents the options to create a single node.

type CreateOpts

type CreateOpts []CreateOpt

CreateOpts is a slice of CreateOpt structs, that allow the user to create multiple nodes in a single operation (one node per CreateOpt).

func (CreateOpts) ToAccessListCreateMap

func (opts CreateOpts) ToAccessListCreateMap() (map[string]interface{}, error)

ToAccessListCreateMap converts a slice of options into a map that can be used for the JSON.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToAccessListCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder is the interface responsible for generating the JSON for a Create operation.

type CreateResult

type CreateResult struct {
	gophercloud.ErrResult
}

CreateResult represents the result of a create operation.

func Create

func Create(client *gophercloud.ServiceClient, loadBalancerID int, opts CreateOptsBuilder) CreateResult

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.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult represents the result of a delete operation.

func BulkDelete

func BulkDelete(c *gophercloud.ServiceClient, loadBalancerID int, itemIDs []int) DeleteResult

BulkDelete will delete multiple network items from a load balancer's access list in a single operation.

func Delete

func Delete(c *gophercloud.ServiceClient, lbID, itemID int) DeleteResult

Delete will remove a single network item from a load balancer's access list.

func DeleteAll

func DeleteAll(c *gophercloud.ServiceClient, lbID int) DeleteResult

DeleteAll will delete the entire contents of a load balancer's access list, effectively resetting it and allowing all traffic.

type NetworkItem

type NetworkItem struct {
	// The IP address or subnet (CIDR) that defines the network item.
	Address string

	// The numeric unique ID for this item.
	ID int

	// Either ALLOW or DENY.
	Type Type
}

NetworkItem describes how an IP address or entire subnet may interact with a load balancer.

type Type

type Type string

Type defines how an item may connect to the load balancer.

const (
	ALLOW Type = "ALLOW"
	DENY  Type = "DENY"
)

Convenience consts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL