Standard BLB Instance Related Interfaces
CreateLoadBalancer: Create an instance
Description
- Create a LoadBalancer and return the allocated service address and instance ID.
- Billing type: Postpay.
- Certification is required. Those who have not passed certification can go to the certification under security certification in the Baidu AI Cloud Official Website Console for certification.
Request structure
1POST /v{version}/blb?clientToken={clientToken} HTTP/1.1
2Host: blb.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "name": name,
7 "desc": desc,
8 "vpcId": vpcId,
9 "subnetId": subnetId,
10 "address": address,
11 "type": type,
12 "eip":eip,
13 "tags":[
14 {
15 "tagKey": tagKey,
16 "tagValue": tagValue
17 }
18 ]
19}
Request headers
No special headers beyond common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| clientToken | String | Yes | Query | Idempotency Token, with length no more than 64 characters. |
| name | String | No | RequestBody | Provide a LoadBalancer name for easy identification. The name should be 1 to 65 bytes long, start with a letter, and may contain letters, numbers, and the characters -\_/ . If not specified, it will be automatically generated. |
| desc | String | No | RequestBody | Add a description for the LoadBalancer instance to include detailed information. It can be 0 to 450 bytes long, supports Chinese, and defaults to empty. |
| vpcId | String | Yes | RequestBody | VPC ID to which the LoadBalancer instance belongs. |
| subnetId | String | Yes | RequestBody | Subnet ID to which the LoadBalancer instance belongs |
| address | String | No | RequestBody | Specify the private IP address of the LoadBalancer instance, ensuring it falls within the subnet's network range. |
| type | String | No | RequestBody | Specify the type of LoadBalancer instance. If not defined, it defaults to general-purpose. Uploading "ipv6" creates an IPv6 BLB. |
| eip | String | No | RequestBody | Bind an existing EIP by specifying its IP address. |
| tags | List<[TagModel](BLB/API Reference/Appendix.md#TagModel)> | No | RequestBody | List of tag key-value pairs to be created |
| billing | [BillingForCreate](BLB/API Reference/Appendix.md#BillingForCreate) | No | RequestBody | Order-related information. It is required when the prepaid BLB is purchased. |
| performanceLevel | String | No | RequestBody | Define the performance specification. It defaults to a shared type. Available values are: "small1" Standard 1, "small2" Standard 2, "medium1" Enhance 1, "medium2" Enhance 2, "large1" Extra Large 1, "large2" Extra Large 2, and "large3" Extra Large 3. If using pay-as-you-go, the value "unlimited" may also be used for unlimited speed. |
| autoRenewLength | int | No | RequestBody | Support creating prepaid BLB with auto-renewal enabled. It value ranges vary by autoRenewTimeUnit, with 1-9 for month and 1-3 for year. |
| autoRenewTimeUnit | String | No | RequestBody | Support enabling auto-renewal when creating BLB, with values being month or year (month by default) |
| resourceGroupId | String | No | RequestBody | Support binding resource group ID when creating BLB |
| allowDelete | Boolean | No | RequestBody | Indicate whether deletion is allowed. The default value is true, meaning deletion is permitted. |
| allocateIpv6 | Boolean | No | RequestBody | Specify whether to allocate an IPv6 address. A value of true allocates an IPv6 address, while false does not. |
Response Status Code
Respond with 200 after successful operation, and respond with error codes after failed operation, as shown in [Error Codes](BLB/API Reference/Error code.md)
Response headers
No special headers beyond common headers.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| address | string | Assigned Intranet server address IP, through which the instance can be accessed via the Intranet |
| name | string | LoadBalancer name |
| blbId | string | Provide the LoadBalancer ID, which is required for subsequent operations on this instance. |
| desc | string | LoadBalancer description |
Request example
1POST /v1/blb?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
2HOST blb.bj.baidubce.com
3Authorization: authorization string
4
5 Create a postpaid BLB instance
6{
7 "name":"blb-for-test",
8 "desc": "myblb",
9 "vpcId": "vpc-fy6vdykpwkqb",
10 "subnetId": "sbn-a34td0pxcucd",
11 "address": "192.168.0.24",
12 "eip": "100.88.8.139"
13}
14
15 Create a prepaid BLB instance
16{
17 "vpcId":"vpc-fbsxgfs9ty60",
18 "subnetId":"sbn-3317rkjfq8j9",
19 "name":"ccq20240223_ccq",
20 "billing": {
21 "paymentTiming":"Prepaid",
22 "reservation": {
23 "reservationLength":2
24 }
25 },
26 "performanceLevel":"small1"
27}
Response example
1HTTP/1.1 200 OK
2x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
3Date: Wed, 10 Apr 2016 08:26:52 GMT
4Transfer-Encoding: chunked
5Content-Type: application/json;charset=UTF-8
6Server: BWS
7
8{
9 "blbId": "lb-BLuOPSLZ",
10 "name": "blb-for-test",
11 "address": "192.168.0.24",
12 "desc": "myblb"
13}
DescribeLoadBalancers: Query existing BLB instances
Description
- Query information of all LoadBalancers under a user account
- Fuzzy query by LoadBalancer name or address
- Exact query by LoadBalancer ID
- Query using a bccId. Currently, only single bccId queries are supported with exact matches. The query result will reveal the LoadBalancer instance containing the real server.
- The response result is the intersection of multiple query conditions.
- If the BLB instance has public network access enabled, the response result will include the public IP.
- Results support marker-based pagination, with a default page size of 1000, which can be specified via the maxKeys parameter.
Request structure
1GET /v{version}/blb?address={address}&name={name}&blbId={blbId}&bccId={bccId}&marker={marker}&maxKeys={maxKeys} HTTP/1.1
2Host: blb.bj.baidubce.com
3Authorization: authorization string
Request headers
No special headers beyond common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| address | String | No | Query | Intranet server address of the LoadBalancer to be queried, in dotted decimal format |
| name | String | No | Query | LoadBalancer name to be queried |
| blbId | String | No | Query | LoadBalancer ID to be queried (only exact query supported) |
| bccId | String | No | Query | LoadBalancer bound to this BCC (only exact query supported) |
| exactlyMatch | Boolean | No | Query | Set the query match type: true for exact match and false for fuzzy match. The default value is false. |
| marker | String | No | Query | The starting position of the batch list query is a system-generated string |
| maxKeys | int | No | Query | Maximum number of items per page is 1,000, with a default value of 1000. |
| type | String | No | Query | Define the type of LoadBalancer instance to query. If not specified, it defaults to general-purpose. Uploading "ipv6" queries an IPv6 BLB. |
Response Status Code
Respond with 200 after successful operation, and respond with error codes after failed operation, as shown in [Error Codes](BLB/API Reference/Error code.md)
Response headers
No special headers beyond common headers.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| blbList | List<[BLBModel](BLB/API Reference/Appendix.md#BLBModel)> | List containing query results |
| marker | string | Marker indicating the starting position of the query. If the result list is empty, this field does not exist. |
| isTruncated | boolean | true indicates there is more data later, false indicates it is the last page |
| nextMarker | String | The marker value needed to fetch the next page. This field is absent when isTruncated is false. |
| maxKeys | int | Maximum number of items included per page |
Request example
1GET /v1/blb?name=test&maxKeys=2 HTTP/1.1
2Host: blb.bj.baidubce.com
3Authorization: authorization string
Response example
1HTTP/1.1 200 OK
2x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
3Date: Wed, 10 Apr 2016 08:26:52 GMT
4Transfer-Encoding: chunked
5Content-Type: application/json;charset=UTF-8
6Server: BWS
7
8{
9 "blbList": [
10 {
11 "blbId": "lb-a7e5zPPk",
12 "status": available,
13 "name": "test-blb",
14 "desc": desc,
15 "address": "192.168.0.23"
16 },
17 {
18 "blbId": "lb-gj5gVpeq",
19 "status": available,
20 "name": "nametest",
21 "desc": desc,
22 "address": "192.168.0.24",
23 "publicIp": "123.2.3.4"
24 }
25 ],
26 "marker": "blb-0A20F971",
27 "nextMarker": "blb-0A20FB09",
28 "isTruncated": true,
29 "maxKeys": 2
30}
DescribeLoadBalancerDetail: Query BLB instance details
Description
- Query detailed information of all LoadBalancers under a user account by ID.
- Contain all listener port information of the LoadBalancer
Request structure
1GET /v{version}/blb/{blbId}?type={type} HTTP/1.1
2Host: blb.bj.baidubce.com
3Authorization: authorization string
Request headers
No special headers beyond common headers.
Request parameters
