SetLoadBalancerUDPListenerAttribute

Updated at:

Modifies the configurations of a UDP listener.

Operation description

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

slb:SetLoadBalancerUDPListenerAttribute

update

*acl

acs:slb:{#regionId}:{#accountId}:acl/{#aclId}

*loadbalancer

acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}

  • slb:tag
  • slb:tag
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID of the classic Server Load Balancer (SLB) instance.

You can invoke the DescribeRegions operation to obtain region IDs.

cn-hangzhou

LoadBalancerId

string

Yes

The ID of the classic Server Load Balancer (SLB) instance.

lb-bp1rtfnodmywb43ecu4sf-c****

ListenerPort

integer

Yes

The frontend port used by the classic Server Load Balancer (SLB) instance.

Valid values: 1 to 65535.

80

Bandwidth

integer

No

The peak bandwidth of the listener. Unit: Mbit/s. Valid values:

  • -1: For an Internet-facing Server Load Balancer (SLB) instance that uses pay-by-traffic billing, you can change the peak bandwidth Settings to -1, which indicates that the peak bandwidth is not limited.

  • 1 to 5120: For an Internet-facing Server Load Balancer (SLB) instance that uses pay-by-bandwidth billing, you can set the peak bandwidth for each listener. However, the sum of the peak bandwidth values of all listeners cannot exceed the peak bandwidth of the instance.

-1

Scheduler

string

No

The scheduling algorithm. Valid values:

  • wrr: Backend servers with higher weights have a higher polling frequency (probability). If backend servers have the same weight, the backend server with fewer current connections has a higher polling frequency (probability).

  • rr: Requests are distributed to backend servers in the order of access.

  • sch: Consistent hash algorithm based on source IP addresses. Requests from the same source IP address are scheduled to the same backend server.

  • tch: Consistent hash algorithm based on 4-tuples (source IP address, destination IP address, source port, and destination port). Requests from the same flow are scheduled to the same backend server.

  • qch: Consistent hash algorithm based on QUIC connection IDs. Requests with the same QUIC connection ID are scheduled to the same backend server.

Note
  • Only high-performance instances support the sch, tch, and qch scheduling algorithms.

  • CLB does not support changing the wrr or rr algorithm to a consistent hash algorithm, nor does it support switching between consistent hash algorithms.

wrr

HealthyThreshold

integer

No

The number of consecutive successful health checks that must occur before a backend server is declared healthy (from fail to success).

Valid values: 1 to 10.

4

UnhealthyThreshold

integer

No

The number of consecutive failed health checks that must occur before a backend server is declared unhealthy (from success to fail).

Valid values: 1 to 10.

4

HealthCheckConnectTimeout

integer

No

The timeout period for a health check response. If a backend Elastic Compute Service (ECS) instance does not send a correct response within the specified timeout period, the health check fails. Unit: seconds.

Valid values: 1 to 300.

Note

If the value of HealthCheckConnectTimeout is less than the value of HealthCheckInterval, HealthCheckConnectTimeout is ignored and the timeout period is the value of HealthCheckInterval.

100

HealthCheckConnectPort

integer

No

The port used for health checks.

Valid values: 1 to 65535.

80

HealthCheckInterval

integer

No

The interval between two consecutive health checks. Unit: seconds.

Valid values: 1 to 50.

5

healthCheckReq

string

No

The request string for UDP listener health checks. The string can contain only letters and digits, and can be up to 64 characters in length.

hello

healthCheckExp

string

No

The response string for UDP listener health checks. The string can contain only letters and digits, and can be up to 64 characters in length.

ok

VServerGroup

string

No

Specifies whether to use a vServer group (virtual service group). Valid values:

  • on: yes.

  • off: no.

Note

Only one of VServerGroup and MasterSlaveServerGroup can be set to on.

on

VServerGroupId

string

No

The ID of the vServer group (virtual service group).

rsp-cige6****

MasterSlaveServerGroupId

string

No

The ID of the primary/secondary server group.

Note

You can specify only one of the vServer group (virtual service group) ID and the primary/secondary server group ID.

