文档

CreateLoadBalancerUDPListener - 创建UDP监听

更新时间:

创建UDP监听。

接口说明

说明 新建的监听的状态为 stopped。创建完成后,调用 StartLoadBalancerListener 接口启动监听来转发流量。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
slb:CreateLoadBalancerUDPListenerWrite
  • acl
    acs:slb:{#regionId}:{#accountId}:acl/{#aclId}
  • loadbalancer
    acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}
  • slb:tag

请求参数

名称类型必填描述示例值
RegionIdstring

传统型负载均衡实例的地域 ID。

cn-hangzhou
Tagobject []

监听的标签集合。

Keystring

监听的标签键。N 的取值范围:1~20。一旦传入该值,则不允许为空字符串。最多支持 128 个字符,不能以aliyunacs:开头,不能包含http://https://

TestKey
Valuestring

监听的标签值。N 的取值范围:1~20。一旦传入该值,可以为空字符串。最多支持 128 个字符,不能以acs:开头,不能包含http://或者https://

TestValue
LoadBalancerIdstring

传统型负载均衡实例的 ID。

lb-bp1ygod3yctvg1y7****
ListenerPortinteger

传统型负载均衡实例前端使用的端口。

取值范围:1~65535

80
BackendServerPortinteger

传统型负载均衡实例后端使用的端口。

取值范围:1~65535

如果不使用虚拟服务器组(不指定 VServerGroupId),则该参数必选。

80
Bandwidthinteger

监听的带宽峰值。单位:Mbps。取值:

  • -1:对于按流量计费的公网负载均衡实例,可以将带宽峰值设置为**-1**,即不限制带宽峰值。
  • 1~5120:对于按带宽计费的公网负载均衡实例,可以设置每个监听的带宽峰值,但所有监听的带宽峰值之和不能超过实例的带宽峰值。
-1
Schedulerstring

调度算法。取值:

  • wrr(默认值):权重值越高的后端服务器,被轮询到的次数(概率)也越高。

  • rr:按照访问顺序依次将外部请求依序分发到后端服务器。

  • sch:基于源 IP 地址的一致性 hash,相同的源地址会调度到相同的后端服务器。

  • tch:基于四元组的一致性 hash(源 IP+目的 IP+源端口+目的端口),相同的流会调度到相同的后端服务器。

  • qch:基于 QUIC Connection ID 一致性 hash,相同的 QUIC Connection ID 会调度到相同的后端服务器。

仅性能保障型实例支持 sch、 tch 和 qch 一致性 hash 算法。

wrr
HealthyThresholdinteger

健康检查连续成功多少次后,将后端服务器的健康检查状态由 fail 判定为 success

取值范围:2~10

4
UnhealthyThresholdinteger

健康检查连续失败多少次后,将后端服务器的健康检查状态由 success 判定为 fail

取值范围:2~10

4
HealthCheckConnectTimeoutinteger

接收来自运行状况检查的响应需要等待的时间。

如果后端 ECS 在指定的时间内没有正确响应,则判定为健康检查失败。单位:秒。

取值范围:1~300

100
HealthCheckConnectPortinteger

健康检查使用的端口。

取值范围:1~65535

不设置此参数时,表示使用后端服务端口(BackendServerPort)。

80
healthCheckIntervalinteger

健康检查的时间间隔。单位:秒。

取值范围:1~50

3
healthCheckReqstring

UDP 监听健康检查的请求字符串,只允许包含字母、数字,最大长度限制为 64 个字符。

hello
healthCheckExpstring

UDP 监听健康检查的响应字符串,只允许包含字母、数字,最大长度限制为 64 个字符。

ok
VServerGroupIdstring

虚拟服务器组 ID。

rsp-cige6j8****
MasterSlaveServerGroupIdstring

主备服务器组 ID。

说明 虚拟服务器组 ID 和主备服务器组 ID 只能选择一个。
rsp-0bfucwu****
AclIdstring

