blb

package
v0.0.0-...-5b6f272 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Endpoint = map[string]string{
	"bj": "blb.bj.baidubce.com",
	"gz": "blb.gz.baidubce.com",
	"su": "blb.su.baidubce.com",
	"hk": "blb.hkg.baidubce.com",
	"bd": "blb.bd.baidubce.com",
}

Endpoint contains all endpoints of Baidu Cloud BCC.

Functions

This section is empty.

Types

type AddBackendServersArgs

type AddBackendServersArgs struct {
	LoadBalancerId    string          `json:"-"`
	BackendServerList []BackendServer `json:"backendServerList"`
}

type BackendServer

type BackendServer struct {
	InstanceId string `json:"instanceId"`
	Weight     int    `json:"weight,omitempty"`
}

type BackendServerStatus

type BackendServerStatus struct {
	InstanceId string `json:"instanceId"`
	Weight     int    `json:"weight"`
	Status     string `json:"status"`
}

type Client

type Client struct {
	*bce.Client
}

Client is the BLB client implemention for Baidu Cloud BLB API.

func NewBLBClient

func NewBLBClient(config *bce.Config) *Client

func (*Client) AddBackendServers

func (c *Client) AddBackendServers(args *AddBackendServersArgs, option *bce.SignOption) error

func (*Client) CreateHTTPListener

func (c *Client) CreateHTTPListener(args *CreateHTTPListenerArgs, option *bce.SignOption) (err error)

CreateHTTPListener create HTTP listener on loadbalancer

You can read doc at https://cloud.baidu.com/doc/BLB/API.html#.D7.A3.9B.E1.45.BD.9E.FA.B0.2F.60.12.B3.39.E8.9D

func (*Client) CreateLoadBalancer

func (c *Client) CreateLoadBalancer(args *CreateLoadBalancerArgs, option *bce.SignOption) (*CreateLoadBalancerResponse, error)

CreateLoadBalancer Create a loadbalancer TODO: args need to validate

func (*Client) CreateTCPListener

func (c *Client) CreateTCPListener(args *CreateTCPListenerArgs, option *bce.SignOption) (err error)

CreateLoadBalancerHTTPListener create HTTP listener on loadbalancer You can read doc at https://cloud.baidu.com/doc/BLB/API.html#.C0.F3.F3.ED.5C.D8.4D.66.19.FF.DA.7A.0F.75.05.7C

func (*Client) CreateUDPListener

func (c *Client) CreateUDPListener(args *CreateUDPListenerArgs, option *bce.SignOption) (err error)

CreateLoadBalancerUDPListener create UDP listener on loadbalancer

You can read doc at https://cloud.baidu.com/doc/BLB/API.html#.D7.A3.9B.E1.45.BD.9E.FA.B0.2F.60.12.B3.39.E8.9D

func (*Client) DeleteListeners

func (c *Client) DeleteListeners(args *DeleteListenersArgs, option *bce.SignOption) error

UpdateUDPListener update a UDPListener

func (*Client) DeleteLoadBalancer

func (c *Client) DeleteLoadBalancer(args *DeleteLoadBalancerArgs, option *bce.SignOption) error

DeleteLoadBalancer delete a loadbalancer

func (*Client) DescribeBackendServers

func (c *Client) DescribeBackendServers(args *DescribeBackendServersArgs, option *bce.SignOption) ([]BackendServer, error)

func (*Client) DescribeLoadBalancers

func (c *Client) DescribeLoadBalancers(args *DescribeLoadBalancersArgs, option *bce.SignOption) ([]LoadBalancer, error)

DescribeLoadBalancers Describe loadbalancers TODO: args need to validate

func (*Client) DescribeTCPListener

func (c *Client) DescribeTCPListener(args *DescribeTCPListenerArgs, option *bce.SignOption) ([]TCPListener, error)

DescribeTCPListener Describe TCPListener TODO: args need to validate

func (*Client) DescribeUDPListener

func (c *Client) DescribeUDPListener(args *DescribeUDPListenerArgs, option *bce.SignOption) ([]UDPListener, error)

DescribeUDPListeners Describe UDPListeners TODO: args need to validate

func (*Client) GetURL

func (c *Client) GetURL(version string, params map[string]string) string

GetURL generates the full URL of http request for Baidu Cloud BLB API.