rsp-0bfuc****

MasterSlaveServerGroup

string

No

Specifies whether to use a primary/secondary server group. Valid values:

  • on: yes.

  • off: no.

Note

Only one of VServerGroup and MasterSlaveServerGroup can be set to on.

on

AclId

string

No

The ID of the access control list (ACL) to which the listener is bound.

Note

This parameter is required when AclStatus is set to on.

off

AclType

string

No

The access control type. Valid values:

  • white: Only requests from the IP addresses or CIDR blocks configured in the Settings of the selected access control policy group are forwarded. Whitelists apply to scenarios in which only specific IP addresses are allowed to access the application. Using a whitelist poses business risks. After a whitelist is configured, only IP addresses in the whitelist can access the Server Load Balancer (SLB) listener.

    If a whitelist is enabled but no IP addresses are added to the policy group, the Server Load Balancer (SLB) listener forwards all requests.

  • black: Requests from the IP addresses or CIDR blocks configured in the Settings of the selected access control policy group are not forwarded. Blacklists apply to scenarios in which specific IP addresses are blocked from accessing the application.

    If a blacklist is enabled but no IP addresses are added to the policy group, the Server Load Balancer (SLB) listener forwards all requests.

Note

This parameter takes effect only when AclStatus is set to on.

white

AclStatus

string

No

Specifies whether to enable access control. Valid values:

  • on: yes.

  • off: no.

off

Description

string

No

The custom name of the listener.

The name must be 1 to 256 characters in length, and can contain Chinese characters, letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).

udp_80

ProxyProtocolV2Enabled

boolean

No

Specifies whether to use the Proxy Protocol to pass the client source IP address to backend servers. Valid values:

  • true: yes.

  • false (default): no.

false

HealthCheckSwitch

string

No

Specifies whether to enable health checks. Valid values:

  • on (default): yes.

  • off: no.

on

DryRun

boolean

No

Specifies whether to perform only a dry run on the request. Valid values:

  • true: performs a dry run and does not perform the actual operation. If the request passes the dry run, the DryRunOperation error code is returned.

  • false (default): performs a dry run and performs the actual operation if the request passes the dry run.

false

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

CEF72CEB-54B6-4AE8-B225-F876FF7BA984

Examples

Success response

JSON format

