Documentation ¶
Index ¶
- func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- func CreateMember(c *gcorecloud.ServiceClient, lbpoolID string, opts CreateMemberOptsBuilder) (r tasks.Result)
- func Delete(c *gcorecloud.ServiceClient, lbpoolID string) (r tasks.Result)
- func DeleteMember(c *gcorecloud.ServiceClient, lbpoolID string, memberID string) (r tasks.Result)
- func ExtractPoolIDFromTask(task *tasks.Task) (string, error)
- func ExtractPoolMemberIDFromTask(task *tasks.Task) (string, error)
- func ExtractPoolsInto(r pagination.Page, v interface{}) error
- func List(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func Update(c *gcorecloud.ServiceClient, lbpoolID string, opts UpdateOptsBuilder) (r tasks.Result)
- type CreateHealthMonitorOpts
- type CreateMemberOptsBuilder
- type CreateOpts
- type CreateOptsBuilder
- type CreatePoolMemberOpts
- type CreateResult
- type CreateSessionPersistenceOpts
- type GetResult
- type HealthMonitor
- type ListOpts
- type ListOptsBuilder
- type Pool
- type PoolMember
- type PoolMemberTaskResult
- type PoolPage
- type PoolTaskResult
- type SessionPersistence
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
Create accepts a CreateOpts struct and creates a new lbpool using the values provided.
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 ExtractPoolsInto ¶
func ExtractPoolsInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
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 { 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"` }
CreateHealthMonitorOpts represents options used to create a lbpool health monitor.
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"` }
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 ¶
CreateOptsBuilder allows extensions to add parameters to the Create request.
type CreatePoolMemberOpts ¶
type CreatePoolMemberOpts struct { 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"` }
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 ¶
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 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 ¶
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"` }
HealthMonitor for LB pool
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 ¶
ToListenerListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
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"` }
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
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"` }
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) NextPageURL ¶
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" validate:"required,name"` Members []CreatePoolMemberOpts `json:"members,omitempty"` LBPoolAlgorithm types.LoadBalancerAlgorithm `json:"lb_algorithm,omitempty"` HealthMonitor *CreateHealthMonitorOpts `json:"healthmonitor,omitempty"` SessionPersistence *CreateSessionPersistenceOpts `json:"session_persistence,omitempty"` }
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 ¶
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 ¶
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.