func (*Client) RemoveBackendServers

func (c *Client) RemoveBackendServers(args *RemoveBackendServersArgs, option *bce.SignOption) error

RemoveBackendServers remove a BackendServers

func (*Client) UpdateBackendServers

func (c *Client) UpdateBackendServers(args *UpdateBackendServersArgs, option *bce.SignOption) error

UpdateBackendServers update BackendServers

func (*Client) UpdateLoadBalancer

func (c *Client) UpdateLoadBalancer(args *UpdateLoadBalancerArgs, option *bce.SignOption) error

UpdateLoadBalancer update a loadbalancer TODO: args need to validate

func (*Client) UpdateTCPListener

func (c *Client) UpdateTCPListener(args *UpdateTCPListenerArgs, option *bce.SignOption) error

UpdateTCPListener update a TCPListener TODO: args need to validate

func (*Client) UpdateUDPListener

func (c *Client) UpdateUDPListener(args *UpdateUDPListenerArgs, option *bce.SignOption) error

UpdateUDPListener update a UDPListener

type CreateHTTPListenerArgs

type CreateHTTPListenerArgs struct {
	LoadBalancerId             string `json:"-"`
	ListenerPort               int    `json:"listenerPort"`
	BackendPort                int    `json:"backendPort"`
	Scheduler                  string `json:"scheduler"`
	KeepSession                bool   `json:"keepSession,omitempty"`
	KeepSessionType            string `json:"keepSessionType,omitempty"`
	KeepSessionDuration        int    `json:"keepSessionDuration,omitempty"`
	KeepSessionCookieName      int    `json:"keepSessionCookieName,omitempty"`
	XForwardFor                bool   `json:"xForwardFor,omitempty"`
	HealthCheckType            string `json:"healthCheckType,omitempty"`
	HealthCheckPort            int    `json:"healthCheckPort,omitempty"`
	HealthCheckURI             string `json:"healthCheckURI,omitempty"`
	HealthCheckTimeoutInSecond int    `json:"healthCheckTimeoutInSecond,omitempty"`
	HealthCheckInterval        int    `json:"healthCheckInterval,omitempty"`
	UnhealthyThreshold         int    `json:"unhealthyThreshold,omitempty"`
	HealthyThreshold           int    `json:"healthyThreshold,omitempty"`
	HealthCheckNormalStatus    string `json:"healthCheckNormalStatus,omitempty"`
	ServerTimeout              int    `json:"serverTimeout,omitempty"`
	RedirectPort               int    `json:"redirectPort,omitempty"`
}

type CreateLoadBalancerArgs

type CreateLoadBalancerArgs struct {
	Desc     string `json:"desc,omitempty"`
	Name     string `json:"name,omitempty"`
	VpcID    string `json:"vpcId,omitempty"`
	SubnetID string `json:"subnetId,omitempty"`
}

CreateLoadBalancerArgs create blb args

type CreateLoadBalancerResponse

type CreateLoadBalancerResponse struct {
	LoadBalancerId string `json:"blbId"`
	Address        string `json:"address"`
	Desc           string `json:"desc,omitempty"`
	Name           string `json:"name"`
}

type CreateTCPListenerArgs

type CreateTCPListenerArgs struct {
	LoadBalancerId             string `json:"-"`
	ListenerPort               int    `json:"listenerPort"`
	BackendPort                int    `json:"backendPort"`
	Scheduler                  string `json:"scheduler"`
	HealthCheckTimeoutInSecond int    `json:"healthCheckTimeoutInSecond,omitempty"`
	HealthCheckInterval        int    `json:"healthCheckInterval,omitempty"`
	UnhealthyThreshold         int    `json:"unhealthyThreshold,omitempty"`
	HealthyThreshold           int    `json:"healthyThreshold,omitempty"`
}

type CreateUDPListenerArgs

type CreateUDPListenerArgs struct {
	LoadBalancerId             string `json:"-"`
	ListenerPort               int    `json:"listenerPort"`
	BackendPort                int    `json:"backendPort"`
	Scheduler                  string `json:"scheduler"`
	HealthCheckTimeoutInSecond int    `json:"healthCheckTimeoutInSecond,omitempty"`
	HealthCheckInterval        int    `json:"healthCheckInterval,omitempty"`
	UnhealthyThreshold         int    `json:"unhealthyThreshold,omitempty"`
	HealthyThreshold           int    `json:"healthyThreshold,omitempty"`
	HealthCheckString          string `json:"healthCheckString"`
}

