General-purpose BLB instance

BLB BLB

  • API Reference
    • Access control
    • API Service Domain Name
    • Appendix
    • Application BLB Interface
      • Application BLB Instance Related Interfaces
      • Application BLB Listener Related Interfaces
      • Application BLB Security Group Related Interfaces
      • Application BLB Server Group Related Interfaces
    • Application IPv6 BLB Interface
      • Application IPv6 BLB Instance Related Interfaces
      • Application IPv6 BLB Listener Related Interfaces
      • Application IPv6 BLB Security Group Related Interfaces
      • Application IPv6 BLB Server Group Related Interfaces
    • BLB Order Related Interfaces
      • BLB - Resize
      • BLB Charge Shift - Cancel Prepay to Postpay
      • BLB Charge Shift - Postpay to Prepay
      • BLB Charge Shift - Prepay to Postpay
      • BLB Inquiry
      • BLB Unsubscribe Interface
    • Document Update Records
    • Error code
    • Interface Specifications
    • Introduction
    • Load Balancer Dedicated Cluster LBDC Interface
      • LBDC Instance Related Interfaces
    • Service Publishing Point Interface
      • Service Publishing Point Related Interfaces
    • Standard BLB Interface
      • Standard BLB Instance Related Interfaces
      • Standard BLB Listener Related Interfaces
      • Standard BLB Real Server Related Interfaces
      • Standard BLB Security Group Related Interfaces
    • Standard IPv6 BLB Interface
      • Standard IPv6 BLB Related Interfaces
  • FAQs
    • Billing Problems
    • Common Questions Overview
    • Configuration-related questions
    • Fault-related questions
    • General Problems
    • Load Balancer Dedicated Cluster Related Issues
    • Performance-related questions
    • Security Problems
  • Function Release Records
  • Operation guide
    • Access control
    • Access Logs
    • Application BLB instance
    • Application IPv6 Instance
    • BLB metric description
    • Certification
    • Custom configuration
    • Extended domain name
    • General-purpose BLB instance
      • Creating BLB Ordinary Instance
      • Managing BLB Ordinary Instance
    • General-purpose IPv6 BLB instance
    • Identity and access management
    • IP Group Usage Guide
    • Load Balance Dedicated Cluster
    • Load Balancer Frontend and Backend Protocol Correspondence
    • Recording Access Logs Using VPC Flow Logs
    • Service Release Point
    • Tag Management
  • Product Description
    • Application scenarios
    • Basic Architecture
    • Basic concepts
    • Performance Specification Description
    • Product advantages
    • Product features
    • Product Introduction
    • Usage restrictions
  • Product pricing
    • Load Balancer Dedicated Cluster Billing
    • Load Balancer Instance Billing
  • Quick Start
  • SDK
    • GO-SDK
      • Application BLB Instance
      • Initialization
      • Install
      • IPv6 BLB Instance
      • Load Balance Dedicated Cluster (LBDC)
      • Ordinary BLB Instance
      • Overview
      • Service Release Point
      • Version Change Records
    • Java-SDK
      • Application BLB instance
      • General-purpose BLB instance
      • Initialization
      • Install the SDK Package
      • IPv6 BLB Instance
      • Load Balance Dedicated Cluster (LBDC)
      • Overview
      • Service Release Point
      • Version Update Description
    • PHP-SDK
      • Initialization
      • Install
      • Ordinary BLB Instance
      • Overview
    • Python-SDK
      • Application BLB Instance
      • Initialization
      • Install
      • IPv6 BLB Instance
      • Load Balance Dedicated Cluster (LBDC)
      • Ordinary BLB Instance
      • Overview
      • Service Release Point
      • Version Update Description
  • Service Level Agreement (SLA)
    • Description of Baidu AI Cloud Load Balancer Trusted Cloud certification service availability
    • LBDC Service Level Agreement SLA
    • BLB Service Level Agreement (V2.0)
  • Typical Practices
    • BLB Selection Guide
    • Health Check Exception Troubleshooting
    • Implementing BLB Association with Listeners, Real Servers, Security Groups, etc. via Terraform
    • Implementing Multi-Site Hosting via Application BLB
    • Load Balancer Security Protection Strategy
    • Managing BLB via Terraform
    • Obtaining Client Information via Application BLB Instance
    • Using IP Group Function to Mount Real Servers Across VPCs in Different Regions
    • Using IP Group Function to Mount Real Servers Across VPCs in the Same Region
