loadbalancers

package
v0.5.23 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Bandwidth

type Bandwidth struct {
	// Name
	Name string `json:"name" required:"true"`

	// Size
	Size int `json:"size" required:"true"`

	// Charge Mode
	ChargeMode string `json:"charge_mode" required:"true"`

	// Share Type
	ShareType string `json:"share_type" required:"true"`
}

type BandwidthRef

type BandwidthRef struct {
	// Share Bandwidth ID
	ID string `json:"id" required:"true"`
}

type CreateOpts

type CreateOpts struct {
	// Human-readable name for the Loadbalancer. Does not have to be unique.
	Name string `json:"name,omitempty"`

	// Human-readable description for the Loadbalancer.
	Description string `json:"description,omitempty"`

	// The IP address of the Loadbalancer.
	VipAddress string `json:"vip_address,omitempty"`

	// The network on which to allocate the Loadbalancer's address.
	VipSubnetCidrID string `json:"vip_subnet_cidr_id,omitempty"`

	// The V6 network on which to allocate the Loadbalancer's address.
	IpV6VipSubnetID string `json:"ipv6_vip_virsubnet_id,omitempty"`

	// The UUID of a l4 flavor.
	L4Flavor string `json:"l4_flavor_id,omitempty"`

	// Guaranteed.
	Guaranteed *bool `json:"guaranteed,omitempty"`

	// The VPC ID.
	VpcID string `json:"vpc_id,omitempty"`

	// Availability Zone List.
	AvailabilityZoneList []string `json:"availability_zone_list" required:"true"`

	// The tags of the Loadbalancer.
	Tags []tags.ResourceTag `json:"tags,omitempty"`

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

	// The UUID of a l7 flavor.
	L7Flavor string `json:"l7_flavor_id,omitempty"`

	// IPv6 Bandwidth.
	IPV6Bandwidth *BandwidthRef `json:"ipv6_bandwidth,omitempty"`

	// Public IP IDs.
	PublicIpIDs []string `json:"publicip_ids,omitempty"`

	// Public IP.
	PublicIp *PublicIp `json:"publicip,omitempty"`

	// ELB VirSubnet IDs.
	ElbSubnetIDs []string `json:"elb_virsubnet_ids,omitempty"`

	// IP Target Enable.
	IpTargetEnable *bool `json:"ip_target_enable,omitempty"`
}

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

func (CreateOpts) ToLoadBalancerCreateMap

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

ToLoadBalancerCreateMap builds a request body from CreateOpts.

type CreateOptsBuilder

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

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a LoadBalancer.

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create is an operation which provisions a new loadbalancer 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.

func (CreateResult) Extract

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

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

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)

Delete will permanently delete a particular LoadBalancer based on its unique ID.

type EipInfo

type EipInfo struct {
	// Eip ID
	EipID string `json:"eip_id"`
	// Eip Address
	EipAddress string `json:"eip_address"`
	// Eip Address
	IpVersion int `json:"ip_version"`
}

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 LoadBalancer.

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

Get retrieves a particular Loadbalancer based on its unique ID.

func (GetResult) Extract

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

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

type GetStatusesResult

type GetStatusesResult struct {
	golangsdk.Result
}

GetStatusesResult represents the result of a GetStatuses operation. Call its Extract method to interpret it as a StatusTree.

func GetStatuses

func GetStatuses(client *golangsdk.ServiceClient, id string) (r GetStatusesResult)

GetStatuses will return the status of a particular LoadBalancer.

func (GetStatusesResult) Extract

func (r GetStatusesResult) Extract() (*StatusTree, error)

Extract is a function that accepts a result and extracts the status of a Loadbalancer.

type ListOpts

