members

package
v0.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2015 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

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 {
	// Only required if the caller has an admin role and wants to create a pool
	// for another tenant.
	TenantID string

	// Required. The IP address of the member.
	Address string

	// Required. The port on which the application is hosted.
	ProtocolPort int

	// Required. The pool to which this member will belong.
	PoolID string
}

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

type CreateResult

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

CreateResult represents the result of a create operation.

func Create

Create accepts a CreateOpts struct and uses the values to create a new load balancer pool member.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Member, 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

Delete will permanently delete a particular member 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

Get retrieves a particular pool member based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Member, error)

Extract is a function that accepts a result and extracts a router.

type ListOpts

type ListOpts struct {
	Status       string `q:"status"`
	Weight       int    `q:"weight"`
	AdminStateUp *bool  `q:"admin_state_up"`
	TenantID     string `q:"tenant_id"`
	PoolID       string `q:"pool_id"`
	Address      string `q:"address"`
	ProtocolPort int    `q:"protocol_port"`
	ID           string `q:"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 Member

type Member struct {
	// The status of the member. Indicates whether the member is operational.
	Status string

	// Weight of member.
	Weight int

	// The administrative state of the member, which is up (true) or down (false).
	AdminStateUp bool `json:"admin_state_up" mapstructure:"admin_state_up"`

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

	// The pool to which the member belongs.
	PoolID string `json:"pool_id" mapstructure:"pool_id"`

	// The IP address of the member.
	Address string

	// The port on which the application is hosted.
	ProtocolPort int `json:"protocol_port" mapstructure:"protocol_port"`

	// The unique ID for the member.
	ID string
}

Member represents the application running on a backend server.

func ExtractMembers

func ExtractMembers(page pagination.Page) ([]Member, error)

ExtractMembers accepts a Page struct, specifically a MemberPage struct, and extracts the elements into a slice of Member structs. In other words, a generic collection is mapped into a relevant slice.

type MemberPage

type MemberPage struct {
	pagination.LinkedPageBase
}

MemberPage is the page returned by a pager when traversing over a collection of pool members.

func (MemberPage) IsEmpty

func (p MemberPage) IsEmpty() (bool, error)

IsEmpty checks whether a MemberPage struct is empty.

func (MemberPage) NextPageURL

func (p MemberPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of members 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 {
	// The administrative state of the member, which is up (true) or down (false).
	AdminStateUp bool
}

UpdateOpts contains the values used when updating a pool member.

type UpdateResult

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

UpdateResult represents the result of an update operation.

func Update

Update allows members to be updated.

func (UpdateResult) Extract

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

Extract is a function that accepts a result and extracts a router.

Jump to

Keyboard shortcuts

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