pools

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2014 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LBMethodRoundRobin       = "ROUND_ROBIN"
	LBMethodLeastConnections = "LEAST_CONNECTIONS"

	ProtocolTCP   = "TCP"
	ProtocolHTTP  = "HTTP"
	ProtocolHTTPS = "HTTPS"
)

Supported attributes for create/update operations.

Variables

This section is empty.

Functions

func List

List returns a Pager which allows you to iterate over a collection of pools. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Default policy settings return only those pools that are owned by the tenant who submits the request, unless an admin user submits the request.

Types

type AssociateResult

type AssociateResult struct {
	// contains filtered or unexported fields
}

AssociateResult represents the result of an association operation.

func AssociateMonitor

func AssociateMonitor(c *gophercloud.ServiceClient, poolID, monitorID string) AssociateResult

AssociateMonitor will associate a health monitor with a particular pool. Once associated, the health monitor will start monitoring the members of the pool and will deactivate these members if they are deemed unhealthy. A member can be deactivated (status set to INACTIVE) if any of health monitors finds it unhealthy.

func DisassociateMonitor

func DisassociateMonitor(c *gophercloud.ServiceClient, poolID, monitorID string) AssociateResult

DisassociateMonitor will disassociate a health monitor with a particular pool. When dissociation is successful, the health monitor will no longer check for the health of the members of the pool.

func (AssociateResult) Extract

func (r AssociateResult) Extract() (*Pool, error)

Extract is a function that accepts a result and extracts a router.

type CreateOpts

type CreateOpts struct {
	// Only required if the caller has an admin role and wants to create a pool
	// for another tenant.
	TenantID string

	// Required. Name of the pool.
	Name string

	// Required. The protocol used by the pool members, you can use either
	// ProtocolTCP, ProtocolHTTP, or ProtocolHTTPS.
	Protocol string

	// The network on which the members of the pool will be located. Only members
	// that are on this network can be added to the pool.
	SubnetID string

	// The algorithm used to distribute load between the members of the pool. The
	// current specification supports LBMethodRoundRobin and
	// LBMethodLeastConnections as valid values for this attribute.
	LBMethod string
}

CreateOpts contains all the values needed to create a new pool.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a create operation.

func Create

Create accepts a CreateOpts struct and uses the values to create a new load balancer pool.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Pool, error)

Extract is a function that accepts a result and extracts a router.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult represents the result of a delete operation.

func Delete

Delete will permanently delete a particular pool based on its unique ID.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation.

func Get

Get retrieves a particular pool based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Pool, error)

Extract is a function that accepts a result and extracts a router.

type ListOpts

type ListOpts struct {
	Status       string `q:"status"`
	LBMethod     string `q:"lb_method"`
	Protocol     string `q:"protocol"`
	SubnetID     string `q:"subnet_id"`
	TenantID     string `q:"tenant_id"`
	AdminStateUp *bool  `q:"admin_state_up"`
	Name         string `q:"name"`
	ID           string `q:"id"`
	VIPID        string `q:"vip_id"`
	Limit        int    `q:"limit"`
	Marker       string `q:"marker"`
	SortKey      string `q:"sort_key"`
	SortDir      string `q:"sort_dir"`
}

ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the floating IP attributes you want to see returned. SortKey allows you to sort by a particular network attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.

type Pool

type Pool struct {
	// The status of the pool. Indicates whether the pool is operational.
	Status string

	// The load-balancer algorithm, which is round-robin, least-connections, and
	// so on. This value, which must be supported, is dependent on the provider.
	// Round-robin must be supported.
	LBMethod string `json:"lb_method" mapstructure:"lb_method"`

	// The protocol of the pool, which is TCP, HTTP, or HTTPS.
	Protocol string

	// Description for the pool.
	Description string

	// The IDs of associated monitors which check the health of the pool members.
	MonitorIDs []string `json:"health_monitors" mapstructure:"health_monitors"`

	// The network on which the members of the pool will be located. Only members
	// that are on this network can be added to the pool.
	SubnetID string `json:"subnet_id" mapstructure:"subnet_id"`

	// Owner of the pool. Only an administrative user can specify a tenant ID
	// other than its own.
	TenantID string `json:"tenant_id" mapstructure:"tenant_id"`

	// The administrative state of the pool, which is up (true) or down (false).
	AdminStateUp bool `json:"admin_state_up" mapstructure:"admin_state_up"`

	// Pool name. Does not have to be unique.
	Name string

	// List of member IDs that belong to the pool.
	MemberIDs []string `json:"members" mapstructure:"members"`

	// The unique ID for the pool.
	ID string

	// The ID of the virtual IP associated with this pool
	VIPID string `json:"vip_id" mapstructure:"vip_id"`

	// The provider
	Provider string
}

Pool represents a logical set of devices, such as web servers, that you group together to receive and process traffic. The load balancing function chooses a member of the pool according to the configured load balancing method to handle the new requests or connections received on the VIP address. There is only one pool per virtual IP.

func ExtractPools

func ExtractPools(page pagination.Page) ([]Pool, error)

ExtractPools accepts a Page struct, specifically a RouterPage struct, and extracts the elements into a slice of Router structs. In other words, a generic collection is mapped into a relevant slice.

type PoolPage

type PoolPage struct {
	pagination.LinkedPageBase
}

PoolPage is the page returned by a pager when traversing over a collection of pools.

func (PoolPage) IsEmpty

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

IsEmpty checks whether a PoolPage struct is empty.

func (PoolPage) NextPageURL

func (p PoolPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of pools has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type UpdateOpts

type UpdateOpts struct {
	// Required. Name of the pool.
	Name string

	// The algorithm used to distribute load between the members of the pool. The
	// current specification supports LBMethodRoundRobin and
	// LBMethodLeastConnections as valid values for this attribute.
	LBMethod string
}

UpdateOpts contains the values used when updating a pool.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of an update operation.

func Update

Update allows pools to be updated.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Pool, error)

Extract is a function that accepts a result and extracts a router.

Jump to

Keyboard shortcuts

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