You need to enable JavaScript to run this app.
导航

ModifyListenerAttributes

最近更新时间2023.11.16 15:51:40

首次发布时间2021.08.31 10:37:27

调用 ModifyListenerAttributes 接口修改指定监听器。

调试

请求参数

名称类型是否必填示例值
描述
ActionStringModifyListenerAttributes要执行的操作,取值为ModifyListenerAttributes。
VersionString2020-04-01API版本信息,当前版本为:2020-04-01。
ListenerIdStringlsn-2fek3rgsxhrsw5oxruwec****监听器ID。您可以调用DescribeListeners接口获取监听器ID。

ListenerName

String

mylistener

监听器的名称。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:点号(.)、下划线(_)和中划线(-)。
  • 长度限制在1 ~ 128字符之间。

Scheduler

Sting

wrr

监听器使用的调度算法。取值如下:

  • wrr (默认值):加权轮询,权重值越高的后端服务器,被轮询到的次数(概率)越高。
  • wlc:加权最小连接数,在最少连接数的基础上,根据服务器的不同处理能力,给每个服务器分配不同的权重,使其能够接受相应权值数的服务请求。
  • sh:源地址哈希,基于源IP地址的一致性哈希,相同的源地址会调度到相同的后端服务器。
CertificateIdStringcert-bp1o94dp5i6ea****监听器关联的证书ID。您可以调用DescribeCertificates接口获取证书ID。

EstablishedTimeout

Integer

800

监听器的连接超时时间。取值如下:

  • TCP协议:10-900秒。
  • UDP协议:1-300秒。
目前仅针对协议为TCP/UDP的监听器生效。如果监听器协议为 HTTP/HTTPS,此参数不生效。

AclStatus

String

off

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

  • on:开启。
  • off:不开启。
该参数不传入数值时,保持原有配置,表示不修改访问控制相关信息,配置本参数后会清空已配置的AclTypeAclIds参数。

说明

  • 如果将本参数值从 on 修改为 off,将清空AclTypeAclIds参数中的值。
  • 如果将本参数值从 off 修改为 on,则必须同时设置AclTypeAclIds参数的值。

AclType

String

black

访问控制的方式。取值如下:

  • white:白名单方式。表示监听器仅转发来自所选访问控制策略组中设置的IP地址或地址段的请求。如果所选策略组中没有添加任何IP,则监听器不会转发任何请求。
  • black:黑名单方式。表示仅拒绝来自所选访问控制策略组中设置的IP地址或地址段的请求。 如果所选策略组中没有添加任何IP,则监听器会转发全部请求。

说明

AclStatus参数配置为 on 时,AclTypeAclIds.N为必填。

Bandwidth

Integer

10

监听器的带宽峰值,单位为Mbps。

  • 设置为-1,表示监听器不指定限速。此时监听器的带宽峰值默认为CLB实例规格的剩余带宽。
  • 监听器带宽峰值最大不能超过所属CLB实例的规格带宽,CLB实例的规格带宽请参见产品规格

说明

监听器限速功能正在邀测中,如需使用,请提交工单或联系客户经理申请。

AclIds.N

String

AclIds.1=acl-3cj44nv0jhhxc6c6rrtet****&AclIds.2=acl-2febxt4pu0zy85oxruw0t****

监听器绑定的访问控制策略组ID。您可以调用DescribeAcls接口获取访问控制策略组ID。

  • 参数 - N:表示访问控制策略组的序号,数量上限为5个。
  • 多个访问控制策略组ID间使用“&”分隔。

说明

AclStatus参数配置为 on 时,AclTypeAclIds.N为必填。

Enabled

String

off

是否启用监听器。取值如下:

  • on:开启。
  • off:不开启。

Description

String

This is a listener.

监听器的描述。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。
  • 长度限制为0 ~ 255个字符。

ServerGroupId

String

rsp-bp1o94dp5i6ea****

监听器关联的后端服务组ID。

  • 对于HTTP/HTTPS监听器,此参数代表关联的默认后端服务器组ID。您可以调用DescribeServerGroups接口获取后端服务器组ID。
  • 2021年8月30日后,七层监听器上线默认后端服务器组功能,编辑存量七层监听器时,此参数为必选,否则将无法修改监听器的其他属性。

