blb

package
v0.0.0-...-0a82f0e Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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"`
}

AddBackendServersArgs json

type BackendServer

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

BackendServer json

type BackendServerStatus

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

BackendServerStatus json

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

NewBLBClient new a client for BLB

func (*Client) AddBackendServers

func (c *Client) AddBackendServers(args *AddBackendServersArgs) error

AddBackendServers add backend server

func (*Client) CreateHTTPListener

func (c *Client) CreateHTTPListener(args *CreateHTTPListenerArgs) (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) (*CreateLoadBalancerResponse, error)

CreateLoadBalancer Create a loadbalancer TODO: args need to validate

func (*Client) CreateTCPListener

func (c *Client) CreateTCPListener(args *CreateTCPListenerArgs) (err error)

CreateTCPListener 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) (err error)

CreateUDPListener 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) error

DeleteListeners update a UDPListener

func (*Client) DeleteLoadBalancer

func (c *Client) DeleteLoadBalancer(args *DeleteLoadBalancerArgs) error

DeleteLoadBalancer delete a loadbalancer

func (*Client) DescribeBackendServers

func (c *Client) DescribeBackendServers(args *DescribeBackendServersArgs) ([]BackendServer, error)

DescribeBackendServers describe backend server

func (*Client) DescribeLoadBalancers

func (c *Client) DescribeLoadBalancers(args *DescribeLoadBalancersArgs) ([]LoadBalancer, error)

DescribeLoadBalancers Describe loadbalancers TODO: args need to validate

func (*Client) DescribeTCPListener

func (c *Client) DescribeTCPListener(args *DescribeTCPListenerArgs) ([]TCPListener, error)

DescribeTCPListener Describe TCPListener TODO: args need to validate

func (*Client) DescribeUDPListener

func (c *Client) DescribeUDPListener(args *DescribeUDPListenerArgs) ([]UDPListener, error)

DescribeUDPListener 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) error

RemoveBackendServers remove a BackendServers

func (*Client) UpdateBackendServers

func (c *Client) UpdateBackendServers(args *UpdateBackendServersArgs) error

UpdateBackendServers update BackendServers

func (*Client) UpdateLoadBalancer

func (c *Client) UpdateLoadBalancer(args *UpdateLoadBalancerArgs) error

UpdateLoadBalancer update a loadbalancer TODO: args need to validate

func (*Client) UpdateTCPListener

func (c *Client) UpdateTCPListener(args *UpdateTCPListenerArgs) error

UpdateTCPListener update a TCPListener TODO: args need to validate

func (*Client) UpdateUDPListener

func (c *Client) UpdateUDPListener(args *UpdateUDPListenerArgs) 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"`
}

CreateHTTPListenerArgs json

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"`
}

CreateLoadBalancerResponse json

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"`
}

CreateTCPListenerArgs json

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"`
}

CreateUDPListenerArgs json

type DeleteListenersArgs

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

DeleteListenersArgs json

type DeleteLoadBalancerArgs

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

DeleteLoadBalancerArgs json

type DescribeBackendServersArgs

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

DescribeBackendServersArgs 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"`
}

DescribeBackendServersResponse json

type DescribeLoadBalancersArgs

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

DescribeLoadBalancersArgs json

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"`
}

DescribeLoadBalancersResponse json

type DescribeTCPListenerArgs

type DescribeTCPListenerArgs struct {
	LoadBalancerId string
	ListenerPort   int
}

DescribeTCPListenerArgs json

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"`
}

DescribeTCPListenerResponse json

type DescribeUDPListenerArgs

type DescribeUDPListenerArgs struct {
	LoadBalancerId string
	ListenerPort   int
}

DescribeUDPListenerArgs json

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"`
}

DescribeUDPListenerResponse json

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"`
}

HTTPListener json

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"`
}

HTTPSListener json

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"`
}

LoadBalancer json

type RemoveBackendServersArgs

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

RemoveBackendServersArgs json

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"`
}

TCPListener json

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"`
}

UDPListener json

type UpdateBackendServersArgs

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

UpdateBackendServersArgs json

type UpdateLoadBalancerArgs

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

UpdateLoadBalancerArgs json

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"`
}

UpdateTCPListenerArgs json

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"`
}

UpdateUDPListenerArgs json

Jump to

Keyboard shortcuts

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