huaweicloud

package
v0.26.7 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Overview

nolint:golint // stop check lint issues as this file will be refactored

nolint:golint // stop check lint issues as this file will be refactored

nolint:golint // stop check lint issues as this file will be refactored

nolint:golint // stop check lint issues as this file will be refactored

nolint:golint // stop check lint issues as this file will be refactored

nolint:golint // stop check lint issues as this file will be refactored

nolint:golint // stop check lint issues as this file will be refactored

Index

Constants

View Source
const (
	ElbEnableCrossVpc    = "kubernetes.io/elb.enable-cross-vpc"
	ElbL4FlavorID        = "kubernetes.io/elb.l4-flavor-id"
	ElbL7FlavorID        = "kubernetes.io/elb.l7-flavor-id"
	ElbAvailabilityZones = "kubernetes.io/elb.availability-zones"

	ElbEnableTransparentClientIP = "kubernetes.io/elb.enable-transparent-client-ip"
)
View Source
const (
	ELBTypeInternal ELBType = "Internal"
	ELBTypeExternal ELBType = "External"

	MemberNormal      = "NORMAL"
	MemberAbnormal    = "ABNORMAL"
	MemberUnavailable = "UNAVAILABLE"
)
View Source
const (
	QuotaTypeElb       = "elb"
	QuotaTypeListeners = "listeners"
)
View Source
const (
	ELBJobStatusSuccess = "SUCCESS"
	ELBJobStatusFail    = "FAIL"
	ELBJobStatusRunning = "RUNNING"
	ELBJobStatusInit    = "INIT"
)
View Source
const (
	ELBHealthStatusNormal      = "NORMAL"
	ELBHealthStatusAbnormal    = "ABNORMAL"
	ELBHealthStatusUnavailable = "UNAVAILABLE"
)
View Source
const (
	HeaderSecurityToken string = "X-Security-Token"
	HeaderProject       string = "X-Project-Id"
)
View Source
const (
	ProviderName = "huaweicloud"

	LoadBalancerClass = "huaweicloud.com/elb"

	ElbClass = "kubernetes.io/elb.class"
	ElbID    = "kubernetes.io/elb.id"

	ElbSubnetID          = "kubernetes.io/elb.subnet-id"
	ElbEipID             = "kubernetes.io/elb.eip-id"
	ELBKeepEip           = "kubernetes.io/elb.keep-eip"
	AutoCreateEipOptions = "kubernetes.io/elb.eip-auto-create-option"

	ElbAlgorithm             = "kubernetes.io/elb.lb-algorithm"
	ElbSessionAffinityFlag   = "kubernetes.io/elb.session-affinity-flag"
	ElbSessionAffinityOption = "kubernetes.io/elb.session-affinity-option"

	ElbHealthCheckFlag    = "kubernetes.io/elb.health-check-flag"
	ElbHealthCheckOptions = "kubernetes.io/elb.health-check-option"

	ElbXForwardedHost      = "kubernetes.io/elb.x-forwarded-host"
	DefaultTLSContainerRef = "kubernetes.io/elb.default-tls-container-ref"

	ElbIdleTimeout     = "kubernetes.io/elb.idle-timeout"
	ElbRequestTimeout  = "kubernetes.io/elb.request-timeout"
	ElbResponseTimeout = "kubernetes.io/elb.response-timeout"

	NodeSubnetIDLabelKey = "node.kubernetes.io/subnetid"
	ELBMarkAnnotation    = "kubernetes.io/elb.mark"

	MaxRetry   = 3
	HealthzCCE = "cce-healthz"
	// Attention is a warning message that intended to set to auto-created instance, such as ELB listener.
	Attention = "It is auto-generated by cloud-provider-huaweicloud, do not modify!"

	ELBSessionNone        = ""
	ELBSessionSourceIP    = "SOURCE_IP"
	ELBPersistenceTimeout = "persistence_timeout"

	ELBSessionSourceIPDefaultTimeout = 60
	ELBSessionSourceIPMinTimeout     = 1
	ELBSessionSourceIPMaxTimeout     = 60

	ProtocolTCP             = "TCP"
	ProtocolUDP             = "UDP"
	ProtocolHTTP            = "HTTP"
	ProtocolHTTPS           = "HTTPS"
	ProtocolTerminatedHTTPS = "TERMINATED_HTTPS"
)

Cloud provider name: PaaS Web Services.