All documents
menu
No results found, please re-enter

BLB BLB

  • API Reference
    • Access control
    • API Service Domain Name
    • Appendix
    • Application BLB Interface
      • Application BLB Instance Related Interfaces
      • Application BLB Listener Related Interfaces
      • Application BLB Security Group Related Interfaces
      • Application BLB Server Group Related Interfaces
    • Application IPv6 BLB Interface
      • Application IPv6 BLB Instance Related Interfaces
      • Application IPv6 BLB Listener Related Interfaces
      • Application IPv6 BLB Security Group Related Interfaces
      • Application IPv6 BLB Server Group Related Interfaces
    • BLB Order Related Interfaces
      • BLB - Resize
      • BLB Charge Shift - Cancel Prepay to Postpay
      • BLB Charge Shift - Postpay to Prepay
      • BLB Charge Shift - Prepay to Postpay
      • BLB Inquiry
      • BLB Unsubscribe Interface
    • Document Update Records
    • Error code
    • Interface Specifications
    • Introduction
    • Load Balancer Dedicated Cluster LBDC Interface
      • LBDC Instance Related Interfaces
    • Service Publishing Point Interface
      • Service Publishing Point Related Interfaces
    • Standard BLB Interface
      • Standard BLB Instance Related Interfaces
      • Standard BLB Listener Related Interfaces
      • Standard BLB Real Server Related Interfaces
      • Standard BLB Security Group Related Interfaces
    • Standard IPv6 BLB Interface
      • Standard IPv6 BLB Related Interfaces
  • FAQs
    • Billing Problems
    • Common Questions Overview
    • Configuration-related questions
    • Fault-related questions
    • General Problems
    • Load Balancer Dedicated Cluster Related Issues
    • Performance-related questions
    • Security Problems
  • Function Release Records
  • Operation guide
    • Access control
    • Access Logs
    • Application BLB instance
    • Application IPv6 Instance
    • BLB metric description
    • Certification
    • Custom configuration
    • Extended domain name
    • General-purpose BLB instance
      • Creating BLB Ordinary Instance
      • Managing BLB Ordinary Instance
    • General-purpose IPv6 BLB instance
    • Identity and access management
    • IP Group Usage Guide
    • Load Balance Dedicated Cluster
    • Load Balancer Frontend and Backend Protocol Correspondence
    • Recording Access Logs Using VPC Flow Logs
    • Service Release Point
    • Tag Management
  • Product Description
    • Application scenarios
    • Basic Architecture
    • Basic concepts
    • Performance Specification Description
    • Product advantages
    • Product features
    • Product Introduction
    • Usage restrictions
  • Product pricing
    • Load Balancer Dedicated Cluster Billing
    • Load Balancer Instance Billing
  • Quick Start
  • SDK
    • GO-SDK
      • Application BLB Instance
      • Initialization
      • Install
      • IPv6 BLB Instance
      • Load Balance Dedicated Cluster (LBDC)
      • Ordinary BLB Instance
      • Overview
      • Service Release Point
      • Version Change Records
    • Java-SDK
      • Application BLB instance
      • General-purpose BLB instance
      • Initialization
      • Install the SDK Package
      • IPv6 BLB Instance
      • Load Balance Dedicated Cluster (LBDC)
      • Overview
      • Service Release Point
      • Version Update Description
    • PHP-SDK
      • Initialization
      • Install
      • Ordinary BLB Instance
      • Overview
    • Python-SDK
      • Application BLB Instance
      • Initialization
      • Install
      • IPv6 BLB Instance
      • Load Balance Dedicated Cluster (LBDC)
      • Ordinary BLB Instance
      • Overview
      • Service Release Point
      • Version Update Description
  • Service Level Agreement (SLA)
    • Description of Baidu AI Cloud Load Balancer Trusted Cloud certification service availability
    • LBDC Service Level Agreement SLA
    • BLB Service Level Agreement (V2.0)
  • Typical Practices
    • BLB Selection Guide
    • Health Check Exception Troubleshooting
    • Implementing BLB Association with Listeners, Real Servers, Security Groups, etc. via Terraform
    • Implementing Multi-Site Hosting via Application BLB
    • Load Balancer Security Protection Strategy
    • Managing BLB via Terraform
    • Obtaining Client Information via Application BLB Instance
    • Using IP Group Function to Mount Real Servers Across VPCs in Different Regions
    • Using IP Group Function to Mount Real Servers Across VPCs in the Same Region
  • Document center
  • arrow
  • BLBBLB
  • arrow
  • SDK
  • arrow
  • Java-SDK
  • arrow
  • General-purpose BLB instance
