创建监听设置
更新时间:2024-11-28
接口描述
本接口用于创建负载均衡监听设置。
请求结构
Plain Text
1POST /v1/blb/{blbId}/monitor HTTP/1.1
2Host: bec.baidubce.com
3Content-Type: application/json; charset=utf-8
4Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
blbId | String | 是 | URI参数 | 负载均衡ID |
blbListenerRequest | BlbListenerRequest | 是 | RequestBody参数 | 创建负载均衡监听设置请求 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
result | Boolean | 操作结果,true:表示成功;false:表示失败 |
action | String | 操作类型,返回值为“CreateBlbMonitor” |
details | List<String> | 返回详情,返回对应的负载均衡id |
错误码
请参照错误返回章节的内容。
请求示例
Plain Text
1POST /v1/blb/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 "lbMode": "wrr",
8 "backendPort": "80",
9 "enableCipTTM": "false",
10 "frontendPort": {
11 "protocol": "TCP",
12 "port": 80
13 },
14 "healthCheck": {
15 "timeoutInSeconds": 3,
16 "intervalInSeconds": 3,
17 "healthyThreshold": 0,
18 "unhealthyThreshold": 3,
19 "healthCheckType": "tcp",
20 "healthCheckString": ""
21 },
22 "keepaliveTimeout": 900
23}
响应示例
Plain Text
1{
2 "result": true,
3 "action": "CreateBlbMonitor",
4 "details": {
5 "blbId": "lb-hwc3f8ac"
6 }
7}
Model对象定义
BlbListenerRequest
参数名称 | 类型 | 描述 |
---|---|---|
frontendPort | Port | 负载均衡端口 |
backendPort | Integer | 后端端口 |
enableCipTTM | Boolean | 获取真实IP(仅TCP时使用) |
keepaliveTimeout | Integer | 超时时间(10~4000秒) |
lbMode | LbMode | 转发规则 |
healthCheck | HealthCheck | 健康检查设置 |
Port
参数名称 | 类型 | 描述 |
---|---|---|
protocol | Protocol | 使用协议名称 |
port | 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) |
healthCheckURI | String | 健康检查路径,默认/,当健康检查协议为HTTP时生效 |