pools

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

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 CreateOpts

type CreateOpts struct {
	// The algorithm used to distribute load between the members of the pool.
	LBMethod string `json:"lb_algorithm" required:"true"`

	// The protocol used by the pool members, you can use either
	// ProtocolTCP, ProtocolHTTP, or ProtocolHTTPS.
	Protocol string `json:"protocol" required:"true"`

	// The Loadbalancer on which the members of the pool will be associated with.
	// Note: one of LoadbalancerID or ListenerID must be provided.
	LoadbalancerID string `json:"loadbalancer_id,omitempty"`

	// The Listener on which the members of the pool will be associated with.
	// Note: one of LoadbalancerID or ListenerID must be provided.
	ListenerID string `json:"listener_id,omitempty"`

	// ProjectID is the UUID of the project who owns the Pool.
	// Only administrative users can specify a project UUID other than their own.
	ProjectID string `json:"project_id,omitempty"`

	// Name of the pool.
	Name string `json:"name,omitempty"`

	// Human-readable description for the pool.
	Description string `json:"description,omitempty"`

	// Persistence is the session persistence of the pool.
	// Omit this field to prevent session persistence.
	Persistence *SessionPersistence `json:"session_persistence,omitempty"`

	SlowStart *SlowStart `json:"slow_start,omitempty"`

	// The administrative state of the Pool. A valid value is true (UP)
	// or false (DOWN).
	AdminStateUp *bool `json:"admin_state_up,omitempty"`

	// Specifies whether to enable deletion protection for the pool.
	DeletionProtectionEnable *bool `json:"member_deletion_protection_enable,omitempty"`

	// Specifies the ID of the VPC where the backend server group works.
	VpcId string `json:"vpc_id,omitempty"`

	// Specifies the type of the backend server group.
	// Values:
	// instance: Any type of backend servers can be added. vpc_id is mandatory.
	// ip: Only cross-VPC backend servers can be added. vpc_id cannot be specified.
	// "": Any type of backend servers can be added.
	Type string `json:"type,omitempty"`
}

CreateOpts is the common options' struct used in this package's Create operation.

func (CreateOpts) ToPoolCreateMap

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

ToPoolCreateMap builds a request body from CreateOpts.

type CreateOptsBuilder

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

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult represents the result of a Create operation. Call its Extract method to interpret the result as a Pool.

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

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 pool.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a Delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(client *golangsdk.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. Call its Extract method to interpret the result as a Pool.

func Get

func Get(client *golangsdk.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 pool.

type ListOpts

type ListOpts struct {
	Description     []string `q:"description"`
	HealthMonitorID []string `q:"healthmonitor_id"`
	LBMethod        []string `q:"lb_algorithm"`
	Protocol        []string `q:"protocol"`
	AdminStateUp    *bool    `q:"admin_state_up"`
	Name            []string `q:"name"`
	ID              []string `q:"id"`
	LoadbalancerID  []string `q:"loadbalancer_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 Pool attributes you want to see returned. SortKey allows you to sort by a particular Pool attribute. SortDir sets the direction, and is either `asc` or `desc`. Marker and Limit are used for pagination.

func (ListOpts) ToPoolListQuery

func (opts ListOpts) ToPoolListQuery() (string, error)

ToPoolListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToPoolListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type Pool

type Pool struct {
	// 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_algorithm"`

	// The protocol of the Pool, which is TCP, HTTP, or HTTPS.
	Protocol string `json:"protocol"`

	// Description for the Pool.
	Description string `json:"description"`

	// A list of listeners objects IDs.
	Listeners []structs.ResourceRef `json:"listeners"`

	// A list of member objects IDs.
	Members []structs.ResourceRef `json:"members"`

	// The ID of associated health monitor.
	MonitorID string `json:"healthmonitor_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 `json:"name"`

	ProjectID string `json:"project_id"`

	// The unique ID for the Pool.
	ID string `json:"id"`

	// A list of load balancer objects IDs.
	Loadbalancers []structs.ResourceRef `json:"loadbalancers"`

	// Indicates whether connections in the same session will be processed by the
	// same Pool member or not.
	Persistence *SessionPersistence `json:"session_persistence"`

	IpVersion string `json:"ip_version"`

	SlowStart *SlowStart `json:"slow_start"`

	// Deletion protection for the pool.
	DeletionProtectionEnable bool `json:"member_deletion_protection_enable"`

	// ID of the VPC where the backend server group works.
	VpcId string `json:"vpc_id"`

	// Type of the backend server group.
	Type string `json:"type"`
}

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.

func ExtractPools

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

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

type PoolPage

type PoolPage struct {
	pagination.PageWithInfo
}

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.

type SessionPersistence

type SessionPersistence struct {
	// The type of persistence mode.
	Type string `json:"type" required:"true"`

	// Name of cookie if persistence mode is set appropriately.
	CookieName string `json:"cookie_name,omitempty"`

	// PersistenceTimeout specifies the stickiness duration, in minutes.
	PersistenceTimeout int `json:"persistence_timeout,omitempty"`
}

SessionPersistence represents the session persistence feature of the load balancing service. It attempts to force connections or requests in the same session to be processed by the same member as long as it is active. Three types of persistence are supported:

type SlowStart

type SlowStart struct {
	// Specifies whether to Enable slow start.
	Enable bool `json:"enable" required:"true"`

	// Specifies the slow start Duration, in seconds.
	Duration int `json:"duration" required:"true"`
}

type UpdateOpts

type UpdateOpts struct {
	// Name of the pool.
	Name *string `json:"name,omitempty"`

	// Human-readable description for the pool.
	Description *string `json:"description,omitempty"`

	// The algorithm used to distribute load between the members of the pool. The
	// current specification supports LBMethodRoundRobin, LBMethodLeastConnections
	// and LBMethodSourceIp as valid values for this attribute.
	LBMethod string `json:"lb_algorithm,omitempty"`

	// Specifies whether to enable sticky sessions.
	Persistence *SessionPersistence `json:"session_persistence,omitempty"`

	// The administrative state of the Pool. The value can only be updated to true.
	// This parameter is unsupported. Please do not use it.
	AdminStateUp *bool `json:"admin_state_up,omitempty"`

	// Specifies whether to enable slow start.
	// This parameter is unsupported. Please do not use it.
	SlowStart *SlowStart `json:"slow_start,omitempty"`

	// Specifies whether to enable deletion protection for the load balancer.
	DeletionProtectionEnable *bool `json:"member_deletion_protection_enable,omitempty"`

	// Specifies the ID of the VPC where the backend server group works.
	VpcId string `json:"vpc_id,omitempty"`

	// Specifies the type of the backend server group.
	// Values:
	// instance: Any type of backend servers can be added. vpc_id is mandatory.
	// ip: Only cross-VPC backend servers can be added. vpc_id cannot be specified.
	// "": Any type of backend servers can be added.
	Type string `json:"type,omitempty"`
}

UpdateOpts is the common options' struct used in this package's Update operation.

func (UpdateOpts) ToPoolUpdateMap

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

ToPoolUpdateMap builds a request body from UpdateOpts.

type UpdateOptsBuilder

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

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult represents the result of an Update operation. Call its Extract method to interpret the result as a Pool.

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

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 pool.

Jump to

Keyboard shortcuts

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