type DeleteListenersArgs

type DeleteListenersArgs struct {
	LoadBalancerId string `json:"-"`
	// action         string `json:"-"`
	PortList []int `json:"portList"`
}

type DeleteLoadBalancerArgs

type DeleteLoadBalancerArgs struct {
	LoadBalancerId string `json:"blbId"`
}

type DescribeBackendServersArgs

type DescribeBackendServersArgs struct {
	LoadBalancerId string `json:"-"`
}

type DescribeBackendServersResponse

type DescribeBackendServersResponse struct {
	Marker            string          `json:"marker"`
	IsTruncated       bool            `json:"isTruncated"`
	NextMarker        string          `json:"nextMarker"`
	MaxKeys           int             `json:"maxKeys"`
	BackendServerList []BackendServer `json:"backendServerList"`
}

type DescribeLoadBalancersArgs

type DescribeLoadBalancersArgs struct {
	LoadBalancerId   string
	LoadBalancerName string
	BCCId            string
	Address          string
}

type DescribeLoadBalancersResponse

type DescribeLoadBalancersResponse struct {
	Marker      string         `json:"marker"`
	IsTruncated bool           `json:"isTruncated"`
	NextMarker  string         `json:"nextMarker"`
	MaxKeys     int            `json:"maxKeys"`
	BLBList     []LoadBalancer `json:"blbList"`
}

type DescribeTCPListenerArgs

type DescribeTCPListenerArgs struct {
	LoadBalancerId string
	ListenerPort   int
}

type DescribeTCPListenerResponse

type DescribeTCPListenerResponse struct {
	Marker          string        `json:"marker"`
	IsTruncated     bool          `json:"isTruncated"`
	NextMarker      string        `json:"nextMarker"`
	MaxKeys         int           `json:"maxKeys"`
	TCPListenerList []TCPListener `json:"listenerList"`
}

type DescribeUDPListenerArgs

type DescribeUDPListenerArgs struct {
	LoadBalancerId string
	ListenerPort   int
}

type DescribeUDPListenerResponse

type DescribeUDPListenerResponse struct {
	Marker          string        `json:"marker"`
	IsTruncated     bool          `json:"isTruncated"`
	NextMarker      string        `json:"nextMarker"`
	MaxKeys         int           `json:"maxKeys"`
	UDPListenerList []UDPListener `json:"listenerList"`
}

type HTTPListener

type HTTPListener struct {
	ListenerPort               int    `json:"listenerPort"`
	BackendPort                int    `json:"backendPort"`
	Scheduler                  string `json:"scheduler"`
	KeepSession                bool   `json:"keepSession"`
	KeepSessionType            string `json:"keepSessionType"`
	KeepSessionDuration        int    `json:"keepSessionDuration"`
	KeepSessionCookieName      int    `json:"keepSessionCookieName"`
	XForwardFor                bool   `json:"xForwardFor"`
	HealthCheckType            string `json:"healthCheckType"`
	HealthCheckPort            int    `json:"healthCheckPort"`
	HealthCheckURI             string `json:"healthCheckURI"`
	HealthCheckTimeoutInSecond int    `json:"healthCheckTimeoutInSecond"`
	HealthCheckInterval        int    `json:"healthCheckInterval"`
	UnhealthyThreshold         int    `json:"unhealthyThreshold"`
	HealthyThreshold           int    `json:"healthyThreshold"`
	HealthCheckNormalStatus    string `json:"healthCheckNormalStatus"`
	ServerTimeout              int    `json:"serverTimeout"`
	RedirectPort               int    `json:"redirectPort"`
}

type HTTPSListener