View Source
const (
	ThrottleConfigFile = "THROTTLE_CONFIG_FILE"

	/* 二代ELB限流环境变量配置 */
	MaxInstanceGetQPS      = "PUBLIC_ELB_INSTANCE_GET_MAX_QPS"
	MaxInstanceGetBurst    = "PUBLIC_ELB_INSTANCE_GET_MAX_BURST"
	MaxInstanceListQPS     = "PUBLIC_ELB_INSTANCE_LIST_MAX_QPS"
	MaxInstanceListBurst   = "PUBLIC_ELB_INSTANCE_LIST_MAX_BURST"
	MaxInstanceCreateQPS   = "PUBLIC_ELB_INSTANCE_CREATE_MAX_QPS"
	MaxInstanceCreateBurst = "PUBLIC_ELB_INSTANCE_CREATE_MAX_BURST"
	MaxInstanceDeleteQPS   = "PUBLIC_ELB_INSTANCE_DELETE_MAX_QPS"
	MaxInstanceDeleteBurst = "PUBLIC_ELB_INSTANCE_DELETE_MAX_BURST"

	MaxListenerGetQPS      = "PUBLIC_ELB_LISTENER_GET_MAX_QPS"
	MaxListenerGetBurst    = "PUBLIC_ELB_LISTENER_GET_MAX_BURST"
	MaxListenerListQPS     = "PUBLIC_ELB_LISTENER_LIST_MAX_QPS"
	MaxListenerListBurst   = "PUBLIC_ELB_LISTENER_LIST_MAX_BURST"
	MaxListenerCreateQPS   = "PUBLIC_ELB_LISTENER_CREATE_MAX_QPS"
	MaxListenerCreateBurst = "PUBLIC_ELB_LISTENER_CREATE_MAX_BURST"
	MaxListenerUpdateQPS   = "PUBLIC_ELB_LISTENER_UPDATE_MAX_QPS"
	MaxListenerUpdateBurst = "PUBLIC_ELB_LISTENER_UPDATE_MAX_BURST"
	MaxListenerDeleteQPS   = "PUBLIC_ELB_LISTENER_DELETE_MAX_QPS"
	MaxListenerDeleteBurst = "PUBLIC_ELB_LISTENER_DELETE_MAX_BURST"

	MaxPoolGetQPS      = "PUBLIC_ELB_POOL_GET_MAX_QPS"
	MaxPoolGetBurst    = "PUBLIC_ELB_POOL_GET_MAX_BURST"
	MaxPoolListQPS     = "PUBLIC_ELB_POOL_LIST_MAX_QPS"
	MaxPoolListBurst   = "PUBLIC_ELB_POOL_LIST_MAX_BURST"
	MaxPoolCreateQPS   = "PUBLIC_ELB_POOL_CREATE_MAX_QPS"
	MaxPoolCreateBurst = "PUBLIC_ELB_POOL_CREATE_MAX_BURST"
	MaxPoolUpdateQPS   = "PUBLIC_ELB_POOL_UPDATE_MAX_QPS"
	MaxPoolUpdateBurst = "PUBLIC_ELB_POOL_UPDATE_MAX_BURST"
	MaxPoolDeleteQPS   = "PUBLIC_ELB_POOL_DELETE_MAX_QPS"
	MaxPoolDeleteBurst = "PUBLIC_ELB_POOL_DELETE_MAX_BURST"

	MaxMemberGetQPS      = "PUBLIC_ELB_MEMBER_GET_MAX_QPS"
	MaxMemberGetBurst    = "PUBLIC_ELB_MEMBER_GET_MAX_BURST"
	MaxMemberListQPS     = "PUBLIC_ELB_MEMBER_LIST_MAX_QPS"
	MaxMemberListBurst   = "PUBLIC_ELB_MEMBER_LIST_MAX_BURST"
	MaxMemberCreateQPS   = "PUBLIC_ELB_MEMBER_CREATE_MAX_QPS"
	MaxMemberCreateBurst = "PUBLIC_ELB_MEMBER_CREATE_MAX_BURST"
	MaxMemberUpdateQPS   = "PUBLIC_ELB_MEMBER_UPDATE_MAX_QPS"
	MaxMemberUpdateBurst = "PUBLIC_ELB_MEMBER_UPDATE_MAX_BURST"
	MaxMemberDeleteQPS   = "PUBLIC_ELB_MEMBER_DELETE_MAX_QPS"
	MaxMemberDeleteBurst = "PUBLIC_ELB_MEMBER_DELETE_MAX_BURST"

	MaxHealthzGetQPS      = "PUBLIC_ELB_HEALTHZ_GET_MAX_QPS"
	MaxHealthzGetBurst    = "PUBLIC_ELB_HEALTHZ_GET_MAX_BURST"
	MaxHealthzListQPS     = "PUBLIC_ELB_HEALTHZ_LIST_MAX_QPS"
	MaxHealthzListBurst   = "PUBLIC_ELB_HEALTHZ_LIST_MAX_BURST"
	MaxHealthzCreateQPS   = "PUBLIC_ELB_HEALTHZ_CREATE_MAX_QPS"
	MaxHealthzCreateBurst = "PUBLIC_ELB_HEALTHZ_CREATE_MAX_BURST"
	MaxHealthzUpdateQPS   = "PUBLIC_ELB_HEALTHZ_UPDATE_MAX_QPS"
	MaxHealthzUpdateBurst = "PUBLIC_ELB_HEALTHZ_UPDATE_MAX_BURST"
	MaxHealthzDeleteQPS   = "PUBLIC_ELB_HEALTHZ_DELETE_MAX_QPS"
	MaxHealthzDeleteBurst = "PUBLIC_ELB_HEALTHZ_DELETE_MAX_BURST"

	/* NAT网关限流环境变量配置 */
	MaxNatGatewayGetQPS    = "NAT_GATEWAY_GET_MAX_QPS"
	MaxNatGatewayGetBurst  = "NAT_GATEWAY_GET_MAX_BURST"
	MaxNatGatewayListQPS   = "NAT_GATEWAY_LIST_MAX_QPS"
	MaxNatGatewayListBurst = "NAT_GATEWAY_LIST_MAX_BURST"

	MaxNatRuleGetQPS      = "NAT_RULE_GET_MAX_QPS"
	MaxNatRuleGetBurst    = "NAT_RULE_GET_MAX_BURST"
	MaxNatRuleListQPS     = "NAT_RULE_LIST_MAX_QPS"
	MaxNatRuleListBurst   = "NAT_RULE_LIST_MAX_BURST"
	MaxNatRuleCreateQPS   = "NAT_RULE_CREATE_MAX_QPS"
	MaxNatRuleCreateBurst = "NAT_RULE_CREATE_MAX_BURST"
	MaxNatRuleDeleteQPS   = "NAT_RULE_DELETE_MAX_QPS"
	MaxNatRuleDeleteBurst = "NAT_RULE_DELETE_MAX_BURST"

	MaxEipBindQPS     = "EIP_BIND_MAX_QPS"
	MaxEipBindBurst   = "EIP_BIND_MAX_BURST"
	MaxEipCreateQPS   = "EIP_CREATE_MAX_QPS"
	MaxEipCreateBurst = "EIP_CREATE_MAX_BURST"
	MaxEipDeleteQPS   = "EIP_DELETE_MAX_QPS"
	MaxEipDeleteBurst = "EIP_DELETE_MAX_BURST"
	MaxEipListQPS     = "EIP_LIST_MAX_QPS"
	MaxEipListBurst   = "EIP_LIST_MAX_BURST"

	MaxSubnetGetQPS    = "SUBNET_GET_MAX_QPS"
	MaxSubnetGetBurst  = "SUBNET_GET_MAX_BURST"
	MaxSubnetListQPS   = "SUBNET_LIST_MAX_QPS"
	MaxSubnetListBurst = "SUBNET_LIST_MAX_BURST"
)
View Source
const (
	AnnotationsNATID string = "kubernetes.io/natgateway.id"
)
View Source
const (
	ClusterID string = "CLUSTER_ID"
)
View Source
const ELBDescFmt string = "[a-zA-Z0-9\\_\\-]{0,128}"

