IPv6 BLB Instance
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 utilize the IPv6 Baidu Load Balance (BLB) on Baidu AI Cloud, a valid AK (Access Key ID) and SK (Secret Access Key) are required for signature verification. AK/SK are system-assigned strings used to authenticate users and facilitate service access signature certification. You can obtain and understand your AK/SK through the following steps:
Create a BlbClient
BlbClient serves as the client for the IPv6 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:
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 an IPv6 BLB instance
Function declaration
1public CreateBlbResponse createIpv6Blb(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
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3 "blbId": "lb-BLuOPSLZ",
4 "name": "blb-for-test",
5 "address": "2400:da00:e003:0:46b:2400:0:3",
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: ExampleCreateIpv6Blb.java
Query the existing IPv6 BLB instance
Function declaration
1public ListBlbResponse listIpv6Blbs(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
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": "2400:da00:e003:0:46b:2400:0:3"
10 },
11 {
12 "blbId": "lb-gj5gVpeq",
13 "status": available,
14 "name": "nametest",
15 "desc": desc,
16 "address": "2400:da00:e003:0:46b:2400:0:4"
17 }
18 ],
19 "marker": "blb-0A20F971",
20 "nextMarker": "blb-0A20FB09",
21 "isTruncated": true,
22 "maxKeys": 2
23}
- 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: ExampleListIpv6Blb.java
Other APIs
Other APIs are consistent with general-purpose BLB APIs. For details, refer to General-purpose BLB APIs
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 }
