创建服务器组端口
更新时间:2025-04-24
接口描述
本接口用于创建服务器组端口。
请求结构
Plain Text
1POST /v2/appblb/{blbId}/appservergroupport?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 "port": 0,
16 "sgId": "",
17 "type": "",
18 "udpHealthCheckString": ""
19}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
blbId | blbId | path | true | string |
request | 创建服务器组端口请求 | body | true | CreateBlbServerGroupPortRequest |
healthCheck | 健康检查类型,TCP、HTTP、UDP、ICMP | true | string | |
healthCheckDownRetry | 不健康阈值,即连续多少次健康检查失败后,屏蔽该后端服务器。默认为3,需为2-5间的整数 | false | integer(int32) | |
healthCheckHost | 发往后端服务器的健康检查请求的Host头域,例如”localhost”,默认为空,当健康检查协议为HTTP时生效 | false | string | |
healthCheckIntervalInSecond | 健康检查间隔(单位:秒),默认为3,需为1-10间的整数 | false | integer(int32) | |
healthCheckNormalStatus | 健康检查正常时的HTTP状态码,支持5类状态码的组合,例如”http_1xx http_2xx”。当健康检查协议为HTTP时生效 | false | string | |
healthCheckPort | 健康检查端口,IP组协议为HTTP协议时必传 | false | integer(int32) | |
healthCheckTimeoutInSecond | 健康检查超时(单位:秒),默认为3,需为1-60间的整数 | false | integer(int32) | |
healthCheckUpRetry | 健康阈值,即连续多少次健康检查成功后,重新将该后端服务器置为可用。默认为3,需为2-5间的整数 | false | integer(int32) | |
healthCheckUrlPath | 健康检查路径,默认/,当健康检查协议为HTTP时生效 | false | string | |
port | 端口号,需为1-65535间的整数 | false | integer(int32) | |
sgId | 服务器组ID | true | string | |
type | 服务器组端口类型,TCP、HTTP、UDP | true | string | |
udpHealthCheckString | UDP健康检查字符串,当健康检查协议为UDP时必传 | false | string |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 参数说明 | 类型 |
---|---|---|
id | 服务器组端口ID | string |
错误码
请参照错误返回章节的内容。
请求示例
Plain Text
1POST /v2/appblb/applb-cn-yangzhou-ix-zjri7zxx/appservergroupport?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 "healthCheck": "TCP",
7 "healthCheckDownRetry": 3,
8 "healthCheckHost": "",
9 "healthCheckIntervalInSecond": 2,
10 "healthCheckNormalStatus": "",
11 "healthCheckPort": 8030,
12 "healthCheckTimeoutInSecond": 20,
13 "healthCheckUpRetry": 2,
14 "healthCheckUrlPath": "",
15 "port": 8014,
16 "sgId": "svg-vwybo7xx",
17 "type": "TCP",
18 "udpHealthCheckString": ""
19}
响应示例
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": "svg-vwybo7xx"
9}