load_balancer_interfaces

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package load_balancer_interfaces contains functionality for working with ECL Load Balancer Interface resources.

Example to List Load Balancer Interfaces

listOpts := load_balancer_interfaces.ListOpts{
	Status: "ACTIVE",
}

allPages, err := load_balancer_interfaces.List(networkClient, listOpts).AllPages()
if err != nil {
	panic(err)
}

allLoadBalancerInterfaces, err := load_balancer_interfaces.ExtractLoadBalancerInterfaces(allPages)
if err != nil {
	panic(err)
}

for _, loadBalancerInterface := range allLoadBalancerInterfaces {
	fmt.Printf("%+v\n", loadBalancerInterface)
}

Example to Show Load Balancer Interface

loadBalancerInterfaceID := "f44e063c-5fea-45b8-9124-956995eafe2a"

loadBalancerInterface, err := load_balancer_interfaces.Get(networkClient, loadBalancerInterfaceID).Extract()
if err != nil {
	panic(err)
}

fmt.Printf("%+v\n", loadBalancerInterface)

Example to Update Load Balancer Interface

loadBalancerInterfaceID := "f44e063c-5fea-45b8-9124-956995eafe2a"

updateOpts := load_balancer_interfaces.UpdateOpts{
	Name:           "new_name",
}

loadBalancerInterface, err := load_balancer_interfaces.Update(networkClient, loadBalancerInterfaceID, updateOpts).Extract()
if err != nil {
	panic(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDFromName

func IDFromName(client *eclcloud.ServiceClient, name string) (string, error)

IDFromName is a convenience function that returns a Load Balancer Interface's ID, given its name.

func List

func List(c *eclcloud.ServiceClient, opts ListOpts) pagination.Pager

List returns a Pager which allows you to iterate over a collection of Load Balancer Interfaces. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Default policy settings return only those Load Balancer Interfaces that are owned by the tenant who submits the request, unless the request is submitted by a user with administrative rights.

Types

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 Load Balancer Interface.

func Get

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

Get retrieves a specific Load Balancer Interface based on its unique ID.

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a Load Balancer Interface resource.

type ListOpts

type ListOpts struct {
	Description      string `q:"description"`
	ID               string `q:"id"`
	IPAddress        string `q:"ip_address"`
	LoadBalancerID   string `q:"load_balancer_id"`
	Name             string `q:"name"`
	NetworkID        string `q:"network_id"`
	SlotNumber       int    `q:"slot_number"`
	Status           string `q:"status"`
	TenantID         string `q:"tenant_id"`
	VirtualIPAddress string `q:"virtual_ip_address"`
}

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 Load Balancer Interface attributes you want to see returned. SortKey allows you to sort by a particular Load Balancer Interface attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.

func (ListOpts) ToLoadBalancerInterfacesListQuery

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

ToLoadBalancerInterfacesListQuery formats a ListOpts into a query string.

type LoadBalancerInterface

type LoadBalancerInterface struct {

	// Description is description
	Description string `json:"description"`

	// UUID representing the Load Balancer Interface.
	ID string `json:"id"`

	// IP Address
	IPAddress *string `json:"ip_address"`

	// The ID of load_balancer this load_balancer_interface belongs to.
	LoadBalancerID string `json:"load_balancer_id"`

	// Name of the Load Balancer Interface
	Name string `json:"name"`

	// UUID of the parent network.
	NetworkID *string `json:"network_id"`

	// Slot Number
	SlotNumber int `json:"slot_number"`

	// Load Balancer Interface status
	Status string `json:"status"`

	// Tenant ID of the owner (UUID)
	TenantID string `json:"tenant_id"`

	// Load Balancer Interface type
	Type string `json:"type"`

	// Virtual IP Address
	VirtualIPAddress *string `json:"virtual_ip_address"`

	// Properties used for virtual IP address
	VirtualIPProperties *VirtualIPProperties `json:"virtual_ip_properties"`
}

LoadBalancerInterface represents a Load Balancer Interface. See package documentation for a top-level description of what this is.

func ExtractLoadBalancerInterfaces

func ExtractLoadBalancerInterfaces(r pagination.Page) ([]LoadBalancerInterface, error)

ExtractLoadBalancerInterfaces accepts a Page struct, specifically a LoadBalancerPage struct, and extracts the elements into a slice of Load Balancer Interface structs. In other words, a generic collection is mapped into a relevant slice.

type LoadBalancerInterfacePage

type LoadBalancerInterfacePage struct {
	pagination.LinkedPageBase
}

LoadBalancerPage is the page returned by a pager when traversing over a collection of load balancers.

func (LoadBalancerInterfacePage) IsEmpty

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

IsEmpty checks whether a LoadBalancerInterfacePage struct is empty.

type UpdateOpts

type UpdateOpts struct {

	// Description is description
	Description *string `json:"description,omitempty"`

	// IP Address
	IPAddress string `json:"ip_address,omitempty"`

	// Name of the Load Balancer Interface
	Name *string `json:"name,omitempty"`

	// UUID of the parent network.
	NetworkID *interface{} `json:"network_id,omitempty"`

	// Virtual IP Address
	VirtualIPAddress *interface{} `json:"virtual_ip_address,omitempty"`

	// Properties used for virtual IP address
	VirtualIPProperties *VirtualIPProperties `json:"virtual_ip_properties,omitempty"`
}

UpdateOpts represents the attributes used when updating an existing Load Balancer Interface.

func (UpdateOpts) ToLoadBalancerInterfaceUpdateMap

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

ToLoadBalancerUpdateMap builds a request body from UpdateOpts.

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 Load Balancer Interface.

func Update

func Update(c *eclcloud.ServiceClient, id string, opts UpdateOpts) (r UpdateResult)

Update accepts a UpdateOpts struct and updates an existing Load Balancer Interface using the values provided.

func (UpdateResult) Extract

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

Extract is a function that accepts a result and extracts a Load Balancer Interface resource.

type VirtualIPProperties

type VirtualIPProperties struct {
	Protocol string `json:"protocol"`
	Vrid     int    `json:"vrid"`
}

Properties used for virtual IP address

Directories

Path Synopsis
Load Balancer Interfaces unit tests
Load Balancer Interfaces unit tests

Jump to

Keyboard shortcuts

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