ProxyProtocolType

String

off

是否启用PP协议。取值如下:

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

说明

参数Protocol配置为TCP或UDP时,该参数生效。

PersistenceType

String

off

会话保持的类型。取值如下:

  • off(默认值):表示不启用会话保持。
  • source_ip:表示源地址IP。

说明

  • 仅TCP或UDP协议的监听器该参数生效。
  • 会话保持功能正在邀测中,如需使用,请提交工单或联系客户经理申请。

PersistenceTimeout

Integer

10

会话保持的超时时间。取值范围为1~3600,单位为秒。默认值为1000秒。

说明

参数PersistenceType配置为source_ip时,该参数生效。

ConnectionDrainEnabled

String

on

监听器是否开启连接优雅中断功能。取值如下:

  • on:开启。
  • off:不开启。

说明

  • 仅四层监听器(TCP或UDP协议)支持配置为on。
  • 该功能正在邀测中,如需使用,请提交工单或联系客户经理申请。

ConnectionDrainTimeout

Integer

2

连接优雅中断的超时时间。取值范围为0~900,单位为秒。

  • 参数ConnectionDrainEnabled配置为on时,该参数为必填。
  • 参数ConnectionDrainEnabled配置为off时,该参数默认为0。

HealthCheck.Enabled

String

on

监听器是否开启健康检查功能。

  • on:开启。
  • off:不开启。

说明

以下参数仅当本参数的值为 on 时有效。

HealthCheck.Timeout

Integer

2

健康检查的响应超时时间,表示如果后端服务器在指定的时间内没有正确响应,则判定为健康检查“异常”。
取值范围为1 ~ 60,默认值为2,单位为秒。

说明

响应超时时间需小于等于检查时间间隔。

HealthCheck.HealthyThreshold

Integer

3

健康检查的健康阈值,表示连续执行指定次数的健康检查,结果均为“正常”的后端服务器将被判定为健康检查“正常”。
取值范围为2 ~ 10,默认值为3,单位为次。

HealthCheck.UnhealthyThreshold

Integer

3

健康检查的不健康阈值,表示连续执行指定次数的健康检查,结果均为“异常”的后端服务器将被判定为健康检查异常。
取值范围为2 ~ 10,默认值为3,单位为次。

HealthCheck.UdpRequest

String

Request123

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

说明

  • 当参数Protocol配置为UDP,且参数HealthCheck.Enabled配置为on时,该参数生效。
  • 参数HealthCheck.UdpRequestHealthCheck.UdpExpect的取值只能同时为空或同时不为空。

HealthCheck.UdpExpect

String

Expect123

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

说明

  • 当参数Protocol配置为UDP,且参数HealthCheck.Enabled配置为on时,该参数生效。
  • 参数HealthCheck.UdpRequestHealthCheck.UdpExpect的取值只能同时为空或同时不为空。
HealthCheck.IntervalInteger2执行健康检查的时间间隔,取值范围为1 ~ 300,默认值为2,单位为秒。

HealthCheck.Method

String

HEAD

监听器健康检查的方法。取值有以下几种:

  • GET(默认值):服务器需支持GET方法。
  • HEAD:服务器仅返回HEAD头部信息,可以降低后端开销,但要求服务器支持HEAD方法。

说明

当参数Protocol配置为HTTP或HTTPS,且参数HealthCheck.Enabled配置为on时,该参数生效。

HealthCheck.Domain

String

www.test.com

健康检查的域名,需配置为后端服务器上真实对外提供服务的地址。

  • 需至少包含一个点号(.),且不允许以点号(.)开头或结尾。
  • 单个字符串由字母、数字、中划线(-)、点号(.)字符组成,中划线(-)不得出现在字符串的头部或尾部。
  • 长度限制为1 ~ 128个字符。
  • 不传入该参数或该参数不传入数值时,默认为空,表示负载均衡使用各后端服务器的私网IP地址进行健康检查。

说明

当参数Protocol配置为HTTP或HTTPS,且参数HealthCheck.Enabled配置为on时,该参数生效。

HealthCheck.URI

String

/test