description: 0-128

View Source
const ELBNameFmt string = "[a-zA-Z\\_][a-zA-Z0-9\\_\\-]{0,63}"

Regular expressions name: 1-64

Variables

This section is empty.

Functions

func CheckNodeHealth

func CheckNodeHealth(node *v1.Node) (bool, error)

if the node not health, it will not be added to ELB

func DecodeBody

func DecodeBody(resp *http.Response, out interface{}) error

decodeBody is used to JSON decode a body

func DoRequest

func DoRequest(service *ServiceClient, throttle flowcontrol.RateLimiter, r *request) (*http.Response, error)

doRequest runs a request with our client

func GetHealthCheckPort

func GetHealthCheckPort(service *v1.Service) *v1.ServicePort

func GetListenerName

func GetListenerName(service *v1.Service) string

func GetOldListenerName

func GetOldListenerName(service *v1.Service) string

to suit for old version if the elb has been created with the old version its listener name is service.name+service.uid

func GetSessionAffinityOptions

func GetSessionAffinityOptions(service *v1.Service) string

func GetSessionAffinityType

func GetSessionAffinityType(service *v1.Service) string

func IsPodActive

func IsPodActive(p v1.Pod) bool

func IsValidBandwidth

func IsValidBandwidth(bandwidth int) bool

ELB bandwidth: 1-300

func IsValidDesc

func IsValidDesc(desc string) bool

func IsValidName

func IsValidName(name string) bool

func NewRequest

func NewRequest(method, url string, headersIn map[string]string, obj interface{}) *request

NewRequest is used to create a new request if accessIn == nil mean not to sign header

Types

type AccessInfo

type AccessInfo struct {
	Region        string
	AccessKey     string
	SecretKey     string
	SecurityToken string
	ServiceType   string
}

type AllowAddressPair

type AllowAddressPair struct {
	IpAddress  string `json:"ip_address,omitempty"`
	MacAddress string `json:"mac_address,omitempty"`
	OptName    string `json:"opt_name,omitempty"`
	OptValue   string `json:"opt_value,omitempty"`
}

type AsyncJobResp

type AsyncJobResp struct {
	Status   string `json:"status"`
	Entities struct {
		Elb struct {
			LoadbalancerId string `json:"id"`
		} `json:"elb"`
		Members []struct {
			Address string `json:"address"`
			ID      string `json:"id"`
		} `json:"members"`
	} `json:"entities"`
	FailReason string `json:"fail_reason"`
	ErrorCode  string `json:"error_code"`
}

Asynchronous job query response

type Basic added in v0.19.15

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

type CloudProvider added in v0.19.15

type CloudProvider struct {
	Basic
	// contains filtered or unexported fields
}

func NewHWSCloud

func NewHWSCloud(cfg io.Reader) (*CloudProvider, error)

func (*CloudProvider) Clusters added in v0.19.15

func (h *CloudProvider) Clusters() (cloudprovider.Clusters, bool)

Clusters returns an implementation of Clusters for Huawei Web Services.

func (*CloudProvider) EnsureLoadBalancer added in v0.19.15

func (h *CloudProvider) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

func (*CloudProvider) EnsureLoadBalancerDeleted added in v0.19.15

func (h *CloudProvider) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error

func (*CloudProvider) ExternalID added in v0.19.15

func (h *CloudProvider) ExternalID(ctx context.Context, instance types.NodeName) (string, error)

ExternalID returns the cloud provider ID of the specified instance (deprecated).

func (*CloudProvider) GetLoadBalancer added in v0.19.15

func (h *CloudProvider) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)

func (*CloudProvider) GetLoadBalancerName added in v0.19.15

func (h *CloudProvider) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string

func (*CloudProvider) HasClusterID added in v0.19.15

func (h *CloudProvider) HasClusterID() bool

HasClusterID returns true if the cluster has a clusterID

func (*CloudProvider) Initialize added in v0.19.15

func (h *CloudProvider) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})

Initialize provides the cloud with a kubernetes client builder and may spawn goroutines to perform housekeeping activities within the cloud provider.

func (*CloudProvider) Instances added in v0.19.15

func (h *CloudProvider) Instances() (cloudprovider.Instances, bool)

Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.

func (*CloudProvider) InstancesV2 added in v0.19.15

func (h *CloudProvider) InstancesV2() (cloudprovider.InstancesV2, bool)

InstancesV2 is an implementation for instances and should only be implemented by external cloud providers. Don't support this feature for now.

func (*CloudProvider) ListClusters added in v0.19.15

func (h *CloudProvider) ListClusters(ctx context.Context) ([]string, error)

ListClusters is an implementation of Clusters.ListClusters

func (*CloudProvider) LoadBalancer added in v0.19.15

func (h *CloudProvider) LoadBalancer() (cloudprovider.LoadBalancer, bool)

TCPLoadBalancer returns an implementation of TCPLoadBalancer for Huawei Web Services.

func (*CloudProvider) Master added in v0.19.15

func (h *CloudProvider) Master(ctx context.Context, clusterName string) (string, error)

Master is an implementation of Clusters.Master

func (*CloudProvider) ProviderName added in v0.19.15

func (h *CloudProvider) ProviderName() string

ProviderName returns the cloud provider ID.

func (*CloudProvider) Routes added in v0.19.15

func (h *CloudProvider) Routes() (cloudprovider.Routes, bool)

Routes returns an implementation of Routes for Huawei Web Services.

func (*CloudProvider) UpdateLoadBalancer added in v0.19.15

func (h *CloudProvider) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error

func (*CloudProvider) Zones added in v0.19.15

func (h *CloudProvider) Zones() (cloudprovider.Zones, bool)

Zones returns an implementation of Zones for Huawei Web Services.

type CreateEIPOptions added in v0.19.15

type CreateEIPOptions struct {
	BandwidthSize int32  `json:"bandwidth_size"`
	ShareType     string `json:"share_type"`
	ShareID       string `json:"share_id"`
	ChargeMode    string `json:"charge_mode"`

	IPType string `json:"ip_type"`
}

type DNATRule

