lbpools

package
v0.6.19 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create accepts a CreateOpts struct and creates a new lbpool using the values provided.

func CreateHealthMonitor added in v0.4.27

func CreateHealthMonitor(c *gcorecloud.ServiceClient, lbpoolID string, opts CreateHealthMonitorOptsBuilder) (r tasks.Result)

CreateHealthMonitor creates LB pool healthmonitor

func CreateMember

func CreateMember(c *gcorecloud.ServiceClient, lbpoolID string, opts CreateMemberOptsBuilder) (r tasks.Result)

CreateMember creates LB pool member

func Delete

func Delete(c *gcorecloud.ServiceClient, lbpoolID string) (r tasks.Result)

Delete accepts a unique ID and deletes the lbpool associated with it.

func DeleteMember

func DeleteMember(c *gcorecloud.ServiceClient, lbpoolID string, memberID string) (r tasks.Result)

DeleteMember accepts a unique pool and member ID and deletes pool member.

func ExtractHealthMonitorIDFromTask added in v0.4.27

func ExtractHealthMonitorIDFromTask(task *tasks.Task) (string, error)

func ExtractPoolIDFromTask

func ExtractPoolIDFromTask(task *tasks.Task) (string, error)

func ExtractPoolMemberIDFromTask

func ExtractPoolMemberIDFromTask(task *tasks.Task) (string, error)

func ExtractPoolsInto

func ExtractPoolsInto(r pagination.Page, v interface{}) error

func Update

func Update(c *gcorecloud.ServiceClient, lbpoolID string, opts UpdateOptsBuilder) (r tasks.Result)

Update accepts a UpdateOpts struct and updates an existing lbpool using the values provided. For more information, see the Create function.

Types

type CreateHealthMonitorOpts

type CreateHealthMonitorOpts struct {
	ID             string                  `json:"id,omitempty"`
	Type           types.HealthMonitorType `json:"type" required:"true"`
	Delay          int                     `json:"delay" required:"true"`
	MaxRetries     int                     `json:"max_retries" required:"true"`
	Timeout        int                     `json:"timeout" required:"true"`
	MaxRetriesDown int                     `json:"max_retries_down,omitempty"`
	HTTPMethod     *types.HTTPMethod       `json:"http_method,omitempty"`
	URLPath        string                  `json:"url_path,omitempty"`
	ExpectedCodes  string                  `json:"expected_codes,omitempty"`
}

CreateHealthMonitorOpts represents options used to create a lbpool health monitor.

func (CreateHealthMonitorOpts) ToHealthMonitorCreateMap added in v0.4.27

func (opts CreateHealthMonitorOpts) ToHealthMonitorCreateMap() (map[string]interface{}, error)

ToHealthMonitorCreateMap builds a request body from CreateHealthMonitorOpts.

type CreateHealthMonitorOptsBuilder added in v0.4.27

type CreateHealthMonitorOptsBuilder interface {
	ToHealthMonitorCreateMap() (map[string]interface{}, error)
}

CreateHealthMonitorOptsBuilder allows extensions to add parameters to the CreateHealthMonitor request.

type CreateMemberOptsBuilder

type CreateMemberOptsBuilder interface {
	ToLBPoolMemberCreateMap() (map[string]interface{}, error)
}

CreateMemberOptsBuilder allows extensions to add parameters to the CreateMember request.

type CreateOpts

type CreateOpts struct {
	Name                 string                        `json:"name" required:"true" validate:"required,name"`
	Protocol             types.ProtocolType            `json:"protocol" required:"true"`
	LBPoolAlgorithm      types.LoadBalancerAlgorithm   `json:"lb_algorithm" required:"true"`
	Members              []CreatePoolMemberOpts        `json:"members,omitempty"`
	LoadBalancerID       string                        `json:"loadbalancer_id,omitempty"`
	ListenerID           string                        `json:"listener_id,omitempty"`
	HealthMonitor        *CreateHealthMonitorOpts      `json:"healthmonitor,omitempty"`
	SessionPersistence   *CreateSessionPersistenceOpts `json:"session_persistence,omitempty"`
	TimeoutClientData    int                           `json:"timeout_client_data"`
	TimeoutMemberData    int                           `json:"timeout_member_data"`
	TimeoutMemberConnect int                           `json:"timeout_member_connect"`
}