type HTTPSListener struct {
	ListenerPort               int      `json:"listenerPort"`
	BackendPort                int      `json:"backendPort"`
	Scheduler                  string   `json:"scheduler"`
	KeepSession                bool     `json:"keepSession"`
	KeepSessionType            string   `json:"keepSessionType"`
	KeepSessionDuration        int      `json:"keepSessionDuration"`
	KeepSessionCookieName      int      `json:"keepSessionCookieName"`
	XForwardFor                bool     `json:"xForwardFor"`
	HealthCheckType            string   `json:"healthCheckType"`
	HealthCheckPort            int      `json:"healthCheckPort"`
	HealthCheckURI             string   `json:"healthCheckURI"`
	HealthCheckTimeoutInSecond int      `json:"healthCheckTimeoutInSecond"`
	HealthCheckInterval        int      `json:"healthCheckInterval"`
	UnhealthyThreshold         int      `json:"unhealthyThreshold"`
	HealthyThreshold           int      `json:"healthyThreshold"`
	HealthCheckNormalStatus    string   `json:"healthCheckNormalStatus"`
	ServerTimeout              int      `json:"serverTimeout"`
	CertIds                    []string `json:"certIds"`
	Ie6Compatible              bool     `json:"ie6Compatible"`
}

type LoadBalancer

type LoadBalancer struct {
	BlbId    string `json:"blbId"`
	Name     string `json:"name"`
	Desc     string `json:"desc"`
	Address  string `json:"address"`
	Status   string `json:"status"`
	PublicIp string `json:"publicIp"`
}

type RemoveBackendServersArgs

type RemoveBackendServersArgs struct {
	LoadBalancerId    string   `json:"-"`
	BackendServerList []string `json:"backendServerList"`
}

type TCPListener

type TCPListener struct {
	ListenerPort               int    `json:"listenerPort"`
	BackendPort                int    `json:"backendPort"`
	Scheduler                  string `json:"scheduler"`
	HealthCheckTimeoutInSecond int    `json:"healthCheckTimeoutInSecond"`
	HealthCheckInterval        int    `json:"healthCheckInterval"`
	UnhealthyThreshold         int    `json:"unhealthyThreshold"`
	HealthyThreshold           int    `json:"healthyThreshold"`
}

type UDPListener

type UDPListener struct {
	ListenerPort               int    `json:"listenerPort"`
	BackendPort                int    `json:"backendPort"`
	Scheduler                  string `json:"scheduler"`
	HealthCheckTimeoutInSecond int    `json:"healthCheckTimeoutInSecond"`
	HealthCheckInterval        int    `json:"healthCheckInterval"`
	UnhealthyThreshold         int    `json:"unhealthyThreshold"`
	HealthyThreshold           int    `json:"healthyThreshold"`
	HealthCheckString          string `json:"healthCheckString"`
}

type UpdateBackendServersArgs

type UpdateBackendServersArgs struct {
	LoadBalancerId    string          `json:"-"`
	BackendServerList []BackendServer `json:"backendServerList"`
}

type UpdateLoadBalancerArgs

type UpdateLoadBalancerArgs struct {
	LoadBalancerId string `json:"blbId"`
	Desc           string `json:"desc,omitempty"`
	Name           string `json:"name,omitempty"`
}

type UpdateTCPListenerArgs

type UpdateTCPListenerArgs struct {
	LoadBalancerId             string `json:"-"`
	ListenerPort               int    `json:"-"`
	BackendPort                int    `json:"backendPort,omitempty"`
	Scheduler                  string `json:"scheduler,omitempty"`
	HealthCheckTimeoutInSecond int    `json:"healthCheckTimeoutInSecond,omitempty"`
	HealthCheckInterval        int    `json:"healthCheckInterval,omitempty"`
	UnhealthyThreshold         int    `json:"unhealthyThreshold,omitempty"`
	HealthyThreshold           int    `json:"healthyThreshold,omitempty"`
}

type UpdateUDPListenerArgs

type UpdateUDPListenerArgs struct {
	LoadBalancerId             string `json:"-"`
	ListenerPort               int    `json:"listenerPort"`
	BackendPort                int    `json:"backendPort"`
	Scheduler                  string `json:"scheduler"`
	HealthCheckTimeoutInSecond int    `json:"healthCheckTimeoutInSecond,omitempty"`
	HealthCheckInterval        int    `json:"healthCheckInterval,omitempty"`
	UnhealthyThreshold         int    `json:"unhealthyThreshold,omitempty"`
	HealthyThreshold           int    `json:"healthyThreshold,omitempty"`
	HealthCheckString          string `json:"healthCheckString"`
}

Jump to

Keyboard shortcuts

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