type ListOpts struct {
	ID                   []string `q:"id"`
	Name                 []string `q:"name"`
	Description          []string `q:"description"`
	ProvisioningStatus   []string `q:"provisioning_status"`
	OperatingStatus      []string `q:"operating_status"`
	VpcID                []string `q:"vpc_id"`
	VipPortID            []string `q:"vip_port_id"`
	VipAddress           []string `q:"vip_address"`
	VipSubnetCidrID      []string `q:"vip_subnet_cidr_id"`
	L4FlavorID           []string `q:"l4_flavor_id"`
	L4ScaleFlavorID      []string `q:"l4_scale_flavor_id"`
	AvailabilityZoneList []string `q:"availability_zone_list"`
	L7FlavorID           []string `q:"l7_flavor_id"`
	L7ScaleFlavorID      []string `q:"l7_scale_flavor_id"`
	Limit                int      `q:"limit"`
	Marker               string   `q:"marker"`
}

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 LoadBalancer

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

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

	// The provisioning status of the LoadBalancer.
	// This value is ACTIVE, PENDING_CREATE or ERROR.
	ProvisioningStatus string `json:"provisioning_status"`

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

	// The name of the provider.
	Provider string `json:"provider"`

	// Pools are the pools related to this Loadbalancer.
	Pools []structs.ResourceRef `json:"pools"`

	// Listeners are the listeners related to this Loadbalancer.
	Listeners []structs.ResourceRef `json:"listeners"`

	// The operating status of the LoadBalancer. This value is ONLINE or OFFLINE.
	OperatingStatus string `json:"operating_status"`

	// The IP address of the Loadbalancer.
	VipAddress string `json:"vip_address"`

	// The UUID of the subnet on which to allocate the virtual IP for the
	// Loadbalancer address.
	VipSubnetCidrID string `json:"vip_subnet_cidr_id"`

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

	// Owner of the LoadBalancer.
	ProjectID string `json:"project_id"`

	// The UUID of the port associated with the IP address.
	VipPortID string `json:"vip_port_id"`

	// The UUID of a flavor if set.
	Tags []tags.ResourceTag `json:"tags"`

	// Guaranteed.
	Guaranteed bool `json:"guaranteed"`

	// The VPC ID.
	VpcID string `json:"vpc_id"`

	// EIP Info.
	Eips []EipInfo `json:"eips"`

	// IpV6 Vip Address.
	IpV6VipAddress string `json:"ipv6_vip_address"`

	// IpV6 Vip VirSubnet ID.
	IpV6VipSubnetID string `json:"ipv6_vip_virsubnet_id"`

	// IpV6 Vip Port ID.
	IpV6VipPortID string `json:"ipv6_vip_port_id"`

	// Availability Zone List.
	AvailabilityZoneList []string `json:"availability_zone_list"`

	// L4 Flavor ID.
	L4FlavorID string `json:"l4_flavor_id"`

	// L4 Scale Flavor ID.
	L4ScaleFlavorID string `json:"l4_scale_flavor_id"`

	// L7 Flavor ID.
	L7FlavorID string `json:"l7_flavor_id"`

	// L7 Scale Flavor ID.
	L7ScaleFlavorID string `json:"l7_scale_flavor_id"`

	// Public IP Info.
	PublicIps []PublicIpInfo `json:"publicips"`

	// Elb VirSubnet IDs.
	ElbSubnetIDs []string `json:"elb_virsubnet_ids"`

	// Elb VirSubnet Type.
	ElbSubnetType string `json:"elb_virsubnet_type"`

	// Ip Target Enable.
	IpTargetEnable bool `json:"ip_target_enable"`

	// Frozen Scene.
	FrozenScene string `json:"frozen_scene"`

	// Ipv6 Bandwidth.
	IpV6Bandwidth BandwidthRef `json:"ipv6_bandwidth"`

	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

LoadBalancer is the primary load balancing configuration object that specifies the virtual IP address on which client traffic is received, as well as other details such as the load balancing method to be use, protocol, etc.

func ExtractLoadbalancers

func ExtractLoadbalancers(r pagination.Page) ([]LoadBalancer, error)

ExtractLoadbalancers accepts a Page struct, specifically a LoadbalancerPage struct, and extracts the elements into a slice of loadbalancer structs. In other words, a generic collection is mapped into a relevant slice.

type LoadbalancerPage

type LoadbalancerPage struct {
	pagination.PageWithInfo
}

LoadbalancerPage is the page returned by a pager when traversing over a collection of loadbalancer.

func (LoadbalancerPage) IsEmpty

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

IsEmpty checks whether a FlavorsPage struct is empty.

type PublicIp

type PublicIp struct {
	// IP Version.
	IpVersion int `json:"ip_version,omitempty"`

	// Network Type
	NetworkType string `json:"network_type" required:"true"`

	// Billing Info.
	BillingInfo string `json:"billing_info,omitempty"`

	// Description.
	Description string `json:"description,omitempty"`

	// Bandwidth
	Bandwidth Bandwidth `json:"bandwidth" required:"true"`
}

type PublicIpInfo

type PublicIpInfo struct {
	// Public IP ID
	PublicIpID string `json:"publicip_id"`
	// Public IP Address
	PublicIpAddress string `json:"publicip_address"`
	// IP Version
	IpVersion int `json:"ip_version"`
}

type StatusTree

type StatusTree struct {
	Loadbalancer *LoadBalancer `json:"loadbalancer"`
}

StatusTree represents the status of a loadbalancer.

type UpdateOpts

type UpdateOpts struct {
	// Human-readable name for the Loadbalancer. Does not have to be unique.
	Name string `json:"name,omitempty"`

	// Human-readable description for the Loadbalancer.
	Description *string `json:"description,omitempty"`

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

	// The IP address of the Loadbalancer.
	VipAddress string `json:"vip_address,omitempty"`

	// The network on which to allocate the Loadbalancer's address.
	VipSubnetCidrID *string `json:"vip_subnet_cidr_id,omitempty"`

	// The V6 network on which to allocate the Loadbalancer's address.
	IpV6VipSubnetID *string `json:"ipv6_vip_virsubnet_id,omitempty"`

	// The UUID of a l4 flavor.
	L4Flavor string `json:"l4_flavor_id,omitempty"`

	// The UUID of a l7 flavor.
	L7Flavor string `json:"l7_flavor_id,omitempty"`

	// IPv6 Bandwidth.
	IpV6Bandwidth *BandwidthRef `json:"ipv6_bandwidth,omitempty"`

	// ELB VirSubnet IDs.
	ElbSubnetIDs []string `json:"elb_virsubnet_ids,omitempty"`

	// IP Target Enable.
	IpTargetEnable *bool `json:"ip_target_enable,omitempty"`
}

UpdateOpts is the common options' struct used in this package's Update operation.

func (UpdateOpts) ToLoadBalancerUpdateMap

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

ToLoadBalancerUpdateMap builds a request body from UpdateOpts.

type UpdateOptsBuilder

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

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

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 LoadBalancer.

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOpts) (r UpdateResult)

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

func (UpdateResult) Extract

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

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

Jump to

Keyboard shortcuts

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