type DNATRule struct {
	Id                  string         `json:"id,omitempty"`
	TenantId            string         `json:"tenant_id,omitempty"`
	NATGatewayId        string         `json:"nat_gateway_id,omitempty"`
	PortId              string         `json:"port_id,omitempty"`
	InternalServicePort int32          `json:"internal_service_port,omitempty"`
	FloatingIpId        string         `json:"floating_ip_id,omitempty"`
	ExternalServicePort int32          `json:"external_service_port,omitempty"`
	FloatingIpAddress   string         `json:"floating_ip_address,omitempty"`
	Protocol            NATProtocol    `json:"protocol,omitempty"`
	Status              DNATRuleStatus `json:"status,omitempty"`
	AdminStateUp        bool           `json:"admin_state_up,omitempty"`
	Description         string         `json:"description,omitempty"`
}

DNA Rule

type DNATRuleArr

type DNATRuleArr struct {
	DNATRule DNATRule `json:"dnat_rule"`
}

type DNATRuleDescription

type DNATRuleDescription struct {
	ClusterID   string `json:"cluster_id,omitempty"`
	Description string `json:"description,omitempty"`
}

type DNATRuleList

type DNATRuleList struct {
	DNATRules []DNATRule `json:"dnat_rules"`
}

list type

type DNATRuleStatus

type DNATRuleStatus string
const (
	DNATRuleStatusActive        DNATRuleStatus = "ACTIVE"
	DNATRuleStatusError         DNATRuleStatus = "ERROR"
	DNATRuleStatusPendingCreate DNATRuleStatus = "PENDING_CREATE"
	DNATRuleStatusPendingUpdate DNATRuleStatus = "PENDING_UPDATE"
	DNATRuleStatusPendingDelete DNATRuleStatus = "PENDING_DELETE"
)

type DedicatedLoadBalancer added in v0.20.2

type DedicatedLoadBalancer struct {
	Basic
}

func (*DedicatedLoadBalancer) EnsureLoadBalancer added in v0.20.2

func (d *DedicatedLoadBalancer) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

func (*DedicatedLoadBalancer) EnsureLoadBalancerDeleted added in v0.20.2

func (d *DedicatedLoadBalancer) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error

func (*DedicatedLoadBalancer) GetLoadBalancer added in v0.20.2

func (d *DedicatedLoadBalancer) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (
	*v1.LoadBalancerStatus, bool, error)

func (*DedicatedLoadBalancer) GetLoadBalancerName added in v0.20.2

func (d *DedicatedLoadBalancer) GetLoadBalancerName(_ context.Context, clusterName string, service *v1.Service) string

func (*DedicatedLoadBalancer) UpdateLoadBalancer added in v0.20.2

func (d *DedicatedLoadBalancer) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error

type DeleteFunc

type DeleteFunc func(string) error

type DeleteFuncWithObj

type DeleteFuncWithObj func(string, interface{}) error

type ELB

type ELB struct {
	// create ELB parameters
	Name         string  `json:"name"`
	Description  string  `json:"description,omitempty"`
	VpcID        string  `json:"vpc_id"`
	Bandwidth    int     `json:"bandwidth"`
	Type         ELBType `json:"type"`
	AdminStateUp int     `json:"admin_state_up"`
}

type ELBAlgorithm

type ELBAlgorithm string

type ELBClient

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

func NewELBClient

func NewELBClient(cloud, region, projectID, accessKey, secretKey string) *ELBClient

func (*ELBClient) AsyncCreateMembers

func (e *ELBClient) AsyncCreateMembers(listenerID string, memberConf []*Member) (*JobResp, error)

func (*ELBClient) AsyncDeleteMembers

func (e *ELBClient) AsyncDeleteMembers(listenerID string, memDel *MembersDel) (*JobResp, error)

AsyncDeleteMembers deletes members as type *MembersDel.

func (*ELBClient) CreateHealthCheck

func (e *ELBClient) CreateHealthCheck(healthConf *HealthCheck) (*HealthCheckRsp, error)

func (*ELBClient) CreateListener

func (e *ELBClient) CreateListener(listenerConf *Listener) (*ListenerRsp, *ErrorRsp, error)

func (*ELBClient) CreateLoadBalancer

func (e *ELBClient) CreateLoadBalancer(elbConf *ELB) (string, error)

Create an ELB instance 因为这个是通过portal创建的,所以无需API创建

func (*ELBClient) DeleteHealthCheck

func (e *ELBClient) DeleteHealthCheck(healthcheckID string) error

DeleteHealthCheck deletes a health check.

func (*ELBClient) DeleteListener

func (e *ELBClient) DeleteListener(listenerID string) error

func (*ELBClient) DeleteLoadBalancer

func (e *ELBClient) DeleteLoadBalancer(loadbalancerID string) error

DeleteLoadBalancer deletes loadbalancer by ID.

func (*ELBClient) DeleteMembers

func (e *ELBClient) DeleteMembers(listenerID string) error

members as type *MembersDel

func (*ELBClient) DeregisterInstancesFromListener

func (e *ELBClient) DeregisterInstancesFromListener(listenerID string, memDel *MembersDel) error

members as type *MembersDel

func (*ELBClient) GetHealthCheck

func (e *ELBClient) GetHealthCheck(healthcheckID string) (*HealthCheckDetail, *ErrorRsp, error)

GetHealthCheck gets health check details info.

func (*ELBClient) GetJobStatus

func (e *ELBClient) GetJobStatus(jobID string) (*AsyncJobResp, error)

func (*ELBClient) GetListener

func (e *ELBClient) GetListener(listenerID string) (*ListenerDetail, error)

func (*ELBClient) GetLoadBalancer

func (e *ELBClient) GetLoadBalancer(loadbalancerID string) (*ElbDetail, error)

GetLoadBalancer gets an ELB instance by ID.

func (*ELBClient) ListListeners

func (e *ELBClient) ListListeners(loadbalancerID string) ([]*ListenerDetail, error)

func (*ELBClient) ListLoadBalancers

func (e *ELBClient) ListLoadBalancers(params map[string]string) (*ElbList, error)

ListLoadBalancers list ELBs.

func (*ELBClient) ListMachines

func (e *ELBClient) ListMachines() (*EcsServers, error)

GetEcsByIp get hws ecs server by IP address

func (*ELBClient) ListMembers

func (e *ELBClient) ListMembers(listenerID string) ([]*MemDetail, error)

func (*ELBClient) ModifyElb

func (e *ELBClient) ModifyElb(elbConf *ELB) (*ELB, error)