健康检查的路径,需配置为后端服务器上真实对外提供服务的地址。

  • 必须以字符斜线(/)开头。
  • 仅包含字母、数字、中划线(-)、下划线(_)、斜线(/)、点号(.)、百分号(%)、英文问号(?)、#、&、等号(=)字符。
  • 长度限制为1 ~ 128个字符。
  • 不传入该参数或该参数不传入数值时,默认为“/”。

说明

当参数Protocol配置为HTTP或HTTPS,且参数HealthCheck.Enabled配置为on时,该参数生效。

HealthCheck.HttpCode

String

"http_2xx,http_3xx"

健康检查正常的HTTP状态码。取值如下:

  • http_2xx (默认值)
  • http_3xx
  • http_4xx
  • http_5xx
多个状态码间用半角逗号“,”分隔。

说明

当参数Protocol配置为HTTP或HTTPS,且参数HealthCheck.Enabled配置为on时,该参数生效。

返回数据

字段类型示例值描述
RequestIdString20210811152539010225146063030****请求ID。

请求示例

GET /?Action=ModifyListenerAttributes&Version=2020-04-01&ListenerId=lsn-2fek3rgsxhrsw5oxruwec****&ListenerName=test&Scheduler=wlc HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: clb

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20210811152539010225146063030****",
        "Action": "ModifyListenerAttributes",
        "Version": "2020-04-01",
        "Service": "clb",
        "Region": "cn-beijing"
    },
    "Result": {
        "RequestId": "20210811152539010225146063030****"
    }
}

错误码

此处仅展示当前API的错误码,更多错误码请参见公共错误码

HttpCode错误码错误信息描述

400

MissingParameter

The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, the 'XXX'.

该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如XXX

说明

其中,XXX表示缺少的参数名称。