Table of contents on this page
  • Retrieve Endpoint
  • Retrieve AK/SK
  • Create a BlbClient
  • Create BLB Instance
  • Query existing BLB instances
  • Query BLB instance details
  • Update BLB instance
  • Delete BLB instance
  • Update BLB instance ACL Function
  • Create TCP listener
  • Create UDP listener
  • Create HTTP listener
  • Create HTTPS listener
  • Create SSL listener
  • Query TCP listener
  • Query UDP listener
  • Query HTTP listener
  • Query HTTPS listener
  • Query SSL listener
  • Query all the listeners
  • Update TCP listener
  • Update UDP listener
  • Update HTTP listener
  • Update HTTPS listener
  • Update SSL listener
  • Delete listener
  • Add real server
  • Query real server health status
  • Query real server list
  • Update a real server
  • Delete real server
  • Bind to regular security group
  • Unbind from regular security group
  • Query regular security group list of BLB instances
  • Bind enterprise security group
  • Unbind enterprise security group
  • Query the enterprise security group list of BLB instances
  • Appendix

General-purpose BLB instance

Updated at:2025-10-16

Retrieve Endpoint

Before configuring the Endpoint for SDK usage, please refer to the developer guide section on BLB Service Domain Name to understand Endpoint-related concepts. Baidu AI Cloud currently supports multiple regions. Please refer to the network product BLB section in Region Selection Guide.

Note: The Baidu Load Balance (BLB) API supports both HTTP and HTTPS calling methods. To enhance data security, it is recommended to call via HTTPS.

Retrieve AK/SK

To use Baidu Load Balancer (BLB) on Baidu AI Cloud, you need a valid AK (Access Key ID) and SK (Secret Access Key) for signature authentication. AK/SK are system-generated strings that identify users and authenticate service access. You can find and understand your AK/SK information through the following steps:

  1. Register a Baidu AI Cloud account
  2. Create AK/SK

Create a BlbClient

BlbClient serves as the client for the Baidu Load Balance (BLB) services, providing developers with a range of methods to interact with Baidu Load Balance (BLB) services. When creating a new BlbClient, first configure a BceClientConfiguration-type config instance using Endpoint, AK and SK, and then use the config instance to configure the BlbClient. The specific configuration method is as follows:

Plain Text
1static final String ENDPOINT = ""
2static final String AK = "";
3static final String SK = "";
4BlbClientConfiguration config = new BlbClientConfiguration();
5config.setCredentials(new DefaultBceCredentials(ak, sk));
6config.setEndpoint(endpoint);
7BlbClient blbClient = new BlbClient(config);

Create BLB Instance

Function declaration

Plain Text
1public CreateBlbResponse createBlb(String name, String desc, String vpcId, String subnetId) {
2}
3public CreateBlbResponse createBlb(CreateBlbRequest createBlbRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: createloadbalancer: Create Instance Request Parameter

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "blbId": "lb-BLuOPSLZ",
4    "name": "blb-for-test",
5    "address": "192.168.0.24",
6	"desc": "myblb"
7}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleCreateBlb.java

Query existing BLB instances

Function declaration

