Documentation ¶
Index ¶
- func List(client *golangsdk.ServiceClient, poolID string, opts ListOptsBuilder) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type Member
- type MemberPage
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *golangsdk.ServiceClient, poolID string, opts ListOptsBuilder) pagination.Pager
List returns a Pager which allows you to iterate over a collection of members. It accepts a ListOptsBuilder, which allows you to filter and sort the returned collection for greater efficiency.
Default policy settings return only those members that are owned by the tenant who submits the request, unless an admin user submits the request.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // The IP address of the member to receive traffic from the load balancer. Address string `json:"address" required:"true"` // The port on which to listen for client traffic. ProtocolPort int `json:"protocol_port" required:"true"` // Name of the Member. Name string `json:"name,omitempty"` // ProjectID is the UUID of the project who owns the Member. // Only administrative users can specify a project UUID other than their own. ProjectID string `json:"project_id,omitempty"` // Specifies the weight of the backend server. // // Requests are routed to backend servers in the same backend server group based on their weights. // // If the weight is 0, the backend server will not accept new requests. // // This parameter is invalid when lb_algorithm is set to SOURCE_IP for the backend server group that contains the backend server. Weight *int `json:"weight,omitempty"` // If you omit this parameter, LBaaS uses the vip_subnet_id parameter value // for the subnet UUID. SubnetID string `json:"subnet_cidr_id,omitempty"` // The administrative state of the Pool. A valid value is true (UP) // or false (DOWN). AdminStateUp *bool `json:"admin_state_up,omitempty"` }
CreateOpts is the common options' struct used in this package's CreateMember operation.
func (CreateOpts) ToMemberCreateMap ¶
func (opts CreateOpts) ToMemberCreateMap() (map[string]interface{}, error)
ToMemberCreateMap builds a request body from CreateOptsBuilder.
type CreateOptsBuilder ¶
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 it as a Member.
func Create ¶
func Create(client *golangsdk.ServiceClient, poolID string, opts CreateOptsBuilder) (r CreateResult)
Create will create and associate a Member with a particular Pool.
type DeleteResult ¶
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, poolID string, memberID string) (r DeleteResult)
Delete will remove and disassociate a Member from a particular Pool.
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 Member.
type ListOpts ¶
type ListOpts struct { Name string `q:"name"` Weight int `q:"weight"` AdminStateUp *bool `q:"admin_state_up"` SubnetID string `q:"subnet_sidr_id"` Address string `q:"address"` ProtocolPort int `q:"protocol_port"` ID string `q:"id"` OperatingStatus string `q:"operating_status"` 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 Member attributes you want to see returned. SortKey allows you to sort by a particular Member attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.
func (ListOpts) ToMembersListQuery ¶
ToMembersListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type Member ¶
type Member struct { // Name of the Member. Name string `json:"name"` // Weight of Member. Weight int `json:"weight"` // The administrative state of the member, which is up (true) or down (false). AdminStateUp bool `json:"admin_state_up"` // Owner of the Member. ProjectID string `json:"project_id"` // Parameter value for the subnet UUID. SubnetID string `json:"subnet_cidr_id"` // The Pool to which the Member belongs. PoolID string `json:"pool_id"` // The IP address of the Member. Address string `json:"address"` // The port on which the application is hosted. ProtocolPort int `json:"protocol_port"` // The unique ID for the Member. ID string `json:"id"` IpVersion string `json:"ip_version"` // The operating status of the member. OperatingStatus string `json:"operating_status"` }
Member represents the application running on a backend server.
func ExtractMembers ¶
func ExtractMembers(r pagination.Page) ([]Member, error)
ExtractMembers accepts a Page struct, specifically a MemberPage struct, and extracts the elements into a slice of Members structs. In other words, a generic collection is mapped into a relevant slice.
type MemberPage ¶
type MemberPage struct {
pagination.PageWithInfo
}
MemberPage is the page returned by a pager when traversing over a collection of Members in a Pool.
func (MemberPage) IsEmpty ¶
func (p MemberPage) IsEmpty() (bool, error)
type UpdateOpts ¶
type UpdateOpts struct { // Name of the Member. Name *string `json:"name,omitempty"` // A positive integer value that indicates the relative portion of traffic // that this member should receive from the pool. For example, a member with // a weight of 10 receives five times as much traffic as a member with a // weight of 2. Weight *int `json:"weight,omitempty"` // The administrative state of the Pool. A valid value is true (UP) // or false (DOWN). AdminStateUp *bool `json:"admin_state_up,omitempty"` }
UpdateOpts is the common options' struct used in this package's Update operation.
func (UpdateOpts) ToMemberUpdateMap ¶
func (opts UpdateOpts) ToMemberUpdateMap() (map[string]interface{}, error)
ToMemberUpdateMap builds a request body from UpdateOptsBuilder.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the List 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 Member.
func Update ¶
func Update(client *golangsdk.ServiceClient, poolID string, memberID string, opts UpdateOptsBuilder) (r UpdateResult)
Update allows Member to be updated.