CreateOpts represents options used to create a lbpool.

func (CreateOpts) ToLBPoolCreateMap

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

ToLBPoolCreateMap builds a request body from CreateOpts.

type CreateOptsBuilder

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

CreateOptsBuilder allows extensions to add parameters to the Create request.

type CreatePoolMemberOpts

type CreatePoolMemberOpts struct {
	ID             string `json:"id,omitempty"`
	Address        net.IP `json:"address" required:"true"`
	ProtocolPort   int    `json:"protocol_port" required:"true"`
	Weight         int    `json:"weight,omitempty"`
	SubnetID       string `json:"subnet_id,omitempty"`
	InstanceID     string `json:"instance_id,omitempty"`
	MonitorAddress net.IP `json:"monitor_address,omitempty"`
	MonitorPort    *int   `json:"monitor_port,omitempty"`
}

CreatePoolMemberOpts represents options used to create a lbpool listener pool member.

func (CreatePoolMemberOpts) ToLBPoolMemberCreateMap

func (opts CreatePoolMemberOpts) ToLBPoolMemberCreateMap() (map[string]interface{}, error)

ToLBPoolMemberCreateMap builds a request body from CreatePoolMemberOpts.

type CreateResult

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

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

func (CreateResult) Extract

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

Extract is a function that accepts a result and extracts a pool resource.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

func (CreateResult) ExtractPoolMember

func (r CreateResult) ExtractPoolMember() (*PoolMember, error)

ExtractPoolMember is a function that accepts a result and extracts a pool member resource.

type CreateSessionPersistenceOpts

type CreateSessionPersistenceOpts struct {
	PersistenceGranularity string                `json:"persistence_granularity,omitempty"`
	PersistenceTimeout     int                   `json:"persistence_timeout,omitempty"`
	Type                   types.PersistenceType `json:"type" required:"true"`
	CookieName             string                `json:"cookie_name,omitempty"`
}

CreateSessionPersistenceOpts represents options used to create a lbpool listener pool session persistence rules.

type DeleteHealthMonitorResult added in v0.4.27

type DeleteHealthMonitorResult struct {
	gcorecloud.ErrResult
}

func DeleteHealthMonitor added in v0.4.27

func DeleteHealthMonitor(c *gcorecloud.ServiceClient, lbpoolID string) (r DeleteHealthMonitorResult)

DeleteHealthMonitor accepts a unique ID and deletes the lbpool's healthmonitor associated with it.

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Pool.

func Get

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

Get retrieves a specific lbpool 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 resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

func (GetResult) ExtractPoolMember

func (r GetResult) ExtractPoolMember() (*PoolMember, error)

ExtractPoolMember is a function that accepts a result and extracts a pool member resource.

type HealthMonitor

type HealthMonitor struct {
	ID             string                  `json:"id"`
	Type           types.HealthMonitorType `json:"type"`
	Delay          int                     `json:"delay"`
	MaxRetries     int                     `json:"max_retries"`
	Timeout        int                     `json:"timeout"`
	MaxRetriesDown int                     `json:"max_retries_down,omitempty"`
	HTTPMethod     *types.HTTPMethod       `json:"http_method,omitempty"`
	URLPath        string                  `json:"url_path,omitempty"`
	ExpectedCodes  string                  `json:"expected_codes,omitempty"`
}

HealthMonitor for LB pool

type HealthMonitorTaskResult added in v0.4.27

type HealthMonitorTaskResult struct {
	HealthMonitors []string `json:"healthmonitors"`
}

type ListOpts