func (*ELBClient) Quota

func (e *ELBClient) Quota() (*Quota, error)

func (*ELBClient) RegisterInstancesWithListener

func (e *ELBClient) RegisterInstancesWithListener(listenerID string, memberConf []*Member) (*AsyncJobResp, error)

func (*ELBClient) UpdateHealthCheck

func (e *ELBClient) UpdateHealthCheck(healthConf *HealthCheck, healthcheckID string) (*HealthCheckRsp, error)

func (*ELBClient) UpdateListener

func (e *ELBClient) UpdateListener(listener *Listener, listenerID string) (*ListenerDetail, error)

func (*ELBClient) WaitJobComplete

func (e *ELBClient) WaitJobComplete(jobID string) error

func (*ELBClient) WaitMemberComplete

func (e *ELBClient) WaitMemberComplete(listenerID string, newMembers []*Member) error

type ELBCloud

type ELBCloud struct {
	Basic
}

func (*ELBCloud) ELBClient

func (elb *ELBCloud) ELBClient() (*ELBClient, error)

getELBClient

func (*ELBCloud) EnsureLoadBalancer

func (elb *ELBCloud) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, hosts []*v1.Node) (*v1.LoadBalancerStatus, error)

EnsureTCPLoadBalancer is an implementation of TCPLoadBalancer.EnsureTCPLoadBalancer. EnsureLoadBalancer creates a new load balancer 'name', or updates the existing one. Returns the status of the balancer Implementations must treat the *v1.Service and *v1.Node parameters as read-only and not modify them.

func (*ELBCloud) EnsureLoadBalancerDeleted

func (elb *ELBCloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error

EnsureTCPLoadBalancerDeleted is an implementation of TCPLoadBalancer.EnsureTCPLoadBalancerDeleted.

func (*ELBCloud) GetLoadBalancer

func (elb *ELBCloud) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)

GetLoadBalancer gets loadbalancer for service.

func (*ELBCloud) GetLoadBalancerName

func (elb *ELBCloud) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string

Not implemented

func (*ELBCloud) UpdateLoadBalancer

func (elb *ELBCloud) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, hosts []*v1.Node) error

UpdateTCPLoadBalancer is an implementation of TCPLoadBalancer.UpdateTCPLoadBalancer. if update return failed, the caller must backup the failed service and try to update again.

type ELBProtocol

type ELBProtocol string

type ELBStickySessionType

type ELBStickySessionType string

sticky_session_type

const (
	ELBStickySessionTypeInsert ELBStickySessionType = "insert"
	ELBStickySessionTypeServer ELBStickySessionType = "server"
)

type ELBType

type ELBType string

type EcsAddress

type EcsAddress struct {
	Addr string `json:"addr"`
}

Ecs address

type EcsServers

type EcsServers struct {
	Servers []Server `json:"servers,omitempty"`
}

Ecs servicers deatil

type ElbDetail

type ElbDetail struct {
	ELB
	VipAddress     string `json:"vip_address"`
	CreateTime     string `json:"create_time"`
	Status         string `json:"status"`
	LoadbalancerId string `json:"id"`
	VipSubnetId    string `json:"vip_subnet_id,omitempty"`
}

type ElbList

type ElbList struct {
	InstanceNum   string      `json:"instance_num"`
	Loadbalancers []ElbDetail `json:"loadbalancers,omitempty"`
}

type ElbNum

type ElbNum struct {
	InstanceNum string `json:"instance_num"`
}

TODO: unmarshal failed, if return instance_num=0 body: {"loadbalancers":{},"instance_num":"0"}

type ErrorRsp

type ErrorRsp struct {
	Error struct {
		Message string      `json:"message"`
		Code    LbErrorCode `json:"code"`
	} `json:"error"`
}

type FixedIp

type FixedIp struct {
	SubnetId  string `json:"subnet_id,omitempty"`
	IpAddress string `json:"ip_address"`
}

type FloatingIp

type FloatingIp struct {
	Id                string           `json:"id,omitempty"`
	Status            FloatingIpStatus `json:"status,omitempty"`
	FloatingIpAddress string           `json:"floating_ip_address,omitempty"`
	FloatingNetworkId string           `json:"floating_network_id,omitempty"`
	RouterId          string           `json:"router_id,omitempty"`
	PortId            string           `json:"port_id,omitempty"`
	FixedIpAddress    string           `json:"fixed_ip_address,omitempty"`
	TenantId          string           `json:"tenant_id,omitempty"`
}

type FloatingIpArr

type FloatingIpArr struct {
	FloatingIp FloatingIp `json:"floatingip"`
}

type FloatingIpList

type FloatingIpList struct {
	FloatingIps []FloatingIp `json:"floatingips,omitempty"`
}

type FloatingIpStatus

type FloatingIpStatus string
const (
	FloatingIpStatusActive FloatingIpStatus = "ACTIVE"
	FloatingIpStatusError  FloatingIpStatus = "ERROR"
	FloatingIpStatusDown   FloatingIpStatus = "DOWN"
)

type HealthCheck

type HealthCheck struct {
	// create Listener parameters
	ListenerID             string      `json:"listener_id,omitempty"`
	HealthcheckProtocol    ELBProtocol `json:"healthcheck_protocol"`
	HealthcheckURI         string      `json:"healthcheck_uri,omitempty"`
	HealthcheckConnectPort int         `json:"healthcheck_connect_port"`
	HealthyThreshold       int         `json:"healthy_threshold"`
	UnhealthyThreshold     int         `json:"unhealthy_threshold"`
	HealthcheckTimeout     int         `json:"healthcheck_timeout"`
	HealthcheckInterval    int         `json:"healthcheck_interval"`
}

HealthCheck

type HealthCheckDetail

type HealthCheckDetail struct {
	HealthCheckRsp
	HealthcheckStatus string `json:"healthcheck_status,omitempty"`
	CreateTime        string `json:"create_time"`
}

type HealthCheckRsp

type HealthCheckRsp struct {
	HealthCheck
	ID       string `json:"id,omitempty"`
	TenantID string `json:"tenant_id,omitempty"`
}

type Instances

type Instances struct {
	Basic
}

func (*Instances) AddSSHKeyToAllInstances

func (i *Instances) AddSSHKeyToAllInstances(_ context.Context, _ string, _ []byte) error

AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances expected format for the key is standard ssh-keygen format: <protocol> <blob>

func (*Instances) CurrentNodeName

func (i *Instances) CurrentNodeName(_ context.Context, hostname string) (types.NodeName, error)

CurrentNodeName returns the name of the node we are currently running on On most clouds (e.g. GCE) this is the hostname, so we provide the hostname

func (*Instances) InstanceExists added in v0.19.15

func (i *Instances) InstanceExists(ctx context.Context, node *v1.Node) (bool, error)

InstanceExists returns true if the instance for the given node exists according to the cloud provider.

func (*Instances) InstanceExistsByProviderID

func (i *Instances) InstanceExistsByProviderID(_ context.Context, providerID string) (bool, error)

InstanceExistsByProviderID returns true if the instance for the given provider exists.

func (*Instances) InstanceID

func (i *Instances) InstanceID(_ context.Context, name types.NodeName) (string, error)

InstanceID returns the cloud provider ID of the node with the specified NodeName.

func (*Instances) InstanceMetadata added in v0.19.15

func (i *Instances) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovider.InstanceMetadata, error)

InstanceMetadata returns the instance's metadata. The values returned in InstanceMetadata are translated into specific fields in the Node object on registration.

func (*Instances) InstanceShutdown added in v0.19.15

func (i *Instances) InstanceShutdown(ctx context.Context, node *v1.Node) (bool, error)

InstanceShutdown returns true if the instance is shutdown according to the cloud provider.

func (*Instances) InstanceShutdownByProviderID

func (i *Instances) InstanceShutdownByProviderID(_ context.Context, providerID string) (bool, error)

InstanceShutdownByProviderID returns true if the instance is shutdown in cloudprovider

func (*Instances) InstanceType

func (i *Instances) InstanceType(_ context.Context, name types.NodeName) (string, error)

InstanceType returns the type of the specified instance.

func (*Instances) InstanceTypeByProviderID

func (i *Instances) InstanceTypeByProviderID(_ context.Context, providerID string) (string, error)

InstanceTypeByProviderID returns the type of the specified instance.

func (*Instances) NodeAddresses

func (i *Instances) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)

NodeAddresses returns the addresses of the specified instance.

func (*Instances) NodeAddressesByProviderID

func (i *Instances) NodeAddressesByProviderID(_ context.Context, providerID string) ([]v1.NodeAddress, error)

NodeAddressesByProviderID returns the addresses of the specified instance.

type JobResp

type JobResp struct {
	JobID string `json:"job_id"`
	Uri   string `json:"uri"`
}

create job response

type LbErrorCode

type LbErrorCode string
const (
	ElbError6091 LbErrorCode = "ELB.6091" //create listener failed: ELB already has 5 listeners
	ElbError2012 LbErrorCode = "ELB.2012" //backend server does not exist
	ElbError1101 LbErrorCode = "ELB.1101" //invalid parameter: vip_address already exists
	ElbError6101 LbErrorCode = "ELB.6101" //create listener failed: duplicated port
	ElbError7020 LbErrorCode = "ELB.7020" //healthcheck is not exist
)

type Listener

type Listener struct {
	// create Listener parameters
	ListenerModify
	LoadbalancerID    string               `json:"loadbalancer_id,omitempty"`
	Protocol          ELBProtocol          `json:"protocol,omitempty"`
	Port              int                  `json:"port,omitempty"`
	BackendProtocol   ELBProtocol          `json:"backend_protocol,omitempty"`
	BackendPort       int                  `json:"backend_port,omitempty"`
	LBAlgorithm       ELBAlgorithm         `json:"lb_algorithm,omitempty"`
	SSLCertificate    string               `json:"ssl_certificate,omitempty"`
	SessionSticky     bool                 `json:"session_sticky"`
	StickySessionType ELBStickySessionType `json:"sticky_session_type,omitempty"`
	CookieTimeout     time.Duration        `json:"cookie_timeout,omitempty"`
	TCPTimeout        int                  `json:"tcp_timeout,omitempty"`
}

Listener

type ListenerDetail

type ListenerDetail struct {
	ListenerModify
	LoadbalancerID    string               `json:"loadbalancer_id"`
	Protocol          ELBProtocol          `json:"protocol"`
	Port              int                  `json:"port"`
	BackendProtocol   ELBProtocol          `json:"backend_protocol"`
	BackendPort       int                  `json:"backend_port"`
	LBAlgorithm       ELBAlgorithm         `json:"lb_algorithm"`
	SSLCertificate    string               `json:"ssl_certificate,omitempty"`
	SessionSticky     bool                 `json:"session_sticky,omitempty"`
	StickySessionType ELBStickySessionType `json:"sticky_session_type,omitempty"`
	CookieTimeout     time.Duration        `json:"cookie_timeout,omitempty"`
	ID                string               `json:"id"`
	TenantID          string               `json:"tenant_id"`
	Status            string               `json:"status"`
	CreateTime        string               `json:"create_time"`
	HealthcheckID     string               `json:"healthcheck_id"`
	TCPTimeout        int                  `json:"tcp_timeout,omitempty"`
}

type ListenerModify

type ListenerModify struct {
	Name         string `json:"name,omitempty"`
	AdminStateUp bool   `json:"admin_state_up,omitempty"`
	Description  string `json:"description,omitempty"`
}

type ListenerRsp

type ListenerRsp struct {
	Listener
	ID            string `json:"id"`
	TenantID      string `json:"tenant_id"`
	Status        string `json:"status"`
	CreateTime    string `json:"create_time"`
	HealthcheckID string `json:"healthcheck_id"`
}

type LoadBalanceVersion

type LoadBalanceVersion int
const (
	VersionNotNeedLB LoadBalanceVersion = iota // if the service type is not LoadBalancer
	VersionELB                                 // classic load balancer
	VersionShared                              // enhanced load balancer(performance share)
	VersionDedicated                           // enhanced load balancer(performance guarantee)
	VersionNAT                                 // network address translation
)

type LoadBalancerServiceListener added in v0.20.4

type LoadBalancerServiceListener struct {
	Basic
	// contains filtered or unexported fields
}

type MemDetail

