vips

package
v0.0.0-...-2804b72 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: Apache-2.0 Imports: 2 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 routers. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Default policy settings return only those routers that are owned by the tenant who submits the request, unless an admin user submits the request.

Types

type CreateOpts

type CreateOpts struct {
	// Human-readable name for the VIP. Does not have to be unique.
	Name string `json:"name" required:"true"`
	// The network on which to allocate the VIP's address. A tenant can
	// only create VIPs on networks authorized by policy (e.g. networks that
	// belong to them or networks that are shared).
	SubnetID string `json:"subnet_id" required:"true"`
	// The protocol - can either be TCP, HTTP or HTTPS.
	Protocol string `json:"protocol" required:"true"`
	// The port on which to listen for client traffic.
	ProtocolPort int `json:"protocol_port" required:"true"`
	// The ID of the pool with which the VIP is associated.
	PoolID string `json:"pool_id" required:"true"`
	// Required for admins. Indicates the owner of the VIP.
	TenantID string `json:"tenant_id,omitempty"`
	// The IP address of the VIP.
	Address string `json:"address,omitempty"`
	// Human-readable description for the VIP.
	Description string `json:"description,omitempty"`
	// Omit this field to prevent session persistence.
	Persistence *SessionPersistence `json:"session_persistence,omitempty"`
	// The maximum number of connections allowed for the VIP.
	ConnLimit *int `json:"connection_limit,omitempty"`
	// The administrative state of the VIP. A valid value is true (UP)
	// or false (DOWN).
	AdminStateUp *bool `json:"admin_state_up,omitempty"`
}

CreateOpts contains all the values needed to create a new virtual IP.

func (CreateOpts) ToVIPCreateMap

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

ToVIPCreateMap allows CreateOpts to satisfy the CreateOptsBuilder interface

type CreateOptsBuilder

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

CreateOptsBuilder is what types must satisfy to be used as Create options.

type CreateResult

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

CreateResult represents the result of a create operation.

func Create

func Create(c *gophercloud.ServiceClient, opts CreateOpts) (r CreateResult)

Create is an operation which provisions a new virtual IP based on the configuration defined in the CreateOpts struct. Once the request is validated and progress has started on the provisioning process, a CreateResult will be returned.

Please note that the PoolID should refer to a pool that is not already associated with another vip. If the pool is already used by another vip, then the operation will fail with a 409 Conflict error will be returned.

Users with an admin role can create VIPs on behalf of other tenants by specifying a TenantID attribute different than their own.

func (CreateResult) Extract

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

func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult)

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

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

Get retrieves a particular virtual IP based on its unique ID.

func (GetResult) Extract

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

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

type ListOpts

type ListOpts struct {
	ID              string `q:"id"`
	Name            string `q:"name"`
	AdminStateUp    *bool  `q:"admin_state_up"`
	Status          string `q:"status"`
	TenantID        string `q:"tenant_id"`
	SubnetID        string `q:"subnet_id"`
	Address         string `q:"address"`
	PortID          string `q:"port_id"`
	Protocol        string `q:"protocol"`
	ProtocolPort    int    `q:"protocol_port"`
	ConnectionLimit int    `q:"connection_limit"`
	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 SessionPersistence

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

	// Name of cookie if persistence mode is set appropriately
	CookieName string `json:"cookie_name,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 ative. Three types of persistence are supported:

SOURCE_IP: With this mode, all connections originating from the same source

IP address, will be handled by the same member of the pool.

HTTP_COOKIE: With this persistence mode, the load balancing function will

create a cookie on the first request from a client. Subsequent
requests containing the same cookie value will be handled by
the same member of the pool.

APP_COOKIE: With this persistence mode, the load balancing function will

rely on a cookie established by the backend application. All
requests carrying the same cookie value will be handled by the
same member of the pool.

type UpdateOpts

type UpdateOpts struct {
	// Human-readable name for the VIP. Does not have to be unique.
	Name *string `json:"name,omitempty"`
	// The ID of the pool with which the VIP is associated.
	PoolID *string `json:"pool_id,omitempty"`
	// Human-readable description for the VIP.
	Description *string `json:"description,omitempty"`
	// Omit this field to prevent session persistence.
	Persistence *SessionPersistence `json:"session_persistence,omitempty"`
	// The maximum number of connections allowed for the VIP.
	ConnLimit *int `json:"connection_limit,omitempty"`
	// The administrative state of the VIP. A valid value is true (UP)
	// or false (DOWN).
	AdminStateUp *bool `json:"admin_state_up,omitempty"`
}

UpdateOpts contains all the values needed to update an existing virtual IP. Attributes not listed here but appear in CreateOpts are immutable and cannot be updated.

func (UpdateOpts) ToVIPUpdateMap

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

ToVIPUpdateMap allows UpdateOpts to satisfy the UpdateOptsBuilder interface

type UpdateOptsBuilder

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

UpdateOptsBuilder is what types must satisfy to be used as Update options.

type UpdateResult

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

UpdateResult represents the result of an update operation.

func Update

Update is an operation which modifies the attributes of the specified VIP.

func (UpdateResult) Extract

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

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

type VIPPage

type VIPPage struct {
	pagination.LinkedPageBase
}

VIPPage is the page returned by a pager when traversing over a collection of routers.

func (VIPPage) IsEmpty

func (r VIPPage) IsEmpty() (bool, error)

IsEmpty checks whether a VIPPage struct is empty.

func (VIPPage) NextPageURL

func (r VIPPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of routers 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 VirtualIP

type VirtualIP struct {
	// The unique ID for the VIP.
	ID string `json:"id"`

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

	// Human-readable name for the VIP. Does not have to be unique.
	Name string `json:"name"`

	// Human-readable description for the VIP.
	Description string `json:"description"`

	// The ID of the subnet on which to allocate the VIP address.
	SubnetID string `json:"subnet_id"`

	// The IP address of the VIP.
	Address string `json:"address"`

	// The protocol of the VIP address. A valid value is TCP, HTTP, or HTTPS.
	Protocol string `json:"protocol"`

	// The port on which to listen to client traffic that is associated with the
	// VIP address. A valid value is from 0 to 65535.
	ProtocolPort int `json:"protocol_port"`

	// The ID of the pool with which the VIP is associated.
	PoolID string `json:"pool_id"`

	// The ID of the port which belongs to the load balancer
	PortID string `json:"port_id"`

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

	// The maximum number of connections allowed for the VIP. Default is -1,
	// meaning no limit.
	ConnLimit int `json:"connection_limit"`

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

	// The status of the VIP. Indicates whether the VIP is operational.
	Status string `json:"status"`
}

VirtualIP is the primary load balancing configuration object that specifies the virtual IP address and port on which client traffic is received, as well as other details such as the load balancing method to be use, protocol, etc. This entity is sometimes known in LB products under the name of a "virtual server", a "vserver" or a "listener".

func ExtractVIPs

func ExtractVIPs(r pagination.Page) ([]VirtualIP, error)

ExtractVIPs accepts a Page struct, specifically a VIPPage struct, and extracts the elements into a slice of VirtualIP structs. In other words, a generic collection is mapped into a relevant slice.

Directories

Path Synopsis
networking_extensions_lbaas_vips_v2
networking_extensions_lbaas_vips_v2

Jump to

Keyboard shortcuts

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