IPv6 BLB Instance
Create BLB
Create a BLB instance and receive the allocated service address and instance ID. The billing type is Postpay. Certification is mandatory. Users who have not completed certification can go to the certification section under "Security Certification" in the Baidu AI Cloud Official Website Console to complete the process.
You can create BLB instances with the following code.
Function declaration
1func (c *Client) CreateLoadBalancer(args *CreateLoadBalancerArgs) (*CreateLoadBalanceResult, error)
Parameter Meaning
Refer to the OpenAPI documentation: IPv6BLB -related APIs
Response Value
Operation succeeded:
1{
2 "blbId": "lb-BLuOPSLZ",
3 "name": "blb-for-test",
4 "desc": "",
5 "address": "192.168.0.24"
6}
Operation failed:
Throw an exception. For the exception list, refer to: Exception List
Code example
For specific code examples, refer to: example_create_loadbalancer.go
Query existing BLB instances
Retrieve information on all LoadBalancers associated with the user account. Supports fuzzy queries by LoadBalancer name or address, exact queries by LoadBalancer ID, and queries by bccId (limited to single and exact bccId queries). The query results include the load balancer instance containing the specified real server. The response is the intersection of multiple query conditions. If the BLB instance allows public network access, the response will include the public IP. Results support marker-based pagination, with a default page size of 1000, adjustable via the maxKeys parameter.
You can query existing BLB instances with the following code
Function declaration
1func (c *Client) DescribeLoadBalancers(args *DescribeLoadBalancersArgs) (*DescribeLoadBalancersResult, error)
Parameter Meaning
Refer to the OpenAPI documentation: IPv6BLB -related APIs
Response Value
Operation succeeded:
1{
2 "blbList": [
3 {
4 "blbId": "lb-a7e5zPPk",
5 "status": available,
6 "name": "test-blb",
7 "desc": "For production environment",
8 "vpcId":"vpc-fy6vdykpwkqb",
9 "address": "192.168.0.24"
10 },
11 {
12 "blbId": "lb-gj5gVpeq",
13 "status": available,
14 "name": "nametest",
15 "desc": "For test environment",
16 "vpcId":"vpc-a8n5p6kybbx4",
17 "address": "192.168.0.25"
18 }
19 ],
20 "marker": "blb-0A20F971",
21 "nextMarker": "blb-0A20FB09",
22 "isTruncated": true,
23 "maxKeys": 2
24}
Operation failed:
Throw an exception. For the exception list, refer to: Exception List
Code example
For specific code examples, refer to: example_describe_loadbalancers.go