type MemDetail struct {
	Member
	ServerAddress string              `json:"server_address"`
	ID            string              `json:"id"`
	Status        string              `json:"status"`
	Listeners     []map[string]string `json:"listeners"`
	ServerName    string              `json:"server_name"`
	// NORMAL, ABNORMAL, UNAVAILABLE
	HealthStatus string `json:"health_status"`
}

type Member

type Member struct {
	// create Member parameters
	ListenerID string `json:"listener_id,omitempty"`
	ServerID   string `json:"server_id"`
	Address    string `json:"address"`
}

Backend host Member

type MemberRm

type MemberRm struct {
	ID      string `json:"id"`
	Address string `json:"address"`
}

type MembersDel

type MembersDel struct {
	RemoveMember []MemberRm `json:"removeMember"`
}

type NATArr

type NATArr struct {
	NATGateway NATGateway `json:"nat_gateway"`
}

type NATClient

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

NAT client has two parts: ecsClient connect EcsEndpoint natClient connect natClient

func NewNATClient

func NewNATClient(cloud, region, projectID, accessKey, secretKey string) *NATClient

func (*NATClient) CreateDNATRule

func (nat *NATClient) CreateDNATRule(dnatRuleConf *DNATRule) (*DNATRule, error)

func (*NATClient) DeleteDNATRule

func (nat *NATClient) DeleteDNATRule(dnatRuleId string, natGatewayId string) error

func (*NATClient) GetDNATRule

func (nat *NATClient) GetDNATRule(dnatRuleId string) (*DNATRule, error)

func (*NATClient) GetNATGateway

func (nat *NATClient) GetNATGateway(natGatewayId string) (*NATGateway, error)

* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> * NAT implement of functions regrding NAT gateway * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

func (*NATClient) GetPort

func (nat *NATClient) GetPort(portId string) (*Port, error)

func (*NATClient) ListDNATRules

func (nat *NATClient) ListDNATRules(params map[string]string) (*DNATRuleList, error)

func (*NATClient) ListFloatings

func (nat *NATClient) ListFloatings(params map[string]string) (*FloatingIpList, error)

func (*NATClient) ListNATGateways

func (nat *NATClient) ListNATGateways(params map[string]string) (*NATGatewayList, error)

func (*NATClient) ListPorts

func (nat *NATClient) ListPorts(params map[string]string) (*PortList, error)

type NATCloud

type NATCloud struct {
	Basic
}

func (*NATCloud) EnsureLoadBalancer

func (nat *NATCloud) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, hosts []*v1.Node) (*v1.LoadBalancerStatus, error)

* clusterName: discarded * service: each service has its corresponding DNAT rule * nodes: all nodes under ServiceController, i.e. all nodes under the k8s cluster

func (*NATCloud) EnsureLoadBalancerDeleted

func (nat *NATCloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error

delete all DNATRules under a service

(1) find the DNAT rules of the service
(2) delete the DNAT rule

func (*NATCloud) GetLoadBalancer

func (nat *NATCloud) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)

func (*NATCloud) GetLoadBalancerName

func (nat *NATCloud) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string

* Not implemented

func (*NATCloud) UpdateLoadBalancer

func (nat *NATCloud) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error

update members in the service

(1) find the previous DNATRule
(2) check whether the node whose port set in the rule is health
(3) if not health delete the previous and create a new one

type NATGateway

type NATGateway struct {
	Id                string    `json:"id,omitempty"`
	Name              string    `json:"name,omitempty"`
	Description       string    `json:"description,omitempty"`
	RouterId          string    `json:"router_id,omitempty"`
	InternalNetWorkId string    `json:"internal_network_id,omitempty"`
	Status            NATStatus `json:"status,omitempty"`
	Spec              NATSpec   `json:"spec,omitempty"`
	TenantId          string    `json:"tenant_id,omitempty"`
	AdminStateUp      bool      `json:"admin_state_up,omitempty"`
}

NAT Gateway

type NATGatewayList

type NATGatewayList struct {
	NATGateways []NATGateway `json:"nat_gateways"`
}

list type

type NATProtocol

type NATProtocol string
const (
	NATProtocolTCP NATProtocol = "TCP"
	NATProtocolUDP NATProtocol = "UDP"
)

type NATSpec

type NATSpec string
const (
	NATSpecSmall      NATSpec = "1"
	NATSpecMedium     NATSpec = "2"
	NATSpecLarge      NATSpec = "3"
	NATSpecExtraLarge NATSpec = "4"
)

type NATStatus

type NATStatus string
const (
	NATStatusActive        NATStatus = "ACTIVE"
	NATStatusError         NATStatus = "ERROR"
	NATStatusPendingCreate NATStatus = "PENDING_CREATE"
	NATStatusPendingUpdate NATStatus = "PENDING_UPDATE"
	NATStatusPendingDelete NATStatus = "PENDING_DELETE"
)

type Port

type Port struct {
	Id                  string              `json:"id,omitempty"`
	Name                string              `json:"name,omitempty"`
	NetworkId           string              `json:"network_id,omitempty"`
	AdminStateUp        bool                `json:"admin_state_up,omitempty"`
	MacAddress          string              `json:"mac_address,omitempty"`
	FixedIps            []*FixedIp          `json:"fixed_ips,omitempty"`
	DeviceId            string              `json:"device_id,omitempty"`
	DeviceOwner         string              `json:"device_owner,omitempty"`
	TenantId            string              `json:"tenant_id,omitempty"`
	Status              PortStatus          `json:"status,omitempty"`
	SecurityGroups      []string            `json:"security_groups,omitempty"`
	AllowedAddressPairs []*AllowAddressPair `json:"allow_address_pairs,omitempty"`
}

type PortArr

type PortArr struct {
	Port Port `json:"port"`
}

type PortList

type PortList struct {
	Ports []Port `json:"ports,omitempty"`
}

type PortStatus

type PortStatus string
const (
	PortStatusActive PortStatus = "ACTIVE"
	PortStatusBuild  PortStatus = "BUILD"
	PortStatusDown   PortStatus = "DOWN"
)

type Quota

type Quota struct {
	Quotas struct {
		Resources []QuotaResource `json:"resources"`
	} `json:"quotas"`
}

Quota

type QuotaResource

type QuotaResource struct {
	Type  string `json:"type"`
	Used  int    `json:"used"`
	Quota int    `json:"quota"`
}

