vips

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2015 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package vips provides information and interaction with the Virtual IP API resource for the Rackspace Cloud Load Balancer service.

A virtual IP (VIP) makes a load balancer accessible by clients. The load balancing service supports either a public VIP, routable on the public Internet, or a ServiceNet address, routable only within the region in which the load balancer resides.

All load balancers must have at least one virtual IP associated with them at all times.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *gophercloud.ServiceClient, loadBalancerID int) pagination.Pager

List is the operation responsible for returning a paginated collection of load balancer virtual IP addresses.

Types

type CreateOpts

type CreateOpts struct {
	// Optional - the ID of an existing virtual IP. By doing this, you are
	// allowing load balancers to share IPV6 addresses.
	ID string

	// Optional - the type of address.
	Type Type

	// Optional - the version of address.
	Version Version
}

CreateOpts is the common options struct used in this package's Create operation.

func (CreateOpts) ToVIPCreateMap

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

ToVIPCreateMap casts a CreateOpts struct to a map.

type CreateOptsBuilder

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

CreateOptsBuilder is the interface options structs have to satisfy in order to be used in the main Create operation in this package. Since many extensions decorate or modify the common logic, it is useful for them to satisfy a basic interface in order for them to be used.

type CreateResult

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

CreateResult represents the result of a create operation.

func Create

Create is the operation responsible for assigning a new Virtual IP to an existing load balancer resource. Currently, only version 6 IP addresses may be added.

func (CreateResult) Extract

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

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult represents the result of a delete operation.

func BulkDelete

func BulkDelete(c *gophercloud.ServiceClient, loadBalancerID int, vipIDs []int) DeleteResult

BulkDelete is the operation responsible for batch deleting multiple VIPs in a single operation. It accepts a slice of integer IDs and will remove them from the load balancer. The maximum limit is 10 VIP removals at once.

func Delete

func Delete(c *gophercloud.ServiceClient, lbID, vipID int) DeleteResult

Delete is the operation responsible for permanently deleting a VIP.

type Type

type Type string

Type represents the type of a VIP.

const (
	// PUBLIC indicates a VIP type that is routable on the public Internet.
	PUBLIC Type = "PUBLIC"

	// PRIVATE indicates a VIP type that is routable only on ServiceNet.
	PRIVATE Type = "SERVICENET"
)

type VIP

type VIP struct {
	Address string  `json:"address,omitempty"`
	ID      int     `json:"id,omitempty"`
	Type    Type    `json:"type,omitempty"`
	Version Version `json:"ipVersion,omitempty" mapstructure:"ipVersion"`
}

VIP represents a Virtual IP API resource.

func ExtractVIPs

func ExtractVIPs(page pagination.Page) ([]VIP, error)

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

type VIPPage

type VIPPage struct {
	pagination.SinglePageBase
}

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

func (VIPPage) IsEmpty

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

IsEmpty checks whether a VIPPage struct is empty.

type Version

type Version string

Version represents the version of a VIP.

const (
	IPV4 Version = "IPV4"
	IPV6 Version = "IPV6"
)

Convenient constants to use for type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL