调用SetLoadBalancerUDPListenerAttribute接口修改UDP协议监听的配置。
前提条件
- 您已经创建传统型负载均衡,具体操作,请参见CreateLoadBalancer。
- 您已经创建UDP监听,具体操作,请参见CreateLoadBalancerUDPListener。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
RegionId | String | 否 | cn-hangzhou |
传统型负载均衡实例的地域ID。 您可以通过调用DescribeRegions接口获取地域ID。 |
Action | String | 是 | SetLoadBalancerUDPListenerAttribute |
系统规定参数。取值: SetLoadBalancerUDPListenerAttribute。 |
LoadBalancerId | String | 是 | lb-bp1rtfnodmywb43ecu4sf-c**** |
传统型负载均衡实例的ID。 |
ListenerPort | Integer | 是 | 80 |
传统型负载均衡实例前端使用的端口。 取值范围:1~65535。 |
Bandwidth | Integer | 否 | -1 |
监听的带宽峰值,单位:Mbps。取值:
|
Scheduler | String | 否 | wrr |
调度算法。取值:
说明
|
HealthyThreshold | Integer | 否 | 4 |
健康检查连续成功多少次后,将后端服务器的健康检查状态由fail判定为success。 取值范围:1~10。 |
UnhealthyThreshold | Integer | 否 | 4 |
健康检查连续失败多少次后,将后端服务器的健康检查状态由success判定为fail。 取值范围:1~10。 |
HealthCheckConnectTimeout | Integer | 否 | 100 |
接收来自运行状况检查的响应需要等待的时间。如果后端ECS在指定的时间内没有正确响应,则判定为健康检查失败。单位:秒。 取值范围:1~300。 说明 如果HealthCheckConnectTimeout的值小于HealthCheckInterval的值,则HealthCheckConnectTimeout无效,超时时间为HealthCheckInterval的值。
|
HealthCheckConnectPort | Integer | 否 | 80 |
健康检查使用的端口。 取值范围:1~65535。 |
HealthCheckInterval | Integer | 否 | 5 |
健康检查的时间间隔,单位:秒。 取值范围:1~50。 |
healthCheckReq | String | 否 | hello |
UDP监听健康检查的请求串,只允许包含字母、数字,最大长度限制为64个字符。 |
healthCheckExp | String | 否 | ok |
UDP监听健康检查的响应串,只允许包含字母、数字,最大长度限制为64个字符。 |
VServerGroup | String | 否 | on |
是否使用虚拟服务器组。取值:
说明 VserverGroup和MasterSlaveServerGroup只允许一个值为on。
|
VServerGroupId | String | 否 | rsp-cige6**** |
虚拟服务器组ID。 |
MasterSlaveServerGroupId | String | 否 | rsp-0bfuc**** |
主备服务器组ID。 说明 服务器组ID和主备服务器组ID只能选择一个。
|
MasterSlaveServerGroup | String | 否 | on |
是否使用主备服务器组。取值:
说明 VserverGroup和MasterSlaveServerGroup只允许取值为on。
|
AclId | String | 否 | off |
监听绑定的访问策略组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 | CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?RegionId=cn-hangzhou
&Action=SetLoadBalancerUDPListenerAttribute
&LoadBalancerId=lb-bp1rtfnodmywb43ecu4sf-c****
&ListenerPort=80
&Bandwidth=-1
&Scheduler=wrr
&HealthyThreshold=4
&UnhealthyThreshold=4
&HealthCheckConnectTimeout=100
&HealthCheckConnectPort=80
&HealthCheckInterval=5
&healthCheckReq=hello
&healthCheckExp=ok
&VServerGroup=on
&VServerGroupId=rsp-cige6****
&MasterSlaveServerGroupId=rsp-0bfuc****
&MasterSlaveServerGroup=on
&AclId=off
&AclType=white
&AclStatus=off
&Description=udp_80
&ProxyProtocolV2Enabled=false
&HealthCheckSwitch=on
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<SetLoadBalancerUDPListenerAttributeResponse>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
</SetLoadBalancerUDPListenerAttributeResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
错误码
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 | 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 | OperationFailed.ServerGroupInUse | The VServerGroup or MasterSlaveServerGroup can not be close for this listener. | 操作失败,原因是当前监听不支持关闭服务器组。 |
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 | InvalidParam.PortRange | The specified PortRange is invalid. | 指定的PortRange无效。请检查参数约束,并在修改后重试。 |
400 | QuotaLimitExceeds.AclAttachedToListener | %s. | Acl绑定监听数已达到配额上限。 |
400 | QuotaLimitExceeds.TotalAclEntry | %s. | Acl条目数已达到配额上限。 |
400 | Duplicated.AclEntry | %s. | Acl条目重复。 |
400 | InvalidParamLength.HealthCheckReq | The length of the parameter HealthCheckReq is invalid. | 指定的HealthCheckReq无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParamLength.HealthCheckExp | The length of the parameter HealthCheckExp is invalid. | 指定的HealthCheckExp无效。请检查参数约束,并在修改后重试。 |
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 | MissingParam.VServerGroupId | The parameter VServerGroupId is missing. | 参数VServerGroupId缺失。 |
400 | VipNotSupportQuicVersion | The listener does not support the parameter of QuicVersion. | 当前监听不支持QuicVersion参数。 |
400 | IllegalParam.HealthCheckType | The param of HealthCheckType is illegal. | 指定的HealthCheckType无效。请检查参数约束,并在修改后重试。 |
400 | IllegalParam.HealthCheckMethod | The param of HealthCheckMethod is illegal. | 指定的HealthCheckMethod无效。请检查参数约束,并在修改后重试。 |
400 | IllegalParam.HealthCheck | The param of HealthCheck is illegal. | 指定的HealthCheck无效。请检查参数约束,并在修改后重试。 |
400 | OperationDenied.MasterSlaveGroupLogEnabled | The operation is denied because of MasterSlaveGroupLogEnabled. | 操作被拒绝,原因是主备服务器组日志已启用。 |
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参数。 |
访问错误中心查看更多错误码。