Plain Text
1public ListBlbResponse listBlbs(String address, String name, String blbId, String bccId) {
2}
3public ListBlbResponse listBlbs(ListBlbRequest listBlbRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: describeloadbalancers: Query Existing BLB Instance Request Parameter

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "blbList": [
4        {
5            "blbId": "lb-a7e5zPPk",
6            "status": available,
7            "name": "test-blb",
8			"desc": desc,
9            "address": "192.168.0.23"
10        },
11        {
12            "blbId": "lb-gj5gVpeq",
13            "status": available,
14            "name": "nametest",
15			"desc": desc,
16            "address": "192.168.0.24",
17			"publicIp": "123.2.3.4"
18        }
19    ],
20    "marker": "blb-0A20F971",
21    "nextMarker": "blb-0A20FB09",
22    "isTruncated": true,
23    "maxKeys": 2
24}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListBlbs.java

Query BLB instance details

Function declaration

Plain Text
1public BlbInstance blbDetail(BlbDetailRequest request) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: describeloadbalancerdetail: Query BLB Instance Detail Request Parameter

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "blbId":"lb-gj5gVpeq",
4    "status":"available",
5    "name":"nametest",
6    "desc":"",     
7    "address":"192.168.0.2",
8    "publicIp":"123.2.3.4",
9    "cidr":"192.168.0.0/16",
10    "vpcName":"test",         
11    "createTime":"2019-03-07T02:35:31Z",    
12    "releaseTime":"2019-03-07T02:35:31Z",   
13    "listener":[                            
14        {
15            "port":80,                      
16            "backendPort":90,               
17            "type": "TCP",                  
18            "healthCheckType": "TCP",       
19            "healthCheckstatus": "Alive"       
20        }
21    ]
22}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleBlbDetail.java

Update BLB instance

Function declaration