监听绑定的访问策略组 ID。

AclStatus 参数的值为 on 时,该参数必选。

acl-uf60jw***
AclTypestring

访问控制类型,取值:

  • white:仅转发来自所选访问控制策略组中设置的 IP 地址或地址段的请求,白名单适用于应用只允许特定 IP 访问的场景。设置白名单存在一定业务风险,一旦设置白名单,就只有白名单中的 IP 可以访问负载均衡监听。

    如果开启了白名单访问,但访问策略组中没有添加任何 IP,则负载均衡监听会转发全部请求。

  • black:来自所选访问控制策略组中设置的 IP 地址或地址段的所有请求都不会转发,黑名单适用于应用只限制某些特定 IP 访问的场景。

    如果开启了黑名单访问,但访问策略组中没有添加任何 IP,则负载均衡监听会转发全部请求。

AclStatus 参数的值为 on 时,该参数有效。

white
AclStatusstring

是否开启访问控制功能。取值:

  • on:开启。
  • off(默认值):关闭。
off
Descriptionstring

自定义监听名称。

长度限制为 1~256 个字符,支持中文、字母、数字、短划线(-)、正斜线(/)、半角句号(.)和下划线(_)。

udp_80
ProxyProtocolV2Enabledboolean

是否支持通过 Proxy Protocol 协议携带客户端源地址到后端服务器。取值:

  • true:是。
  • false(默认值):否。
false
HealthCheckSwitchstring

是否开启健康检查。取值:

  • on(默认值):开启。
  • off:关闭。
on

返回参数

名称类型描述示例值
object
RequestIdstring

请求 ID。

06F00FBB-3D9E-4CCE-9D43-1A6946A75556

示例

正常返回示例

JSON格式

{
  "RequestId": "06F00FBB-3D9E-4CCE-9D43-1A6946A75556"
}

错误码

