Load Balance Dedicated Cluster (LBDC)
Retrieve Endpoint
Before configuring the Endpoint for SDK usage, please refer to the developer guide section on LBDC Service Domain Name to understand Endpoint-related concepts. Baidu AI Cloud currently supports multiple regions. Please refer to the network product LBDC section in Region Selection Guide.
Note: The Load Balance Dedicated Cluster (LBDC) 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:
Create LbdcClient
LbdcClient serves as the client for the Load Balance Dedicated Cluster (LBDC) services, providing developers with a range of methods to interact with Load Balance Dedicated Cluster (LBDC) services. When creating an LbdcClient, first configure a BceClientConfiguration-type config instance using Endpoint, AK and SK, and then use the config instance to configure the LbdcClient. The specific configuration method is as follows:
1String ak = "Your Ak";
2String sk = "Your Sk";
3String endpoint = "blb.bj.baidubce.com";
4BceClientConfiguration config = new BceClientConfiguration();
5config.setCredentials(new DefaultBceCredentials(ak, sk));
6config.setEndpoint(endpoint);
7LbdcClient lbdcClient = new LbdcClient(config);
Create LBDC
Function declaration
1public CreateLbdcResponse createLbdc(CreateLbdcRequest body, String clientToken) {
2}
Parameter Meaning
Refer to the OpenAPI documentation: Create LBDC Request Parameters
Response Value
- Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "id": "bgw_group-a3t786p1",
4 "name": "abc",
5 "type": "4Layer",
6 "desc":""
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: ExampleCreateLbdc.java
Upgrade LBDC
Function declaration
1public void upgradeLbdc(String id, UpgradeLbdcRequest body, String clientToken) {
2}
Parameter Meaning
Refer to the OpenAPI documentation: Upgrade LBDC 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: ExampleUpgradeLbdc.java
Renew LBDC
Function declaration
1public void renewLbdc(String id, RenewLbdcRequest body, String clientToken) {
2}
Parameter Meaning
Refer to the OpenAPI documentation: Renew LBDCRequest 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: ExampleRenewLbdc.java
LBDC list
Function declaration
1public ListLbdcResponse listLbdc(String id, String name) {
2}
Parameter Meaning
Refer to the OpenAPI documentation: Request Parameters of LBDC List
Response Value
- Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "clusterList": [
4 {
5 "id" : "bgw_group-f632f4bb",
6 "name" : "sss",
7 "type" : "4Layer",
8 "status" : "available",
9 "ccuCount" : 2,
10 "createTime" : "2023-08-28T06:00:00Z",
11 "expireTime" : "2024-12-07T08:06:45Z",
12 "desc" : "desc"
13 },
14 {
15 "id" : "nginx_group-4f63ff24",
16 "name" : "7layerName",
17 "type" : "7Layer",
18 "status" : "available",
19 "ccuCount" : 1,
20 "createTime" : "2023-08-28T06:00:00Z",
21 "expireTime" : "2023-09-28T06:00:00Z",
22 "desc" : "desc"
23 }
24 ],
25 "marker": "bgw_group-f632f4bb",
26 "nextMarker": null,
27 "isTruncated": false,
28 "maxKeys": 1000
29}
- 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: ExampleListLbdc.java
LBDC details
Function declaration
1public GetLbdcResponse getLbdc(String id) {
2}
Parameter Meaning
Refer to the OpenAPI documentation: Request Parameters of LBDC Details
Response Value
- Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "id" : "bgw_group-1f1b6e17",
4 "name" : "ccqLbdc1117",
5 "type" : "4Layer",
6 "status" : "increasing",
7 "ccuCount" : "8",
8 "createTime" : "2023-11-17T09:57:33Z",
9 "expireTime" : "2023-12-17T09:42:43Z",
10 "totalConnectCount" : "640000000",
11 "newConnectCps" : "96000000",
12 "networkInBps" : "960000000000",
13 "networkOutBps" : "960000000000"
14}
- 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: ExampleGetLbdc.java
Update LBDC
Function declaration
1public void updateLbdc(String id, UpdateLbdcRequest body, String clientToken) {
2}
Parameter Meaning
Refer to the OpenAPI documentation: Update LBDC 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: ExampleUpdateLbdc.java
List of BLBs associated with LBDC
Function declaration
1public GetBoundBlBListOfLbdcResponse getBoundBlBListOfLbdc(String id) {
2}
Parameter Meaning
Refer to the OpenAPI documentation: Request Parameter of List of BLBs Associated with LBDC
Response Value
- Operation succeeded
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "blbList": [
4 {
5 "blbId" : "lb-38eff7a8",
6 "name" : "ipv6blb-test",
7 "blbType" : "ipv6",
8 "bandwidth" : 0,
9 "address" : "0.0.0.0",
10 "ipv6" : "2400:da00:e003:0:46b:2400:0:3",
11 "vpcId" : "7d54f4be-9fae-47e1-9842-359e3104e3dd",
12 "subnetId" : "fc315d1a-0940-4531-b9c5-474e23335f4c"
13 },
14 {
15 "blbId" : "lb-20e783dd",
16 "name" : "blb_1204_1",
17 "blbType" : "application",
18 "bandwidth" : 0,
19 "address" : "192.168.0.2",
20 "ipv6" : "",
21 "vpcId" : "309228b5-4aaf-45b8-a149-37c8c6eaaef2",
22 "subnetId" : "e3efb8c1-0e8f-4bcc-9295-58a532b5fe6e"
23 }
24 ]
25}
- 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: ExampleGetBoundBlBListOfLbdc.java
Appendix
Public response information in Metadata format
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 }
