nodes

package
v0.0.0-...-65b17b6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

Types

type CreateOpts

type CreateOpts struct {
	// The address of the node
	Address string `json:"address"`

	// The port for the node
	Port int32 `json:"port"`

	// Indicates if the node is ENABLED, DISABLED, or DRAINING
	Condition string `json:"condition"`

	// Indicates the weight for the node
	Weight uint `json:"weight,omitempty"`

	// Node type
	Type string `json:"type,omitempty"`
}

CreateOpts contain the values necessary to create a node

type CreateResult

type CreateResult struct {
	gophercloud.Result
}

CreateResult is the result of a Create operation

func Create

func Create(client *gophercloud.ServiceClient, lbID uint64, opts []CreateOpts) (r CreateResult)

Create creates a requested node

func (CreateResult) Extract

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

Extract interprets a CreateResult as a Node.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

method to determine if the call succeeded or failed.

func Delete

func Delete(client *gophercloud.ServiceClient, lbID uint64, id uint64) (r DeleteResult)

Delete deletes the specified node ID.

type GetResult

type GetResult struct {
	gophercloud.Result
}

GetResult is the response from a Get operation. Call its Extract method to interpret it as a Node.

func Get

func Get(client *gophercloud.ServiceClient, lbID uint64, id uint64) (r GetResult)

Get returns data about a specific node by its ID.

func (GetResult) Extract

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

Extract interprets a GetResult as a Node.

type ListOpts

type ListOpts struct {
	// Status of the LoadBalancer
	Status string `q:"status"`
	// Address of a node attached to the LoadBalancer
	Node string `q:"nodeaddress"`
	// Name of the LoadBalancer
	Name string `q:"name"`
}

ListOpts contain options filtering LoadBalancers returned from a call to List.

func (ListOpts) ToLoadBalancerListQuery

func (opts ListOpts) ToLoadBalancerListQuery() (string, error)

ToLoadBalancerListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToLoadBalancerListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type Node

type Node struct {
	// ID is the unique ID of a node
	ID uint64 `json:"id"`

	// The address of the node
	Address string `json:"address"`

	// The port for the node
	Port int32 `json:"port"`

	// Indicates if the node is ENABLED, DISABLED or DRAINING
	Condition string `json:"condition"`

	// The status of the node
	Status string `json:"status"`

	// Indicates the weight for the node
	Weight uint `json:"weight"`

	// Node typeof virtualIps for a load balancer
	Type string `json:"type"`
}

Node represents a node behind a load balancer returned by the Cloud Load Balancer API.

func ExtractNodes

func ExtractNodes(r pagination.Page) ([]Node, error)

ExtractNodes converts a page of List results into a slice of usable Node structs.

type NodePage

type NodePage struct {
	pagination.LinkedPageBase
}

NodePage contains a single page of all Nodes return from a List operation. Use ExtractNodes to convert it into a slice of usable structs.

func (NodePage) IsEmpty

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

IsEmpty returns true if response contains no Node results.

func (NodePage) NextPageURL

func (page NodePage) NextPageURL() (string, error)

NextPageURL uses the response's embedded link reference to navigate to the next page of results.

Jump to

Keyboard shortcuts

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