loadbalancers

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

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 Delete

func Delete(c *golangsdk.ServiceClient, id string) (r elb.JobResult)

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

func Update

func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts, not_pass_param []string) (r elb.JobResult)

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

Types

type CreateOpts

type CreateOpts struct {
	Name            string `json:"name" required:"true"`
	Description     string `json:"description,omitempty"`
	VpcID           string `json:"vpc_id" required:"true"`
	BandWidth       int    `json:"bandwidth,omitempty"`
	Type            string `json:"type" required:"true"`
	AdminStateUp    int    `json:"admin_state_up" required:"true"`
	VipSubnetID     string `json:"vip_subnet_id,omitempty"`
	AZ              string `json:"az,omitempty"`
	ChargeMode      string `json:"charge_mode,omitempty"`
	EipType         string `json:"eip_type,omitempty"`
	SecurityGroupID string `json:"security_group_id,omitempty"`
	VipAddress      string `json:"vip_address,omitempty"`
	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 GetResult

type GetResult struct {
	golangsdk.Result
}

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

type LoadBalancer

type LoadBalancer struct {
	VipAddress      string `json:"vip_address"`
	UpdateTime      string `json:"update_time"`
	CreateTime      string `json:"create_time"`
	ID              string `json:"id"`
	Status          string `json:"status"`
	BandWidth       int    `json:"bandwidth"`
	VpcID           string `json:"vpc_id"`
	AdminStateUp    int    `json:"admin_state_up"`
	VipSubnetID     string `json:"vip_subnet_id"`
	Type            string `json:"type"`
	Name            string `json:"name"`
	Description     string `json:"description"`
	SecurityGroupID string `json:"security_group_id"`
}

type UpdateOpts

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

	BandWidth int `json:"bandwidth,omitempty"`
	// Optional. The administrative state of the Loadbalancer. A valid value is true (UP)
	// or false (DOWN).
	AdminStateUp int `json:"admin_state_up"`
}

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.

Jump to

Keyboard shortcuts

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