type ListOpts struct {
	LoadBalancerID *string `q:"loadbalancer_id"`
	ListenerID     *string `q:"listener_id"`
	MemberDetails  *bool   `q:"details"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

func (ListOpts) ToLBPoolListQuery

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

ToListenerListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type Pool

type Pool struct {
	LoadBalancers         []gcorecloud.ItemID         `json:"loadbalancers"`
	Listeners             []gcorecloud.ItemID         `json:"listeners"`
	SessionPersistence    *SessionPersistence         `json:"session_persistence"`
	LoadBalancerAlgorithm types.LoadBalancerAlgorithm `json:"lb_algorithm"`
	Name                  string                      `json:"name"`
	ID                    string                      `json:"id"`
	Protocol              types.ProtocolType          `json:"protocol"`
	Members               []PoolMember                `json:"members"`
	HealthMonitor         *HealthMonitor              `json:"healthmonitor"`
	ProvisioningStatus    types.ProvisioningStatus    `json:"provisioning_status"`
	OperatingStatus       types.OperatingStatus       `json:"operating_status"`
	CreatorTaskID         string                      `json:"creator_task_id"`
	TaskID                string                      `json:"task_id"`
	TimeoutClientData     int                         `json:"timeout_client_data"`
	TimeoutMemberData     int                         `json:"timeout_member_data"`
	TimeoutMemberConnect  int                         `json:"timeout_member_connect"`
}

Pool represents a pool structure.

func ExtractPools

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

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

func ListAll

func ListAll(c *gcorecloud.ServiceClient, opts ListOptsBuilder) ([]Pool, error)

ListAll returns all LB pools

func (Pool) IsDeleted

func (p Pool) IsDeleted() bool

IsDeleted LB pool state.

type PoolMember

type PoolMember struct {
	Address         *net.IP               `json:"address,omitempty"`
	ID              string                `json:"id"`
	Weight          int                   `json:"weight,omitempty"`
	SubnetID        string                `json:"subnet_id,omitempty"`
	InstanceID      string                `json:"instance_id,omitempty"`
	ProtocolPort    int                   `json:"protocol_port,omitempty"`
	OperatingStatus types.OperatingStatus `json:"operating_status,omitempty"`
	MonitorAddress  net.IP                `json:"monitor_address,omitempty"`
	MonitorPort     *int                  `json:"monitor_port,omitempty"`
}

PoolMember represents a pool member structure.

type PoolMemberTaskResult

type PoolMemberTaskResult struct {
	Members []string `json:"members"`
}

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 PoolTaskResult

type PoolTaskResult struct {
	Pools []string `json:"pools"`
}

type SessionPersistence

type SessionPersistence struct {
	PersistenceGranularity string                `json:"persistence_granularity,omitempty"`
	PersistenceTimeout     int                   `json:"persistence_timeout,omitempty"`
	Type                   types.PersistenceType `json:"type"`
	CookieName             string                `json:"cookie_name,omitempty"`
}

SessionPersistenceOpts represents options used to create a lbpool listener pool session persistence rules.

type UpdateOpts

type UpdateOpts struct {
	Name                 string                        `json:"name,omitempty"`
	Members              []CreatePoolMemberOpts        `json:"members,omitempty"`
	Protocol             types.ProtocolType            `json:"protocol,omitempty"`
	LBPoolAlgorithm      types.LoadBalancerAlgorithm   `json:"lb_algorithm,omitempty"`
	HealthMonitor        *CreateHealthMonitorOpts      `json:"healthmonitor"`
	SessionPersistence   *CreateSessionPersistenceOpts `json:"session_persistence"`
	TimeoutClientData    int                           `json:"timeout_client_data"`
	TimeoutMemberData    int                           `json:"timeout_member_data"`
	TimeoutMemberConnect int                           `json:"timeout_member_connect"`
}

UpdateOpts represents options used to update a lbpool.

func (UpdateOpts) ToLBPoolUpdateMap

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

ToLBPoolUpdateMap builds a request body from UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToLBPoolUpdateMap() (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 it as a Pool.

func (UpdateResult) Extract

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

Extract is a function that accepts a result and extracts a pool resource.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

func (UpdateResult) ExtractPoolMember

func (r UpdateResult) ExtractPoolMember() (*PoolMember, error)

ExtractPoolMember is a function that accepts a result and extracts a pool member resource.

Directories

Path Synopsis
loadbalancers unit tests
loadbalancers unit tests

Jump to

Keyboard shortcuts

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