最近更新时间:2022.09.01 11:30:06
首次发布时间:2022.09.01 11:30:06
API 名称:CreateListenerInOneStep。
API 域名:open.volcengineapi.com 。
API 描述:一步创建监听和终端节点组。
在使用该部分 API 提交请求时必须包含以下 URI 参数。
除了 URI 参数,该 API 请求还需要包含签名参数。关于更多签名参数的信息,参见公共请求参数。
名称 | 类型 | 是否必选 | 格式 | 说明 |
---|---|---|---|---|
Action | string | 是 | [a-zA-Z]+ | API 名称。 |
Version | string | 是 | YYYY-MM-DD | API 版本信息。该参数的取值是 2022-03-01 。 |
在使用该 API 提交请求时,请求正文中可以包含的参数如下。
参数 | 类型 | 是否必选 | 参数说明 | 示例 |
---|---|---|---|---|
Name | string | 否 | 加速器名称。 | test |
AcceleratorId | string | 是 | 加速器 ID 。 | ga-344345ggfa |
Protocol | string | 是 | 监听协议,具体支持:TCP、UDP。 | TCP |
PortRanges | array of PortRange | 是 | 监听端口 。 | 见 PortRange |
EndpointGroups | array of EndpointGroup | 是 | 配置终端节点组。 | 见 EndpointGroup |
HealthyConfig | array of HealthyConfig | 否 | 配置健康检查。 | |
EnableAffinity | string | 否 | 是否开启客户端亲和性,默认不开启,支持取值:
| false |
EndpointConfigurations | array of EndpointConfiguration | 是 | 配置终端节点。 | 见 EndpointConfiguration |
TrafficPercentage | string | 是 | 终端节点组的流量调配比例,范围为1-100。 | 1 |
PortRange
参数 | 类型 | 参数说明 | 示例值 |
---|---|---|---|
FromPort | int | 起始端口。 | 80 |
ToPort | int | 终止端口。 | 81 |
EndpointGroup
参数 | 类型 | 是否必选 | 参数说明 | 示例 |
---|---|---|---|---|
Name | String | 否 | 终端节点组的名称。 | test |
IsVolcSource | bool | 是 | 后端服务部署是否在火山引擎上。支持取值:
| true |
KeepClientIP | bool | 是 | 是否开启保持客户端源 IP 功能,默认不开启此功能,支持取值:
| true |
KeepClientIPMethod | string | 是 | 获取客户端源 IP 的方法,开启保持客户端源 IP 功能时必选,支持取值:
| ProxyProtocolV1 |
Region | string | 是 | 选择终端节点组回源区域,包括:CN_NorthEast、 CN_North、 CN_East、CN_South、CN_Central、CN_NorthWest、CN_SouthWest、AP1。 | CN_Nrorth |
HealthyConfig
参数 | 类型 | 是否必选 | 参数说明 | 示例 |
---|---|---|---|---|
HealthCheckEnable | bool | 是 | 是否开启健康检查,默认不开启,支持取值:
| true |
HealthCheckProtocol | string | 否 | 健康检查协议,当前默认支持TCP协议。 | TCP |
HealthCheckPort | int | 是 | 健康检查端口,开启健康检查后必选字段,端口输入范围为1~65535。 | 22 |
HealthResponseTimeOut | int | 否 | 响应超时时间,默认3s,不支持修改。 | 3 |
HealthCheckInterval | int | 否 | 健康检查时间间隔,开启健康检查后必选字段,输入范围为1~50秒,默认为2秒。 | 2 |
HealthyThreshold | int | 否 | 健康检查健康阈值,即针对健康检查变化所需要的连续健康检查次数,开启健康检查后必选字段,输入范围2~10,默认为3次。 | 3 |
EndpointConfiguration
参数 | 类型 | 是否必选 | 参数说明 | 示例 |
---|---|---|---|---|
Type
| string
| 是
| 终端节点类型 。
| IP |
Endpoint | string | 否 | 终端节点服务地址。 | 1.1.1.1 |
Weight | int | 是 | 终端节点的流量分配权重,范围为1-100。 | 20 |
VolcResourceId | String | 否 | 后端服务部署在火山引擎时,可填写资源 ID,填写后无需填写 Endpoint。 | eip-gdhsahg |
参数 | 类型 | 参数说明 | 示例 |
---|---|---|---|
ListenerId | string | 监听ID 。 | lst-ghdasgh*** |
EndpointGroupIds | array of string | 终端节点组 ID 。 | endpointgroup-VncP4TEvGsBmVX7HoGhmFg |
POST https://open.volcengineapi.com/?Version=2022-03-01&Action=CreateListenerInOneStep&<其他公共请求参数> { "Protocol": "TCP", "EndpointGroups": [ { "Name": "test", "IsVolcSource": false, "KeepClientIP": false, "KeepClientIPMethod": "ProxyProtocolV2", "Region": "CN_NorthEast", "EndpointConfigurations": [ { "Type": "IP", "Endpoint": "1.1.1.1", "Weight": 1 } ], "HealthyConfig": { "HealthCheckEnable": false, "HealthCheckProtocol": "TCP", "HealthCheckInterval": 2, "HealthyThreshold": 3 }, "TrafficPercentage": 100 } ], "Name": "test", "PortRanges": [ { "FromPort": 80, "ToPort": 80 } ], "AcceleratorId": "accinstance-zGHoYhWixBusRXtM2pC2UH" }
{ "ResponseMetadata": { "RequestId": "20220808110827010225243139033B61BB", "Action": "CreateListenerInOneStep", "Version": "2022-03-01", "Service": "ga", "Region": "cn-north-1" }, "Result": { "ListenerId": "listener-ZevuMzQ4Y3fDpezvHWhNMo", "EndpointGroupIds": [ "endpointgroup-VncP4TEvGsBmVX7HoGhmFg" ] } }