400InvalidPersistenceTimeout.MalformedThe specified PersistenceTimeout is malformed.指定的 PersistenceTimeout 参数格式不合法。
400InvalidPersistenceType.MalformedThe specified PersistenceType is malformed.指定的 PersistenceType 参数格式不合法。
400InvalidProtocol.MalformedThe specified Protocol is malformed.指定的 Protocol 参数格式不合法。
400InvalidProxyProtocolType.MalformedThe specified ProxyProtocolType is malformed.指定的 ProxyProtocolType 参数格式不合法。
400InvalidName.MalformedThe specified Name is malformed.指定的 Name 参数格式不合法。
400InvalidAclStatus.MalformedThe specified AclStatus is malformed.指定的 AclStatus 参数格式不合法。
400InvalidAclType.MalformedThe specified AclType is malformed.指定的 AclType 参数格式不合法。
400InvalidDescription.MalformedThe specified Description is malformed.指定的 Description 参数格式不合法。
400InvalidEnabled.MalformedThe specified Enabled is malformed.指定的 Enabled 参数格式不合法。
400InvalidEstablishedTimeout.MalformedThe specified EstablishedTimeout is malformed.指定的 EstablishedTimeout 参数格式不合法。
400InvalidHealthCheck.Domain.MalformedThe specified HealthCheck.Domain is malformed.指定的 HealthCheck.Domain 参数格式不合法。
400InvalidHealthCheck.Enabled.MalformedThe specified HealthCheck.Enabled is malformed.指定的 HealthCheck.Enabled 参数格式不合法。
400InvalidHealthCheck.HealthyThreshold.MalformedThe specified HealthCheck.HealthyThreshold is malformed.指定的 HealthCheck.HealthyThreshold 参数格式不合法。
400InvalidHealthCheck.HttpCode.MalformedThe specified HealthCheck.HttpCode is malformed.指定的 HealthCheck.HttpCode 参数格式不合法。
400InvalidHealthCheck.Interval.MalformedThe specified HealthCheck.Interval is malformed.指定的 HealthCheck.Interval 参数格式不合法。
400InvalidHealthCheck.Method.MalformedThe specified HealthCheck.Method is malformed.指定的 HealthCheck.Method 参数格式不合法。
400InvalidHealthCheck.Timeout.MalformedThe specified HealthCheck.Timeout is malformed.指定的 HealthCheck.Timeout 参数格式不合法。
400InvalidHealthCheck.URI.MalformedThe specified HealthCheck.URI is malformed.指定的 HealthCheck.URI 参数格式不合法。
400InvalidHealthCheck.UdpExpect.MalformedThe specified HealthCheck.UdpExpect is malformed.指定的 HealthCheck.UdpExpect 参数格式不合法。
400InvalidHealthCheck.UdpRequest.MalformedThe specified HealthCheck.UdpRequest is malformed.指定的 HealthCheck.UdpRequest 参数格式不合法。
400InvalidHealthCheck.UnhealthyThreshold.MalformedThe specified HealthCheck.UnhealthyThreshold is malformed.指定的 HealthCheck.UnhealthyThreshold 参数格式不合法。
400InvalidScheduler.MalformedThe specified Scheduler is malformed.指定的 Scheduler 参数格式不合法。
400InvalidBandwidth.MalformedThe specified Bandwidth is malformed.指定的 Bandwidth 参数格式不合法。
400InvalidLoadBalancer.InvalidStatusThe specified LoadBalancer is not in the correct status for the request.指定的负载均衡实例所处状态无法响应该请求。
400QuotaExceed.ListenerNumberEachAclYou've reached the limit on the number of listeners that you can associate.已达到 ACL 可关联的监听器的数量的配额上限。
400LimitExceeded.AclNumbersYou've reached the limit on the number of ACL that you can associate.已达到可关联的 ACL 的数量上限。
400InvalidServerGroup.LoadBalancerMismatchThe specified ServerGroup and LoadBalancer are not matched.指定后端服务器组与负载均衡不匹配。
400UnsupportedOperation.AccountArrearsThe request is denied due to the account arrears status.因账户处于欠费状态,该请求被拒绝。
400InvalidLoadBalancerOrAcl.UnSupportActionThe specified LoadBalancer or Acl status does not support this action.指定的负载均衡或者 ACL 状态不支持当前操作。
400InvalidListenerServerGroup.UnSupportActionThe specified Listener does not support this action.指定的监听器未绑定默认后端服务器组,不支持当前操作。
400UnsupportedOperation.AccountArrearsThe request on the specified instance is denied due to the account in arrears status.因账户处于欠费状态,对于该实例的操作请求被拒绝。
400InvalidLoadBalancer.UnSupportActionThe specified LoadBalancer does not support this action.指定的负载均衡不支持当前操作。
400InvalidProtocol.ServerGroupIpVersionMismatchThe specified Protocol and ServerGroup IpVersion are not matched.指定的协议与服务器组 IP 版本不匹配。
400InvalidConnectionDrainEnabled.MalformedThe specified ConnectionDrainEnabled is malformed.指定的 ConnectionDrainEnabled 参数格式不合法。
400InvalidConnectionDrainTimeout.MalformedThe specified ConnectionDrainTimeout is malformed.指定的 ConnectionDrainTimeout 参数格式不合法。
400InvalidListener.UnSupportActionThe specified Listener does not support this action.指定的监听器不支持当前操作。
403InvalidResourceType.ServcieManagedThe specified ResourceType is managed by a service.指定的资源是服务托管资源。
403ForbiddenYou are not authorized to perform operations on the specified service; for example, the 'Bandwidth'.无权限对指定服务进行操作,比如 Bandwidth。
404InvalidListener.NotFoundThe specified Listener does not exist.指定的监听器不存在。
404InvalidSeverGroup.NotFoundThe specified SeverGroup does not exist.指定的后端服务器组不存在。
404InvalidAcl.NotFoundThe specified ACL does not exist.指定的 ACL 不存在。
404InvalidCertificate.NotFoundThe specified Certificate does not exist.指定的证书不存在。
404InvalidExclusiveCluster.NotFoundThe specified ExclusiveCluster does not exist.指定的独占集群不存在。
409InvalidOperation.ConflictThe specified resource operation conflicts.指定的资源操作冲突。
409InvalidAclId.ConflictThe specified AclId already exists.指定的 ACL 已存在。
412InvalidLoadBalancer.ExpiredThe specified LoadBalancer has expired.指定的负载均衡已过期。
412InvalidExclusiveCluster.ExpiredThe specified ExclusiveCluster has expired.指定的独占集群已过期。
412InvalidExclusiveCluster.UnPurchasedThe specified ExclusiveCluster is not purchased.指定的独占集群未购买。