调用CreateLoadBalancerUDPListener接口创建UDP监听。
经典网络的负载均衡的UDP协议监听暂不支持查看源地址。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
RegionId | String | 否 | cn-hangzhou |
传统型负载均衡实例的地域ID。 |
Action | String | 是 | CreateLoadBalancerUDPListener |
系统规定参数。取值:CreateLoadBalancerUDPListener。 |
LoadBalancerId | String | 是 | lb-bp1ygod3yctvg1y7**** |
传统型负载均衡实例的ID。 |
ListenerPort | Integer | 是 | 80 |
传统型负载均衡实例前端使用的端口。 取值范围:1~65535。 |
BackendServerPort | Integer | 否 | 80 |
传统型负载均衡实例后端使用的端口。 取值范围:1~65535。 如果不使用虚拟服务器组(不指定VServerGroupId),则该参数必选。 |
Bandwidth | Integer | 是 | -1 |
监听的带宽峰值。单位:Mbps。取值: -1:对于按流量计费的公网负载均衡实例,可以将带宽峰值设置为-1,即不限制带宽峰值。 |
Scheduler | String | 否 | wrr |
调度算法。取值:
仅性能保障型实例支持sch、 tch和qch一致性hash算法。 |
HealthyThreshold | Integer | 否 | 4 |
健康检查连续成功多少次后,将后端服务器的健康检查状态由fail判定为success。 取值范围:2~10。 |
UnhealthyThreshold | Integer | 否 | 4 |
健康检查连续失败多少次后,将后端服务器的健康检查状态由success判定为fail。 取值范围:2~10。 |
HealthCheckConnectTimeout | Integer | 否 | 100 |
接收来自运行状况检查的响应需要等待的时间。 如果后端ECS在指定的时间内没有正确响应,则判定为健康检查失败。单位:秒。 取值范围:1~300。 |
HealthCheckConnectPort | Integer | 否 | 80 |
健康检查使用的端口。 取值范围:1~65535。 不设置此参数时,表示使用后端服务端口(BackendServerPort)。 |
healthCheckInterval | Integer | 否 | 3 |
健康检查的时间间隔。单位:秒。 取值范围:1~50。 |
healthCheckReq | String | 否 | hello |
UDP监听健康检查的请求字符串,只允许包含字母、数字,最大长度限制为64个字符。 |
healthCheckExp | String | 否 | ok |
UDP监听健康检查的响应字符串,只允许包含字母、数字,最大长度限制为64个字符。 |
VServerGroupId | String | 否 | rsp-cige6j8**** |
虚拟服务器组ID。 |
MasterSlaveServerGroupId | String | 否 | rsp-0bfucwu**** |
主备服务器组ID。 说明 虚拟服务器组ID和主备服务器组ID只能选择一个。
|
AclId | String | 否 | 123 |
监听绑定的访问策略组ID。 当AclStatus参数的值为on时,该参数必选。 |
AclType | String | 否 | white |
访问控制类型,取值:
当AclStatus参数的值为on时,该参数有效。 |
AclStatus | String | 否 | off |
是否开启访问控制功能。取值:
|
Description | String | 否 | udp_80 |
自定义监听名称。 长度限制为1~256个字符,支持中文、字母、数字、短划线(-)、正斜线(/)、半角句号(.)和下划线(_)。 |
ProxyProtocolV2Enabled | Boolean | 否 | false |
是否支持通过Proxy Protocol协议携带客户端源地址到后端服务器。取值:
|
HealthCheckSwitch | String | 否 | on |
是否开启健康检查。取值:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 06F00FBB-3D9E-4CCE-9D43-1A6946A75556 |
请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?RegionId=cn-hangzhou
&Action=CreateLoadBalancerUDPListener
&LoadBalancerId=lb-bp1ygod3yctvg1y7****
&ListenerPort=80
&BackendServerPort=80
&Bandwidth=-1
&Scheduler=wrr
&HealthyThreshold=4
&UnhealthyThreshold=4
&HealthCheckConnectTimeout=100
&HealthCheckConnectPort=80
&healthCheckInterval=3
&healthCheckReq=hello
&healthCheckExp=ok
&VServerGroupId=rsp-cige6j8****
&MasterSlaveServerGroupId=rsp-0bfucwu****
&AclId=123
&AclType=white
&AclStatus=off
&Description=udp_80
&ProxyProtocolV2Enabled=false
&HealthCheckSwitch=on
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateLoadBalancerUDPListenerResponse>
<RequestId>06F00FBB-3D9E-4CCE-9D43-1A6946A75556</RequestId>
</CreateLoadBalancerUDPListenerResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "06F00FBB-3D9E-4CCE-9D43-1A6946A75556"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameterValue.SpecNotSupport | The loadBalancer of shared spec does not support the parameter value, %s. | 共享型负载均衡实例不支持指定的参数取值。 |
400 | OperationNotSupport.Acl | The cloud box instance does not support acl. | 云盒实例不支持配置访问控制。 |
400 | InvalidParameterValue.RegionNotSupport | The region does not support the parameter value, %s. | 当前地域不支持指定的参数取值。 |
400 | Abs.VServerGroupIdAndMasterSlaveServerGroupId.MissMatch | The parameters VServerGroupId or MasterSlaveServerGroupId miss match. | 参数VServerGroupId或MasterSlaveServerGroupId不匹配。 |
400 | IpVersionConflict | The ip version of this LoadBalancer and the Acl is conflict. | 指定负载均衡的IP版本与ACL支持的IP类型冲突。 |
400 | InvalidParameterValue.ZoneNotSupport | The zone does not support the parameter value, %s. | 当前可用区不支持指定参数取值。 |
400 | ListenerProcessing | A previous configuration of the listener is pending,please try again later. | 当前监听正在配置中,请稍后重试。 |
400 | AclNotExist | Acl does not exist. | 指定的Acl不存在。 |
400 | InvalidParameter.ListenerPortConflict | There is conflict listener port exists. | 指定的监听端口已存在。 |
400 | InvalidParam.VServerGroupId | The specified VServerGroupId is invalid. | 指定的VServerGroupId无效。请检查参数约束,并在修改后重试。 |
400 | MissingParam.HealthCheckConnectPort | The parameter HealthCheckConnectPort is required. | 参数HealthCheckConnectPort缺失。 |
400 | InvalidParam.ListenerPort | The specified ListenerPort is invalid. | 指定的ListenerPort无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParam.StartPort | The specified StartPort is invalid. | 指定的StartPort无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParamSize.PortRange | The size of param PortRange is invalid. | 指定的PortRange无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParam.EndPort | The specified EndPort is invalid. | 指定的EndPort无效。请检查参数约束,并在修改后重试。 |
400 | QuotaLimitExceeds.AclAttachedToListener | %s. | Acl绑定监听数已达到配额上限。 |
400 | QuotaLimitExceeds.TotalAclEntry | %s. | Acl条目数已达到配额上限。 |
400 | Duplicated.AclEntry | %s. | Acl条目重复。 |
400 | InvalidParameter.RegionNotSupport | The region does not support the parameter: %s. | 当前区域不支持指定参数。 |
400 | LbNotSupportTcpssl | You cannot create a TCP SSL type listener for the specified load balancer. | 指定的实例不支持创建tcpssl类型的监听。 |
400 | LbSupportTcpsslOnly | The specified load balancer supports TCP SSL type listener only. | 指定的实例只支持创建tcpssl类型的监听。 |
400 | ListenerNotSupportRule | You cannot create a rule for the specified listener. | 指定的监听不支持创建转发规则。 |
400 | InvalidParamLength.HealthCheckExp | The length of the parameter HealthCheckReq is invalid. | 指定的HealthCheckExp无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParamLength.HealthCheckReq | The length of the parameter HealthCheckReq is invalid. | 指定的HealthCheckReq无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParam.HealthCheckReq | The param HealthCheckReq is invalid. | 指定的HealthCheckReq无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParam.HealthCheckExp | The param HealthCheckExp is invalid. | 指定的HealthCheckExp无效。请检查参数约束,并在修改后重试。 |
400 | ResourceNotFound.VServerGroup | %s. | 指定的服务器组不存在。 |
400 | IllegalParam.FailoverThreshold | The parameter FailoverThreshold is illegal. | 指定的FailoverThreshold无效。请检查参数约束,并在修改后重试。 |
400 | IllegalParam.FailoverStrategy | The parameter FailoverStrategy is illegal. | 指定的FailoverStrategy无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParameter.ZoneNotSupport | The zone does not support the parameter %s. | 当前可用区不支持指定参数。 |
400 | MasterSlaveServerConflict | The servers are conflict for MasterSlaveGroup. | 主备服务器组的后端服务器冲突。 |
400 | VipNotSupportQuicVersion | The listener does not support the parameter of QuicVersion. | 当前监听不支持QuicVersion参数。 |
400 | IllegalParam.HealthCheckType | The param of HealthCheckType is illegal. | 指定的HealthCheckType无效。请检查参数约束,并在修改后重试。 |
400 | MissingParam.HealthCheckMethod | The param of HealthCheckMethod is missing. | 参数HealthCheckMethod缺失。 |
400 | IllegalParam.HealthCheckMethod | The param of HealthCheckMethod is illegal. | 指定的HealthCheckMethod无效。请检查参数约束,并在修改后重试。 |
400 | IllegalParam.HealthCheck | The param of HealthCheck is illegal. | 指定的HealthCheck无效。请检查参数约束,并在修改后重试。 |
400 | OperationDenied.SpecialListenerPortNotAllowed | The operation is not allowed because port 4789 is reserved by the system. | 操作被拒绝,原因是4789是系统保留端口。 |
400 | Mismatch.SlbSpecTypeAndListenerProtocol | The SlbSpecType and ListenerProtocol are mismatched. | 实例规格类型和监听类型不匹配。 |
400 | OperationDenied.OnlyIpv4SlbSupport | The operation is not allowed because of OnlyIpv4SlbSupport. | 操作被拒绝,原因是只有IPV4实例支持开启FULL NAT模式。 |
400 | OperationDenied.FullNatModeNotAllowed | The operation is not allowed because of FullNatModeNotAllowed. | 操作被拒绝,原因是不支持FullNat模式。 |
400 | SpecNotSupportParameter | The instance with share spec does not support FullNatEnabled parameter. | 共享型实例不支持FullNatEnabled参数。 |
访问错误中心查看更多错误码。