批量创建监听设置
更新时间:2025-08-05
接口描述
本接口用于批量创建监听设置。
请求结构
                Plain Text
                
            
            1POST /v1/blb/batch/create/{blbId}/monitor HTTP/1.1
2Host: bec.baidubce.com
3Content-Type: application/json; charset=utf-8
4Authorization: authorization string请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必须 | 参数位置 | 描述 | 
|---|---|---|---|---|
| blbId | String | 是 | URI参数 | 负载均衡ID | 
| blbListenerRequest | BatchBlbListenerRequest | 是 | RequestBody参数 | 批量创建负载均衡监听设置请求 | 
响应头域
除公共头域外,无其它特殊头域。
响应参数
| 参数名称 | 类型 | 描述 | 
|---|---|---|
| actionInfoVo | ActionInfoVo | 返回结果 | 
错误码
请参照错误返回章节的内容。
请求示例
                Plain Text
                
            
            1POST /v1/blb/batch/create/lb-0sbwulxb/monitor HTTP/1.1
2Host: bec.baidubce.com
3Content-Type: application/json; charset=utf-8
4Authorization: bce-auth-v1/318857a8f08b11e9845ca7e54775a0c2/2019-10-17T03:07:21Z/1800/host/212eef8cfe1ac94be56c4afedb9360bba621ef646c3c8288971d36801d70501a
5
6{
7	"protocol": "TCP",
8	"portGroups": [{
9		"port": 91,
10		"backendPort": 91
11	}, {
12		"port": 92,
13		"backendPort": 92
14	}],
15	"lbMode": "wrr",
16	"enableCipTTM": false,
17	"healthCheck": {
18		"healthcheck": true,
19		"timeoutInSeconds": 3,
20		"intervalInSeconds": 3,
21		"healthyThreshold": 0,
22		"unhealthyThreshold": 3,
23		"healthCheckType": "tcp",
24		"healthCheckString": ""
25	},
26	"keepaliveTimeout": 900
27}响应示例
                Plain Text
                
            
            1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2019 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5X-Bce-Gateway-Region: BJ
6
7{
8	"action": "BatchCreateBlb",
9	"details": {
10		"blbId": "lb-d7spfnhx"
11	},
12	"result": true
13}Model对象定义
BatchBlbListenerRequest
| 参数名称 | 类型 | 描述 | 
|---|---|---|
| protocol | Protocol | 使用协议名称 | 
| portGroups | List<PortGroup> | 监听端口列表 | 
| lbMode | LbMode | 转发规则 | 
| enableCipTTM | Boolean | 获取真实IP(仅TCP时使用) | 
| keepaliveTimeout | Integer | 超时时间(10-4000秒) | 
| healthCheck | HealthCheck | 健康检查设置 | 
PortGroup
| 参数名称 | 类型 | 描述 | 
|---|---|---|
| port | Integer | BLB端口 | 
| backendPort | Integer | 后端端口 | 
Protocol
| 枚举名称 | 描述 | 
|---|---|
| TCP | TCP协议 | 
| UDP | UDP协议 | 
| HTTP | HTTP协议 | 
| HTTPS | HTTPS协议 | 
| SSL | SSL协议 | 
LbMode
| 枚举名称 | 描述 | 
|---|---|
| wrr | 加权轮询 | 
| minconn | 最小连接数 | 
| srch | 源IP | 
HealthCheck
| 参数名称 | 类型 | 描述 | 
|---|---|---|
| timeoutInSeconds | Integer | 响应超时时间 | 
| intervalInSeconds | Integer | 健康检查时间 | 
| unhealthyThreshold | Integer | 不健康阈值 | 
| healthyThreshold | Integer | 健康阈值 | 
| healthCheckString | String | UDP检查字符串 | 
| healthCheckType | String | 健康检查协议(tcp/udp/icmp) | 
