创建IP组协议
更新时间:2022-06-24
接口描述
本接口用于创建IP组协议。
请求结构
Plain Text
1POST /v2/appblb/{blbId}/ipgroup/backendpolicy?clientToken={clientToken} HTTP/1.1
2Host: bec.baidubce.com
3Authorization: authorization string
4
5{
6 "healthCheck": "",
7 "healthCheckDownRetry": 0,
8 "healthCheckHost": "",
9 "healthCheckIntervalInSecond": 0,
10 "healthCheckNormalStatus": "",
11 "healthCheckPort": 0,
12 "healthCheckTimeoutInSecond": 0,
13 "healthCheckUpRetry": 0,
14 "healthCheckUrlPath": "",
15 "ipGroupId": "",
16 "type": "",
17 "udpHealthCheckString": ""
18}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
blbId | 负载均衡ID | path | 是 | string |
request | 创建IP组协议请求 | body | 是 | CreateBlbIpGroupBackendPolicyRequest |
healthCheck | 健康检查类型,TCP、HTTP、UDP、ICMP | 是 | string | |
healthCheckDownRetry | 不健康阈值,即连续多少次健康检查失败后,屏蔽该后端服务器。默认为3,需为2-5间的整数 | 否 | integer | |
healthCheckHost | 发往后端服务器的健康检查请求的Host头域,例如”localhost”,默认为空,当健康检查协议为HTTP时生效 | 否 | string | |
healthCheckIntervalInSecond | 健康检查间隔(单位:秒),默认为3,需为1-10间的整数 | 否 | integer | |
healthCheckNormalStatus | 健康检查正常时的HTTP状态码,支持5类状态码的组合,例如”http_1xx|http_2xx”。当健康检查协议为HTTP时生效 | 否 | string | |
healthCheckPort | 健康检查端口,IP组协议为HTTP协议时必传 | 否 | integer | |
healthCheckTimeoutInSecond | 健康检查超时(单位:秒),默认为3,需为1-60间的整数 | 否 | integer | |
healthCheckUpRetry | 健康阈值,即连续多少次健康检查成功后,重新将该后端服务器置为可用。默认为3,需为2-5间的整数 | 否 | integer | |
healthCheckUrlPath | 健康检查路径,默认/,当健康检查协议为HTTP时生效 | 否 | string | |
ipGroupId | IP组ID | 是 | string | |
type | IP组协议类型,TCP、HTTP、UDP | 是 | string | |
udpHealthCheckString | UDP健康检查字符串,当健康检查协议为UDP时必传 | 否 | string | |
clientToken | 幂等性Token,是一个长度不超过64位的ASCII字符串 | query | 否 | string |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 参数说明 | 类型 |
---|---|---|
id | IP组协议ID | string |
错误码
请参照错误返回章节的内容。
请求示例
Plain Text
1POST /v2/appblb/applb-cn-hangzhou-cm-cmqypbkj/ipgroup/backendpolicy?clientToken=123456789 HTTP/1.1
2Host: bec.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "ipGroupId": "bec_ip_group-r8yc3lg1",
7 "type": "TCP",
8 "healthCheck": "TCP",
9 "healthCheckPort": 80,
10 "healthCheckTimeoutInSecond": 10,
11 "healthCheckIntervalInSecond": 3,
12 "healthCheckDownRetry": 4,
13 "healthCheckUpRetry": 5
14}
响应示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2015 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6
7{
8 "id": "bec_ip_group_policy-mdypveqe"
9}