type Server

type Server struct {
	Id        string                  `json:"id"`
	Name      string                  `json:"name"`
	Addresses map[string][]EcsAddress `json:"addresses,omitempty"`
}

EcsServer ecs server info

type ServiceClient

type ServiceClient struct {
	Client   *http.Client
	Endpoint string
	Access   *AccessInfo
	TenantId string // nolint:golint // struct field `TenantId` should be `TenantID`
}

type SharedLoadBalancer added in v0.19.15

type SharedLoadBalancer struct {
	Basic
}

func (*SharedLoadBalancer) EnsureLoadBalancer added in v0.19.15

func (l *SharedLoadBalancer) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

EnsureLoadBalancer creates a new load balancer 'name', or updates the existing one. Returns the status of the balancer

func (*SharedLoadBalancer) EnsureLoadBalancerDeleted added in v0.19.15

func (l *SharedLoadBalancer) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error

EnsureLoadBalancerDeleted deletes the specified load balancer

func (*SharedLoadBalancer) GetLoadBalancer added in v0.19.15

func (l *SharedLoadBalancer) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)

func (*SharedLoadBalancer) GetLoadBalancerName added in v0.19.15

func (l *SharedLoadBalancer) GetLoadBalancerName(_ context.Context, clusterName string, service *v1.Service) string

GetLoadBalancerName returns the name of the load balancer. Implementations must treat the *v1.Service parameter as read-only and not modify it.

func (*SharedLoadBalancer) UpdateLoadBalancer added in v0.19.15

func (l *SharedLoadBalancer) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error

UpdateLoadBalancer updates hosts under the specified load balancer.

type ThrottleConfig

type ThrottleConfig struct {
	Throttles map[string]ThrottleParam `json:"throttles"`
}

type ThrottleParam

type ThrottleParam struct {
	QPS   float32 `json:"qps"`
	Burst int     `json:"burst"`
}

type ThrottleType

type ThrottleType string
const (
	/* 二代ELB限流器配置 */
	ELB_INSTANCE_GET    ThrottleType = "ELB_INSTANCE_GET"
	ELB_INSTANCE_LIST   ThrottleType = "ELB_INSTANCE_LIST"
	ELB_INSTANCE_CREATE ThrottleType = "ELB_INSTANCE_CREATE"
	ELB_INSTANCE_DELETE ThrottleType = "ELB_INSTANCE_DELETE"

	ELB_LISTENER_GET    ThrottleType = "ELB_LISTENER_GET"
	ELB_LISTENER_LIST   ThrottleType = "ELB_LISTENER_LIST"
	ELB_LISTENER_CREATE ThrottleType = "ELB_LISTENER_CREATE"
	ELB_LISTENER_UPDATE ThrottleType = "ELB_LISTENER_UPDATE"
	ELB_LISTENER_DELETE ThrottleType = "ELB_LISTENER_DELETE"

	ELB_POOL_GET    ThrottleType = "ELB_POOL_GET"
	ELB_POOL_LIST   ThrottleType = "ELB_POOL_LIST"
	ELB_POOL_CREATE ThrottleType = "ELB_POOL_CREATE"
	ELB_POOL_UPDATE ThrottleType = "ELB_POOL_UPDATE"
	ELB_POOL_DELETE ThrottleType = "ELB_POOL_DELETE"

	ELB_MEMBER_GET    ThrottleType = "ELB_MEMBER_GET"
	ELB_MEMBER_LIST   ThrottleType = "ELB_MEMBER_LIST"
	ELB_MEMBER_CREATE ThrottleType = "ELB_MEMBER_CREATE"
	ELB_MEMBER_UPDATE ThrottleType = "ELB_MEMBER_UPDATE"
	ELB_MEMBER_DELETE ThrottleType = "ELB_MEMBER_DELETE"

	ELB_WHITELIST_GET    ThrottleType = "ELB_WHITELIST_GET"
	ELB_WHITELIST_LIST   ThrottleType = "ELB_WHITELIST_LIST"
	ELB_WHITELIST_CREATE ThrottleType = "ELB_WHITELIST_CREATE"
	ELB_WHITELIST_UPDATE ThrottleType = "ELB_WHITELIST_UPDATE"
	ELB_WHITELIST_DELETE ThrottleType = "ELB_WHITELIST_DELETE"

	ELB_HEALTHZ_GET    ThrottleType = "ELB_HEALTHZ_GET"
	ELB_HEALTHZ_LIST   ThrottleType = "ELB_HEALTHZ_LIST"
	ELB_HEALTHZ_CREATE ThrottleType = "ELB_HEALTHZ_CREATE"
	ELB_HEALTHZ_UPDATE ThrottleType = "ELB_HEALTHZ_UPDATE"
	ELB_HEALTHZ_DELETE ThrottleType = "ELB_HEALTHZ_DELETE"

	/* NAT网关限流器配置 */
	NAT_GATEWAY_GET  ThrottleType = "NAT_GATEWAY_GET"
	NAT_GATEWAY_LIST ThrottleType = "NAT_GATEWAY_LIST"

	NAT_RULE_GET    ThrottleType = "NAT_RULE_GET"
	NAT_RULE_LIST   ThrottleType = "NAT_RULE_LIST"
	NAT_RULE_CREATE ThrottleType = "NAT_RULE_CREATE"
	NAT_RULE_DELETE ThrottleType = "NAT_RULE_DELETE"

	EIP_BIND   ThrottleType = "EIP_BIND"
	EIP_CREATE ThrottleType = "EIP_CREATE"
	EIP_DELETE ThrottleType = "EIP_DELETE"
	EIP_LIST   ThrottleType = "EIP_LIST"

	SUBNET_GET  ThrottleType = "SUBNET_GET"
	SUBNET_LIST ThrottleType = "SUBNET_LIST"

	/* ECS限流器配置 */
	ECS_LIST ThrottleType = "ECS_LIST"
)

type Throttler

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

func InitialThrottler

func InitialThrottler() (*Throttler, error)

func (*Throttler) GetThrottleByKey

func (t *Throttler) GetThrottleByKey(key ThrottleType) flowcontrol.RateLimiter

Directories

Path Synopsis
nolint: golint
nolint: golint
model
nolint: golint
nolint: golint

Jump to

Keyboard shortcuts

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