HTTP status code错误码错误信息描述
400InvalidParameterValue.SpecNotSupportThe loadBalancer of shared spec does not support the parameter value, %s.共享型负载均衡实例不支持指定的参数取值。
400OperationNotSupport.AclThe cloud box instance does not support acl.云盒实例不支持配置访问控制。
400InvalidParameterValue.RegionNotSupportThe region does not support the parameter value, %s.当前地域不支持指定的参数取值。
400Abs.VServerGroupIdAndMasterSlaveServerGroupId.MissMatchThe parameters VServerGroupId or MasterSlaveServerGroupId miss match.参数VServerGroupId或MasterSlaveServerGroupId不匹配。
400IpVersionConflictThe ip version of this LoadBalancer and the Acl is conflict.指定负载均衡的IP版本与ACL支持的IP类型冲突。
400InvalidParameterValue.ZoneNotSupportThe zone does not support the parameter value, %s.当前可用区不支持指定参数取值。
400ListenerProcessingA previous configuration of the listener is pending,please try again later.当前监听正在配置中,请稍后重试。
400AclNotExistAcl does not exist.指定的Acl不存在。
400InvalidParameter.ListenerPortConflictThere is conflict listener port exists.指定的监听端口已存在。
400InvalidParam.VServerGroupIdThe specified VServerGroupId is invalid.指定的VServerGroupId无效。请检查参数约束,并在修改后重试。
400MissingParam.HealthCheckConnectPortThe parameter HealthCheckConnectPort is required.参数HealthCheckConnectPort缺失。
400InvalidParam.ListenerPortThe specified ListenerPort is invalid.指定的ListenerPort无效。请检查参数约束,并在修改后重试。
400InvalidParam.StartPortThe specified StartPort is invalid.指定的StartPort无效。请检查参数约束,并在修改后重试。
400InvalidParamSize.PortRangeThe size of param PortRange is invalid.指定的PortRange无效。请检查参数约束,并在修改后重试。
400InvalidParam.EndPortThe specified EndPort is invalid.指定的EndPort无效。请检查参数约束,并在修改后重试。
400QuotaLimitExceeds.AclAttachedToListener%s.-
400QuotaLimitExceeds.TotalAclEntry%s.-
400AclListenerOverLimit%s.-
400Duplicated.AclEntry%s.Acl条目重复。
400InvalidParameter.RegionNotSupportThe region does not support the parameter: %s.当前区域不支持指定参数。
400LbNotSupportTcpsslYou cannot create a TCP SSL type listener for the specified load balancer.指定的实例不支持创建tcpssl类型的监听。
400LbSupportTcpsslOnlyThe specified load balancer supports TCP SSL type listener only.指定的实例只支持创建tcpssl类型的监听。
400ListenerNotSupportRuleYou cannot create a rule for the specified listener.指定的监听不支持创建转发规则。
400InvalidParamLength.HealthCheckExpThe length of the parameter HealthCheckReq is invalid.指定的HealthCheckExp无效。请检查参数约束,并在修改后重试。
400InvalidParamLength.HealthCheckReqThe length of the parameter HealthCheckReq is invalid.指定的HealthCheckReq无效。请检查参数约束,并在修改后重试。
400InvalidParam.HealthCheckReqThe param HealthCheckReq is invalid.指定的HealthCheckReq无效。请检查参数约束,并在修改后重试。
400InvalidParam.HealthCheckExpThe param HealthCheckExp is invalid.指定的HealthCheckExp无效。请检查参数约束,并在修改后重试。
400ResourceNotFound.VServerGroup%s.指定的服务器组不存在。
400IllegalParam.FailoverThresholdThe parameter FailoverThreshold is illegal.指定的FailoverThreshold无效。请检查参数约束,并在修改后重试。
400IllegalParam.FailoverStrategyThe parameter FailoverStrategy is illegal.指定的FailoverStrategy无效。请检查参数约束,并在修改后重试。
400InvalidParameter.ZoneNotSupportThe zone does not support the parameter %s.当前可用区不支持指定参数。
400MasterSlaveServerConflictThe servers are conflict for MasterSlaveGroup.主备服务器组的后端服务器冲突。
400VipNotSupportQuicVersionThe listener does not support the parameter of QuicVersion.当前监听不支持QuicVersion参数。
400IllegalParam.HealthCheckTypeThe param of HealthCheckType is illegal.指定的HealthCheckType无效。请检查参数约束,并在修改后重试。
400MissingParam.HealthCheckMethodThe param of HealthCheckMethod is missing.参数HealthCheckMethod缺失。
400IllegalParam.HealthCheckMethodThe param of HealthCheckMethod is illegal.指定的HealthCheckMethod无效。请检查参数约束,并在修改后重试。
400IllegalParam.HealthCheckThe param of HealthCheck is illegal.指定的HealthCheck无效。请检查参数约束,并在修改后重试。
400OperationDenied.SpecialListenerPortNotAllowedThe operation is not allowed because port 4789 is reserved by the system.操作被拒绝,原因是4789是系统保留端口。
400Mismatch.SlbSpecTypeAndListenerProtocolThe SlbSpecType and ListenerProtocol are mismatched.实例规格类型和监听类型不匹配。
400OperationDenied.OnlyIpv4SlbSupportThe operation is not allowed because of OnlyIpv4SlbSupport.操作被拒绝,原因是只有IPV4实例支持开启FULL NAT模式。
400OperationDenied.FullNatModeNotAllowedThe operation is not allowed because of FullNatModeNotAllowed.操作被拒绝,原因是不支持FullNat模式。
400SpecNotSupportParameterThe instance with share spec does not support FullNatEnabled parameter.共享型实例不支持FullNatEnabled参数。
400InvalidParam.TagValue %s.-
400InvalidParam.TagKey%s.-
400SizeLimitExceeded.Tag%s.-
400MissingParam.TagKeyThe param MissingParam.TagKey is missing.-

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2023-06-02OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
  • 本页导读 (1)
文档反馈