{
  "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameterValue.SpecNotSupport The loadBalancer of shared spec does not support the parameter value, %s. The specified parameter value is not supported by shared-resource SLB instances.
400 OperationNotSupport.Acl The cloud box instance does not support acl. CloudBox instances do not support access control configuration.
400 InvalidParameterValue.RegionNotSupport The region does not support the parameter value, %s. The specified parameter value is not supported in the current region.
400 IpVersionConflict The ip version of this LoadBalancer and the Acl is conflict. The IP version of the specified Server Load Balancer instance conflicts with the IP type supported by the ACL.
400 InvalidParameterValue.ZoneNotSupport The zone does not support the parameter value, %s. The specified parameter value is not supported in the current zone.
400 OperationFailed.ServerGroupInUse The VServerGroup or MasterSlaveServerGroup can not be close for this listener. The operation failed because the current listener does not support disabling the server group.
400 InvalidParam.VServerGroupId The specified VServerGroupId is invalid. The specified VServerGroupId is invalid. Check the parameter constraints and try again.
400 MissingParam.HealthCheckConnectPort The parameter HealthCheckConnectPort is required. The HealthCheckConnectPort parameter is missing.
400 InvalidParam.ListenerPort The specified ListenerPort is invalid. The specified ListenerPort is invalid. Check the parameter constraints and try again after you make modifications.
400 InvalidParam.StartPort The specified StartPort is invalid. The specified StartPort is invalid. Check the parameter constraints and try again.
400 InvalidParamSize.PortRange The size of param PortRange is invalid. The specified PortRange is invalid. Check the parameter constraints and try again after you make modifications.
400 InvalidParam.EndPort The specified EndPort is invalid. The specified EndPort is invalid. Check the parameter constraints and try again after you make modifications.
400 InvalidParam.PortRange The specified PortRange is invalid. The specified PortRange is invalid. Check the parameter constraints and try again after you make modifications.
400 Duplicated.AclEntry %s. %s
400 InvalidParamLength.HealthCheckReq The length of the parameter HealthCheckReq is invalid. The specified HealthCheckReq is invalid. Check the parameter constraints and try again after you make modifications.
400 InvalidParamLength.HealthCheckExp The length of the parameter HealthCheckExp is invalid. The specified HealthCheckExp is invalid. Check the parameter constraints and try again after you make modifications.
400 InvalidParam.HealthCheckReq The param HealthCheckReq is invalid. The specified HealthCheckReq is invalid. Check the parameter constraints and try again after you make modifications.
400 InvalidParam.HealthCheckExp The param HealthCheckExp is invalid. The specified HealthCheckExp is invalid. Check the parameter constraints and try again after you make modifications.
400 ResourceNotFound.VServerGroup %s. The specified server group does not exist.
400 IllegalParam.FailoverThreshold The parameter FailoverThreshold is illegal. The specified FailoverThreshold is invalid. Check the parameter constraints and try again after modification.
400 IllegalParam.FailoverStrategy The parameter FailoverStrategy is illegal. The specified FailoverStrategy is invalid. Check the parameter constraints and try again after modification.
400 InvalidParameter.ZoneNotSupport The zone does not support the parameter %s. The specified parameter is not supported in the current zone.
400 MasterSlaveServerConflict The servers are conflict for MasterSlaveGroup. The backend servers in the primary/secondary server group conflict.
400 MissingParam.VServerGroupId The parameter VServerGroupId is missing. The VServerGroupId parameter is missing.
400 VipNotSupportQuicVersion The listener does not support the parameter of QuicVersion. The QuicVersion parameter is not supported for the current listener.
400 IllegalParam.HealthCheckType The param of HealthCheckType is illegal. The specified HealthCheckType is invalid. Check the parameter constraints and try again.
400 IllegalParam.HealthCheckMethod The param of HealthCheckMethod is illegal. The specified HealthCheckMethod is invalid. Check the parameter constraints and try again.
400 IllegalParam.HealthCheck The param of HealthCheck is illegal. The specified HealthCheck is invalid. Check the parameter constraints and try again.
400 OperationDenied.MasterSlaveGroupLogEnabled The operation is denied because of MasterSlaveGroupLogEnabled. The operation is rejected because logging is enabled for the primary/secondary server group.
400 OperationDenied.OnlyIpv4SlbSupport The operation is not allowed because of OnlyIpv4SlbSupport. The operation is rejected because only IPv4 instances support enabling FULL NAT mode.
400 OperationDenied.FullNatModeNotAllowed The operation is not allowed because of FullNatModeNotAllowed. The operation is rejected because FullNat mode is not supported.
400 SpecNotSupportParameter The instance with share spec does not support FullNatEnabled parameter. Shared-resource instances do not support the FullNatEnabled parameter.
400 Abs.VServerGroupIdAndMasterSlaveServerGroupId.MissMatch Virtual service group ID or master slave server group ID is missing. Please check the input parameters. The VServerGroupId or MasterSlaveServerGroupId parameter does not match.
400 AclListenerOverLimit This acl has reached the limit of binding to listeners. The number of listeners that can be associated with the specified ACL has reached the quota limit.
400 QuotaLimitExceeds.AclAttachedToListener The number of Acl bound listeners has reached the quota limit The number of listeners associated with the ACL has reached the quota limit.
400 QuotaLimitExceeds.TotalAclEntry The number of Acl entries has reached the quota limit. The number of ACL entries has reached the quota limit.
400 QuotaLimitExceeds.AclListenerOverLimit This acl has reached the limit of binding to listeners. The number of listeners that can be associated with the specified ACL has reached the quota limit.
400 DryRunOperation Request validation has been passed with DryRun flag set. Request validation has been passed with DryRun flag set.
403 UnauthorizedRegion The specified region of is not authorized. The specified region of is not authorized.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.