Plain Text
1public void modifyBlbAttributes(String blbId, String name, String desc) {
2}
3public void modifyBlbAttributes(ModifyBlbAttributesRequest modifyBlbAttributesRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: updateloadbalancer: Update Instance Request Parameter

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleModifyBlbAttributes.java

Delete BLB instance

Function declaration

Plain Text
1public void deleteBlb(String blbId) {
2}
3public void deleteBlb(DeleteBlbRequest deleteBlbRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: deleteloadbalancer: Delete BLB Instance Request Parameter

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleDeleteBlb.java

Update BLB instance ACL Function

Function declaration

Plain Text
1public void updateLoadBalancerAcl(UpdateLoadBalancerAclRequest request) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: updateloadbalanceracl: Update Request Parameter of Instance ACL Function

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleUpdateLoadBalancerAcl.java

Create TCP listener

Function declaration

Plain Text
1public void createListener(BlbListenerRequest blbListenerRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: createtcplistener: Create TCP Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleCreateTcpListener.java

Create UDP listener

Function declaration

Plain Text
1public void createListener(BlbListenerRequest blbListenerRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: createudplistener: Create UDP Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleCreateUdpListener.java

Create HTTP listener

Function declaration

Plain Text
1public void createListener(BlbListenerRequest blbListenerRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: createhttplistener: Create HTTP Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleCreateHttpListener.java

Create HTTPS listener

Function declaration

Plain Text
1public void createListener(BlbListenerRequest blbListenerRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: createhttpslistener: Create HTTPS Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleCreateHttpsListener.java

Create SSL listener

Function declaration

Plain Text
1public void createListener(BlbListenerRequest blbListenerRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: createssllistener: Create SSL Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleCreateSslListener.java

Query TCP listener

Function declaration

Plain Text
1public ListListenerResponse<TcpListener> listTcpListener(String blbId) {
2}
3public ListListenerResponse listListener(ListListenerRequest listListenerRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: describetcplisteners: Query TCP Listener Request Parameters

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "listenerList": [
4        {
5            "listenerPort": 80,
6            "backendPort": 80,
7            "scheduler": "RoundRobin",
8            "healthCheckTimeoutInSecond": 3,
9            "healthCheckInterval": 3,
10            "unhealthyThreshold": 3,
11            "healthyThreshold": 3
12        },
13        {
14            "listenerPort": 88,
15            "backendPort": 88,
16            "scheduler": "RoundRobin",
17            "healthCheckTimeoutInSecond": 2,
18            "healthCheckInterval": 4,
19            "unhealthyThreshold": 3,
20            "healthyThreshold": 3
21        }
22    ],
23    "marker": "listener-0050",
24    "nextMarker": null,
25    "isTruncated": false,
26    "maxKeys": 2
27}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListTcpListener.java

Query UDP listener

Function declaration

Plain Text
1public ListListenerResponse<UdpListener> listUdpListener(String blbId) {
2}
3public ListListenerResponse listListener(ListListenerRequest listListenerRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: describeudplisteners: Query UDP Listener Request Parameters

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "listenerList": [
4        {
5            "listenerPort": 80,
6            "backendPort": 80,
7            "scheduler": "RoundRobin",
8            "healthCheckType": "UDP",
9            "healthCheckTimeoutInSecond": 3,
10            "healthCheckInterval": 3,
11            "unhealthyThreshold": 3,
12            "healthyThreshold": 3,
13			"healthCheckString":"healthCheck",
14            "udpSessionTimeout":90
15        },
16        {
17            "listenerPort": 88,
18            "backendPort": 88,
19            "scheduler": "RoundRobin",
20            "healthCheckType": "UDP",
21            "healthCheckTimeoutInSecond": 2,
22            "healthCheckInterval": 4,
23            "unhealthyThreshold": 3,
24            "healthyThreshold": 3,
25			"healthCheckString":"healthCheck",
26            "udpSessionTimeout": 90
27        }
28    ],
29    "marker": "listener-0050",
30    "nextMarker": null,
31    "isTruncated": false,
32    "maxKeys": 2
33}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListUdpListener.java

Query HTTP listener

Function declaration

Plain Text
1public ListListenerResponse<HttpListener> listHttpListener(String blbId) {
2}
3public ListListenerResponse listListener(ListListenerRequest listListenerRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: describehttplisteners: Query HTTP Listener Request Parameters

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "listenerList": [
4        {
5            "listenerPort": 90,
6            "backendPort": 90,
7            "scheduler": "LeastConnection",
8            "healthCheckTimeoutInSecond": 4,
9            "healthCheckInterval": 5,
10            "unhealthyThreshold": 2,
11            "healthyThreshold": 3,
12            "keepSession": false,
13            "keepSessionType": null,
14            "keepSessionDuration": null,
15            "keepSessionCookieName": null,
16            "xForwardFor": false,
17            "healthCheckType": "HTTP",
18            "healthCheckPort": 90,
19            "healthCheckURI": "/",
20            "healthCheckNormalStatus": "http_2xx|http_3xx",
21            "serverTimeout": 30,
22			"redirectPort": 80
23        },
24        {
25            "listenerPort": 95,
26            "backendPort": 95,
27            "scheduler": "LeastConnection",
28            "healthCheckTimeoutInSecond": 4,
29            "healthCheckInterval": 5,
30            "unhealthyThreshold": 2,
31            "healthyThreshold": 3,
32            "keepSession": false,
33            "keepSessionType": null,
34            "keepSessionDuration": null,
35            "keepSessionCookieName": null,
36            "xForwardFor": false,
37            "healthCheckType": "HTTP",
38            "healthCheckPort": 95,
39            "healthCheckURI": "/",
40            "healthCheckNormalStatus": "http_1xx|http_2xx",
41            "serverTimeout": 1800,
42			"redirectPort": 80
43        }
44    ],
45    "marker": "listener-005A",
46    "nextMarker": "listener-0322",
47    "isTruncated": true,
48    "maxKeys": 2
49}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListHttpListener.java

Query HTTPS listener

Function declaration

Plain Text
1public ListListenerResponse<HttpsListener> listHttpsListener(String blbId) {
2}
3public ListListenerResponse listListener(ListListenerRequest listListenerRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: describehttpslisteners: Query HTTP Listener Request Parameters

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "listenerList": [
4        {
5            "listenerPort": 90,
6            "backendPort": 90,
7            "scheduler": "LeastConnection",
8            "healthCheckTimeoutInSecond": 4,
9            "healthCheckInterval": 5,
10            "unhealthyThreshold": 2,
11            "healthyThreshold": 3,
12            "keepSession": false,
13            "keepSessionType": null,
14            "keepSessionDuration": null,
15            "keepSessionCookieName": null,
16            "xForwardFor": false,
17            "healthCheckType": "HTTP",
18            "healthCheckPort": 90,
19            "healthCheckURI": "/",
20            "healthCheckNormalStatus": "http_2xx|http_3xx",
21            "serverTimeout": 30,
22			"certIds": ["cert-zfj2ey2z4kmm"]
23        },
24        {
25            "listenerPort": 95,
26            "backendPort": 95,
27            "scheduler": "LeastConnection",
28            "healthCheckTimeoutInSecond": 4,
29            "healthCheckInterval": 5,
30            "unhealthyThreshold": 2,
31            "healthyThreshold": 3,
32            "keepSession": false,
33            "keepSessionType": null,
34            "keepSessionDuration": null,
35            "keepSessionCookieName": null,
36            "xForwardFor": false,
37            "healthCheckType": "HTTP",
38            "healthCheckPort": 95,
39            "healthCheckURI": "/",
40            "healthCheckNormalStatus": "http_1xx|http_2xx",
41            "serverTimeout": 1800,
42			"certIds": ["cert-zfj2ey2z4kmm"]
43        }
44    ],
45    "marker": "listener-005A",
46    "nextMarker": "listener-0322",
47    "isTruncated": true,
48    "maxKeys": 2
49}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleCreateHttpsListener.java

Query SSL listener

Function declaration

Plain Text
1public ListListenerResponse<SslListener> listSslListener(String blbId) {
2}
3public ListListenerResponse listListener(ListListenerRequest listListenerRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: describessllisteners: Query SSL Listener Request Parameters

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "listenerList": [
4        {
5            "listenerPort": 80,
6            "backendPort": 80,
7            "scheduler": "RoundRobin",
8            "healthCheckTimeoutInSecond": 3,
9            "healthCheckInterval": 3,
10            "unhealthyThreshold": 3,
11            "healthyThreshold": 3
12        },
13        {
14            "listenerPort": 88,
15            "backendPort": 88,
16            "scheduler": "RoundRobin",
17            "healthCheckTimeoutInSecond": 2,
18            "healthCheckInterval": 4,
19            "unhealthyThreshold": 3,
20            "healthyThreshold": 3
21        }
22    ],
23    "marker": "listener-0050",
24    "nextMarker": null,
25    "isTruncated": false,
26    "maxKeys": 2
27}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListSslListener.java

Query all the listeners

Function declaration

Plain Text
1public ListListenerResponse<AllListener> listAllListener(String blbId) {
2}
3public ListListenerResponse<AllListener> listAllListener(ListAllListenerRequest request) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: describealllisteners: Query All Listener Request Parameters

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3      "marker" : "listener-0035",
4      "isTruncated" : false,
5      "maxKeys" : 1000,
6      "listenerList" : [ {
7        "listenerPort" : 53,
8        "backendPort" : 53,
9        "backendPortType" : "UDP",
10        "scheduler" : "RoundRobin",
11        "healthCheckTimeoutInSecond" : 3,
12        "healthCheckInterval" : 3,
13        "unhealthyThreshold" : 3,
14        "healthyThreshold" : 3,
15        "getBlbIp" : false,
16        "healthCheckValid" : 1,
17        "listenerType" : "UDP",
18        "udpSessionTimeout" : 30,
19        "healthCheckString" : "\\00\\01\\01\\00\\00\\01\\00\\00\\00\\00\\00\\00\\05baidu\\03com\\00\\00\\01\\00\\01",
20        "healthCheckType" : "UDP"
21      }, {
22        "listenerPort" : 80,
23        "backendPort" : 80,
24        "backendPortType" : "TCP",
25        "scheduler" : "RoundRobin",
26        "healthCheckTimeoutInSecond" : 3,
27        "healthCheckInterval" : 3,
28        "unhealthyThreshold" : 3,
29        "healthyThreshold" : 3,
30        "getBlbIp" : false,
31        "healthCheckValid" : 1,
32        "listenerType" : "TCP",
33        "tcpSessionTimeout" : 900
34      }, {
35        "listenerPort" : 81,
36        "backendPort" : 80,
37        "backendPortType" : "HTTP",
38        "scheduler" : "RoundRobin",
39        "healthCheckTimeoutInSecond" : 3,
40        "healthCheckInterval" : 3,
41        "unhealthyThreshold" : 3,
42        "healthyThreshold" : 3,
43        "getBlbIp" : false,
44        "healthCheckValid" : 1,
45        "listenerType" : "HTTP",
46        "keepSession" : false,
47        "xForwardFor" : true,
48        "healthCheckType" : "HTTP",
49        "healthCheckPort" : 80,
50        "healthCheckURI" : "/",
51        "healthCheckNormalStatus" : "http_2xx|http_3xx",
52        "healthCheckHost" : "",
53        "serverTimeout" : 30,
54        "redirectPort" : 0
55      } ]
56}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListAllListener.java

Update TCP listener

Function declaration

Plain Text
1public void modifyListenerAttributes(BlbListenerRequest modifyListenerAttributesRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: updatetcplistener: Update TCP Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleUpdateTcpListener.java

Update UDP listener

Function declaration

Plain Text
1public void modifyListenerAttributes(BlbListenerRequest modifyListenerAttributesRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: updateudplistener: Update UDP Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleUpdateUdpListener.java

Update HTTP listener

Function declaration

Plain Text
1public void modifyListenerAttributes(BlbListenerRequest modifyListenerAttributesRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: updatehttplistener: Update HTTP Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleUpdateHttpListener.java

Update HTTPS listener

Function declaration

Plain Text
1public void modifyListenerAttributes(BlbListenerRequest modifyListenerAttributesRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: updatehttpslistener: Update HTTPS Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleUpdateHttpsListener.java

Update SSL listener

Function declaration

Plain Text
1public void modifyListenerAttributes(BlbListenerRequest modifyListenerAttributesRequest) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: updatessllistener: Update SSL Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleUpdateSslListener.java

Delete listener

Function declaration

Plain Text
1public void deleteListener(String blbId, List<Integer> portList) {
2}
3public void deleteListener(DeleteListenerRequest deleteListenerRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: deletelisteners: Delete Listener Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleDeleteListeners.java

Add real server

Function declaration

Plain Text
1public void addBackendServers(String blbId, List<BackendServer> backendServerList) {
2}
3public void addBackendServers(AddBackendServersRequest addBackendServersRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: addbackendservers: Add Real Server Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleAddBackendServers.java

Query real server health status

Function declaration

Plain Text
1public ListBackendServerStatusResponse listBackendServerStatus(String blbId, int listenerPort) {
2}
3public ListBackendServerStatusResponse listBackendServerStatus(ListBackendServerStatusRequest listBackendServerStatusRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: describehealthstatus: Query the Request Parameter of Real Server Health Status

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "backendServerList": [
4        {
5            "instanceId": "i-YfAibl4A",
6            "weight": 50,
7            "status": "Alive"
8        },
9        {
10            "instanceId": "i-jBXABQ8D",
11            "weight": 60,
12            "status": "Dead"
13        }
14    ],
15    "type": "TCP",
16    "listenerPort": 88,
17    "backendPort": 88,
18    "marker": "rs-0A6BE9BB",
19    "nextMarker": null,
20    "isTruncated": false,
21    "maxKeys": 1000
22}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListBackendServerStatus.java

Query real server list

Function declaration

Plain Text
1public ListBackendServerResponse listBackendServers(String blbId) {
2}
3public ListBackendServerResponse listBackendServers(ListBackendServerRequest listBackendServerRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: describebackendservers: Query Real Server List Request Parameters

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "backendServerList": [
4        {
5            "instanceId": "i-YfAibl4A",
6            "weight": 50,
7        }
8    ],
9    "marker": "rs-0A6BE9BB",
10    "nextMarker": null,
11    "isTruncated": false,
12    "maxKeys": 1000
13}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListBackendServers.java

Update a real server

Function declaration

Plain Text
1public void modifyBackendServerAttributes(String blbId, List<BackendServer> backendServerList) {
2}
3public void modifyBackendServerAttributes(ModifyBSAttributesRequest modifyBSAttributesRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: updatebackendservers: Update Real Server Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleModifyBackendServerAttributes.java

Delete real server

Function declaration

Plain Text
1public void deleteBackendServers(String blbId, List<String> backendServerList) {
2}
3public void deleteBackendServers(DeleteBSRequest deleteBSRequest) {
4}

Note:
The first API only supports a few common parameters
The second API supports more parameters but requires creating a request instance.

Parameter Meaning

Refer to the OpenAPI documentation: removebackendservers: Delete Real Server Request Parameters

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleDeleteBackendServers.java

Bind to regular security group

Function declaration

Plain Text
1public void bindSg(SgOperateRequest request) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: bindsecuritygroups: Bind Regular Security Group Request Parameter

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleBindSg.java

Unbind from regular security group

Function declaration

Plain Text
1public void unBindSg(SgOperateRequest request) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: unbindsecuritygroups: Unbind Regular Security Group Request Parameter

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleUnBindSg.java

Query regular security group list of BLB instances

Function declaration

Plain Text
1public ListBlbSgResponse listBlbSg(ListBlbSgRequest request) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: describesecuritygroups: Query Regular Security Group List Request Parameter of BLB Instance

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "blbSecurityGroups": [
4        {
5            "securityGroupDesc": "",
6            "securityGroupId": "g-4NxWoxeq",
7            "securityGroupName": "securitygroup-name",
8            "vpcName":"vpc-name",
9            "securityGroupRules": [
10                {
11                    "destGroupId": "",
12                    "destIp": "all",
13                    "direction": "egress",
14                    "ethertype": "IPv4",
15                    "portRange": "1-65535",
16                    "protocol": "all",
17                    "securityGroupRuleId": "r-gkv8yupumvx2"
18                }
19            ]
20        }
21    ]
22}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListBlbSg.java

Bind enterprise security group

Function declaration

Plain Text
1public void bindEsg(EsgOperateRequest request) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: bindenterprisesecuritygroups: Bind Enterprise Security Group Request Parameter

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleBindEsg.java

Unbind enterprise security group

Function declaration

Plain Text
1public void unBindEsg(EsgOperateRequest request) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: unbindenterprisesecuritygroups: Unbind Enterprise Security Group Request Parameter

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleUnBindEsg.java

Query the enterprise security group list of BLB instances

Function declaration

Plain Text
1public ListBlbEsgResponse listBlbEsg(ListBlbSgRequest request) {
2}

Parameter Meaning

Refer to the OpenAPI documentation: describeenterprisesecuritygroups: Query Enterprise Security Group List Request Parameter of BLB Instance

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "enterpriseSecurityGroups": [{
4		"enterpriseSecurityGroupId": "esg-g8z4qfj0m0bu",
5		"enterpriseSecurityGroupName": "test0627",
6		"enterpriseSecurityGroupDesc": "",
7		"enterpriseSecurityGroupRules": [{
8 "remark": "All protocols",
9				"direction": "egress",
10				"action": "allow",
11				"priority": 1000,
12				"ethertype": "IPv6",
13				"portRange": "",
14				"sourceIp": "",
15				"destIp": "all",
16				"enterpriseSecurityGroupRuleId": "esgr-9tzd4yijcwqu",
17				"protocol": "all"
18			},
19			{
20				"remark": "",
21				"direction": "egress",
22				"action": "allow",
23				"priority": 1000,
24				"ethertype": "IPv4",
25				"portRange": "",
26				"sourceIp": "",
27				"destIp": "all",
28				"enterpriseSecurityGroupRuleId": "esgr-9je09z6bd9wv",
29				"protocol": "tcp"
30			},
31			{
32				"remark": "",
33				"direction": "ingress",
34				"action": "allow",
35				"priority": 1000,
36				"ethertype": "IPv4",
37				"portRange": "2",
38				"sourceIp": "all",
39				"destIp": "",
40				"enterpriseSecurityGroupRuleId": "esgr-jcej4juqbh49",
41				"protocol": "tcp"
42			}
43		]
44	}]
45}
  • Operation failed

For response exception list of operation failure, refer to the Baidu Load Balance (BLB) Exception List.

Code example

For specific code examples, refer to: ExampleListBlbEsg.java

Appendix

Public response information in Metadata format

Plain Text
1 {
2      "bceRequestId":"f5f0821d-45fe-439b-bbf4-fc48b639f84a",
3      "contentLength":28,
4      "contentType":"application/json;charset=UTF-8",
5      "date":1701917695000,
6      "server":"openresty/1.15.8.1"
7 }

Previous
Application BLB instance
Next
Initialization