loadbalancer_elbs

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(c *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager

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 {
	// Required. Specifies the load balancer name.
	// The name is a string of 1 to 64 characters that consist of letters, digits, underscores (_), and hyphens (-).
	Name string `json:"name" required:"true"`
	// Optional. Provides supplementary information about the load balancer.
	// The value is a string of 0 to 128 characters and cannot contain angle brackets (<>).
	Description string `json:"description,omitempty"`
	// Required. Specifies the VPC ID.
	VpcID string `json:"vpc_id" required:"true"`
	// Optional. Specifies the bandwidth (Mbit/s). This parameter is mandatory when type is
	// set to External, and it is invalid when type is set to Internal.
	// The value ranges from 1 to 300.
	Bandwidth int `json:"bandwidth,omitempty"`
	// Required. Specifies the load balancer type.
	// The value can be Internal or External.
	Type string `json:"type" required:"true"`
	// Required.  Specifies the status of the load balancer.
	// Optional values:
	// 0 or false: indicates that the load balancer is stopped. Only tenants are allowed to enter these two values.
	// 1 or true: indicates that the load balancer is running properly.
	// 2 or false: indicates that the load balancer is frozen. Only tenants are allowed to enter these two values.
	AdminStateUp *bool `json:"admin_state_up" required:"true"`
	// Optional.  Specifies the subnet ID of backend ECSs. This parameter is mandatory when type is set to Internal.
	VipSubnetID string `json:"vip_subnet_id,omitempty"`
	// Optional.  Specifies the ID of the availability zone (AZ). This parameter is mandatory when type
	// is set to Internal, and it is invalid when type is set to External.
	AZ string `json:"az,omitempty"`
	// Optional.  Specifies the security group ID.
	// The value is a string of 1 to 200 characters that consists of uppercase and lowercase letters, digits, and hyphens (-).
	// This parameter is mandatory when type is set to Internal.
	SecurityGroupID string `json:"security_group_id,omitempty"`
	// Optional.  Specifies the IP address used by ELB for providing services. When type is set to External,
	// the parameter value is the elastic IP address. When type is set to Internal, the parameter value is
	// the private network IP address.
	// You can select an existing elastic IP address and create a public network load balancer.
	// When this parameter is configured, parameters bandwidth, charge_mode, and eip_type are invalid.
	VipAddress string `json:"vip_address,omitempty"`
	// Specifies the tenant ID. This parameter is mandatory when type is set to Internal
	TenantID string `json:"tenantid,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 casts a CreateOpts struct to a map.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToLoadBalancerCreateMap() (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

func Create(c *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.

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

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 {
	// contains filtered or unexported fields
}

DeleteResult represents the result of a delete operation.

func Delete

func Delete(c *golangsdk.ServiceClient, id string, keepEIP bool) (r DeleteResult)

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

func (DeleteResult) Extract

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

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

type GetResult

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

GetResult represents the result of a get operation.

func Get

func Get(c *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
}

type ListOpts

type ListOpts struct {
	Name            string `q:"name"`
	Description     string `q:"description"`
	VpcID           string `q:"vpc_id"`
	Bandwidth       int    `q:"bandwidth"`
	Type            string `q:"type"`
	AdminStateUp    *bool  `q:"admin_state_up"`
	VipSubnetID     string `q:"vip_subnet_id"`
	AZ              string `q:"az"`
	ChargeMode      string `q:"charge_mode"`
	EipType         string `q:"eip_type"`
	SecurityGroupID string `q:"security_group_id"`
	VipAddress      string `q:"vip_address"`
	TenantID        string `q:"tenantId"`
	ID              string `q:"id"`
	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 Loadbalancer attributes you want to see returned. SortKey allows you to sort by a particular attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.

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 {
	// Specifies the IP address used by ELB for providing services.
	VipAddress string `json:"vip_address"`
	// Specifies the time when information about the load balancer was updated.
	UpdateTime string `json:"update_time"`
	// Specifies the time when the load balancer was created.
	CreateTime string `json:"create_time"`
	// Specifies the load balancer ID.
	ID string `json:"id"`
	// Specifies the status of the load balancer.
	// The value can be ACTIVE, PENDING_CREATE, or ERROR.
	Status string `json:"status"`
	// Specifies the bandwidth (Mbit/s).
	Bandwidth int `json:"bandwidth"`
	// Specifies the VPC ID.
	VpcID string `json:"vpc_id"`
	// Specifies the status of the load balancer.
	// Optional values:
	// 0: The load balancer is disabled.
	// 1: The load balancer is running properly.
	// 2: The load balancer is frozen.
	AdminStateUp int `json:"admin_state_up"`
	// Specifies the subnet ID of backend ECSs.
	VipSubnetID string `json:"vip_subnet_id"`
	// Specifies the load balancer type.
	Type string `json:"type"`
	// Specifies the load balancer name.
	Name string `json:"name"`
	// Provides supplementary information about the load balancer.
	Description string `json:"description"`
	// Specifies the security group ID.
	SecurityGroupID string `json:"security_group_id"`
	// Specifies the ID of the availability zone (AZ).
	AZ string `json:"az"`
}

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.LinkedPageBase
}

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

func (LoadBalancerPage) IsEmpty

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

IsEmpty checks whether a LoadBalancerPage struct is empty.

type UpdateOpts

type UpdateOpts struct {
	// Required. Specifies the load balancer name.
	// The name is a string of 1 to 64 characters that consist of letters, digits, underscores (_), and hyphens (-).
	Name string `json:"name,omitempty"`
	// Optional. Provides supplementary information about the load balancer.
	// The value is a string of 0 to 128 characters and cannot contain angle brackets (<>).
	Description string `json:"description,omitempty"`
	// Optional. Specifies the bandwidth (Mbit/s). This parameter is mandatory when type is
	// set to External, and it is invalid when type is set to Internal.
	// The value ranges from 1 to 300.
	Bandwidth int `json:"bandwidth,omitempty"`
	// Required.  Specifies the status of the load balancer.
	// Optional values:
	// 0 or false: indicates that the load balancer is stopped. Only tenants are allowed to enter these two values.
	// 1 or true: indicates that the load balancer is running properly.
	// 2 or false: indicates that the load balancer is frozen. Only tenants are allowed to enter these two values.
	AdminStateUp *bool `json:"admin_state_up,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 casts a UpdateOpts struct to a map.

type UpdateOptsBuilder

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

UpdateOptsBuilder is the interface options structs have to satisfy in order to be used in the main Update 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 UpdateResult

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

UpdateResult represents the result of an update operation.

func Update

func Update(c *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