pools

package
v0.0.0-...-2804b72 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

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

	ProtocolTCP   LBProtocol = "TCP"
	ProtocolHTTP  LBProtocol = "HTTP"
	ProtocolHTTPS LBProtocol = "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) (r 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) (r 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 {
	// Name of the pool.
	Name string `json:"name" required:"true"`
	// The protocol used by the pool members, you can use either
	// ProtocolTCP, ProtocolHTTP, or ProtocolHTTPS.
	Protocol LBProtocol `json:"protocol" required:"true"`
	// Only required if the caller has an admin role and wants to create a pool
	// for another tenant.
	TenantID string `json:"tenant_id,omitempty"`
	// 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,omitempty"`
	// 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 LBMethod `json:"lb_method" required:"true"`

	// The provider of the pool
	Provider string `json:"provider,omitempty"`
}

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

func (CreateOpts) ToLBPoolCreateMap

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

ToLBPoolCreateMap allows CreateOpts to satisfy the CreateOptsBuilder interface

type CreateOptsBuilder

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

CreateOptsBuilder is the interface types must satisfy to be used as options for the Create function

type CreateResult

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

CreateResult represents the result of a create operation.

func Create

Create accepts a CreateOptsBuilder 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

func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult)

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

func Get(c *gophercloud.ServiceClient, id string) (r GetResult)

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 LBMethod

type LBMethod string

LBMethod is a type used for possible load balancing methods

type LBProtocol

type LBProtocol string

LBProtocol is a type used for possible load balancing protocols

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"`

	// 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"`

	// 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"`

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

	// The administrative state of the pool, which is up (true) or down (false).
	AdminStateUp bool `json:"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"`

	// The unique ID for the pool.
	ID string

	// The ID of the virtual IP associated with this pool
	VIPID string `json:"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(r 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 (r PoolPage) IsEmpty() (bool, error)

IsEmpty checks whether a PoolPage struct is empty.

func (PoolPage) NextPageURL

func (r 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 {
	// Name of the pool.
	Name string `json:"name,omitempty"`
	// 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 LBMethod `json:"lb_method,omitempty"`
}

UpdateOpts contains the values used when updating a pool.

func (UpdateOpts) ToLBPoolUpdateMap

func (opts UpdateOpts) ToLBPoolUpdateMap() (map[string]interface{}, error)

ToLBPoolUpdateMap allows UpdateOpts to satisfy the UpdateOptsBuilder interface

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToLBPoolUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder is the interface types must satisfy to be used as options for the Update function

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.

Directories

Path Synopsis
networking_extensions_lbaas_pools_v2
networking_extensions_lbaas_pools_v2

Jump to

Keyboard shortcuts

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