All Products
Search
Document Center

Server Load Balancer:UpdateListenerAttribute

Last Updated:Feb 20, 2025

Updates the attributes of a listener, such as the name and the default action.

Operation description

UpdateListenerAttribute is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the GetListenerAttribute operation to query the status of the task.

  • If a listener is in the Configuring state, the configuration of the listener is being modified.
  • If a listener is in the Running state, the configuration of the listener is modified.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
alb:UpdateListenerAttributeupdate
*LoadBalancer
acs:alb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}
*SecurityPolicy
acs:alb:{#regionId}:{#accountId}:securitypolicy/{#securitypolicyId}
*ServerGroup
acs:alb:{#regionId}:{#accountId}:servergroup/{#servergroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ListenerIdstringYes

The ID of the Application Load Balancer (ALB) instance.

lsr-bp1bpn0kn908w4nbw****
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
5A2CFF0E-5718-45B5-9D4D-70B3FF3898
DryRunbooleanNo

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
false
ListenerDescriptionstringNo

The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

HTTP_80
RequestTimeoutintegerNo

The timeout period of a request. Unit: seconds. Valid values: 1 to 180.

If no response is received from the backend server within the specified timeout period, ALB returns an HTTP 504 error code to the client.

3
IdleTimeoutintegerNo

The timeout period of an idle connection. Unit: seconds. Valid values: 1 to 60.

If no request is received within the specified timeout period, ALB closes the current connection. When another request is received, ALB establishes a new connection.

15
GzipEnabledbooleanNo

Specifies whether to enable GZIP compression for specific types of files. Valid values:

  • true
  • false
true
Http2EnabledbooleanNo

Specifies whether to enable HTTP/2. Valid values:

  • true
  • false
Note This parameter is available only when you create an HTTPS listener.
true
SecurityPolicyIdstringNo

The security policy ID. System security policies and custom security policies are supported.

Note This parameter is available only when you create an HTTPS listener.
tls_cipher_policy_1_0
CaEnabledbooleanNo

Specifies whether to enable mutual authentication. Valid values:

  • true
  • false
false
XForwardedForConfigobjectNo

The configurations of the X-Forwarded-For header.

XForwardedForClientCertClientVerifyAliasstringNo

The name of the custom header. The header takes effect only when you set **XForwardedForClientCertClientVerifyEnabled **to true.

The name must be 1 to 40 characters in length. It can contain lowercase letters, digits, hyphens (-), and underscores (_).

Note This parameter is only available for HTTPS listeners.
test_client-verify-alias_123456
XForwardedForClientCertClientVerifyEnabledbooleanNo

Specifies whether to use the X-Forwarded-Clientcert-clientverify header to retrieve the verification result of the client certificate. Valid values:

  • true
  • false
Note This parameter is only available for HTTPS listeners.
false
XForwardedForClientCertFingerprintAliasstringNo

The name of the custom header. The header takes effect only when you set XForwardedForClientCertFingerprintEnabled to true.

The name must be 1 to 40 characters in length. It can contain lowercase letters, digits, hyphens (-), and underscores (_).

Note This parameter is only available for HTTPS listeners.
test_finger-print-alias_123456
XForwardedForClientCertFingerprintEnabledbooleanNo

Specifies whether to use the X-Forwarded-Clientcert-fingerprint header to retrieve the fingerprint of the client certificate. Valid values:

  • true
  • false
Note This parameter is only available for HTTPS listeners.
false
XForwardedForClientCertIssuerDNAliasstringNo

The name of the custom header. The header takes effect only when you set XForwardedForClientCertIssuerDNEnabled to true.

The name must be 1 to 40 characters in length. It can contain lowercase letters, digits, hyphens (-), and underscores (_).

Note This parameter is only available for HTTPS listeners.
test_issue-dn-alias_123456
XForwardedForClientCertIssuerDNEnabledbooleanNo

Specifies whether to use the X-Forwarded-Clientcert-issuerdn header to retrieve information about the authority that issues the client certificate. Valid values:

  • true
  • false
Note This parameter is only available for HTTPS listeners.
false
XForwardedForClientCertSubjectDNAliasstringNo

The name of the custom header. This parameter is valid only if the XForwardedForClientCertSubjectDNEnabled parameter is set to true.

The name must be 1 to 40 characters in length. It can contain lowercase letters, digits, hyphens (-), and underscores (_).

Note This parameter is only available for HTTPS listeners.
test_subject-dn-alias_123456
XForwardedForClientCertSubjectDNEnabledbooleanNo

Specifies whether to use the X-Forwarded-Clientcert-subjectdn header to retrieve information about the owner of the client certificate. Valid values:

  • true
  • false
Note This parameter is only available for HTTPS listeners.
false
XForwardedForClientSrcPortEnabledbooleanNo

Specifies whether to use the X-Forwarded-Client-srcport header to retrieve the client port. Valid values:

  • true
  • false
Note This parameter is only available for HTTP and HTTPS listeners.
false
XForwardedForEnabledbooleanNo

Specifies whether to use the X-Forwarded-For header to retrieve the client IP address. Valid values:

  • true (default)
  • false
Note
  • If this parameter is set to true, the default value of the XForwardedForProcessingMode parameter is append. You can change it to remove.
  • If this parameter is set to false, the X-Forwarded-For header in the request is not modified in any way before the request is sent to backend servers.
  • This parameter is only available for HTTP and HTTPS listeners.
  • true
    XForwardedForProcessingModestringNo

    Specifies how the X-Forwarded-For header is processed. This parameter takes effect only when XForwardedForEnabled is set to true. Valid values:

    • append (default)
    • remove
    Note
  • If this parameter is set to append, ALB appends the IP address of the last hop to the existing X-Forwarded-For header in the request before the request is sent to backend servers.
  • If this parameter is set to remove, ALB removes the X-Forwarded-For header in the request before the request is sent to backend servers, no matter whether the request carries the X-Forwarded-For header.
  • This parameter is only available for HTTP and HTTPS listeners.
  • append
    XForwardedForProtoEnabledbooleanNo

    Specifies whether to use the X-Forwarded-Proto header to retrieve the listener protocol. Valid values:

    • true
    • false
    Note This parameter is available for HTTP, HTTPS, and QUIC listeners.
    false
    XForwardedForSLBIdEnabledbooleanNo

    Specifies whether to use the SLB-ID header to retrieve the ID of the ALB instance. Valid values:

    • true
    • false
    Note This parameter is available for HTTP, HTTPS, and QUIC listeners.
    false
    XForwardedForSLBPortEnabledbooleanNo

    Specifies whether to use the X-Forwarded-Port header to retrieve the listener port of the ALB instance. Valid values:

    • true
    • false
    Note This parameter is available for HTTP, HTTPS, and QUIC listeners.
    false
    XForwardedForClientSourceIpsEnabledbooleanNo

    Specifies whether to use the X-Forwarded-For header to preserve client IP addresses. Valid values:

    • true
    • false
    Note This parameter is only available for HTTP and HTTPS listeners.
    false
    XForwardedForClientSourceIpsTrustedstringNo

    The trusted proxy IP address.

    ALB instances traverse the IP addresses in the X-Forwarded-For header from the rightmost IP address to the leftmost IP address. The first IP address that is not on the trusted IP address list is considered the client IP address. Requests from the client IP address are throttled.

    10.1.1.0/24
    XForwardedForHostEnabledbooleanNo

    Specifies whether to use the X-Forwarded-Host header to retrieve the client domain name. Valid values:

    • true
    • false (default)
    Note This parameter is available for HTTP, HTTPS, and QUIC listeners.
    false
    QuicConfigobjectNo

    The configuration information when the listener is associated with a QUIC listener.

    QuicListenerIdstringNo

    The QUIC listener ID. This parameter is required if QuicUpgradeEnabled is set to true. Only HTTPS listeners support this parameter.

    Note You must add the HTTPS listener and the QUIC listener to the same ALB instance. In addition, make sure that the QUIC listener has never been associated with another listener.
    lsn-333
    QuicUpgradeEnabledbooleanNo

    Specifies whether to enable QUIC upgrade. Valid values:

    • true
    • false
    Note Only HTTPS listeners support this parameter.
    false
    Certificatesarray<object>No

    The certificates. You can add at most 20 certificates.

    Note Only server certificates are supported.
    objectNo

    The certificate.

    CertificateIdstringNo

    The certificate ID.

    12315790212_166f8204689_1714763408_70998****
    CaCertificatesarray<object>No

    The CA certificate. You can specify only one CA certificate.

    objectNo

    The CA certificate.

    CertificateIdstringNo

    The ID of the CA certificate.

    Note This parameter is required if CaEnabled is set to true.
    123359******
    DefaultActionsarray<object>No

    The actions of the default forwarding rule.

    objectNo

    The action of the default forwarding rule.

    ForwardGroupConfigobjectNo

    The forwarding action. This parameter takes effect only when you set Type to ForwardGroup. You can specify at most 20 actions.

    ServerGroupTuplesarray<object>Yes

    The server groups to which requests are forwarded.

    objectNo

    The server group to which requests are forwarded.

    ServerGroupIdstringYes

    The ID of the server group to which requests are forwarded.

    rsp-cige6j5e7p****
    TypestringYes

    The action type. You can specify only one type.

    Set the value to ForwardGroup, which specifies that requests are forwarded to multiple server groups.

    ForwardGroup

    Response parameters

    ParameterTypeDescriptionExample
    object

    The response parameters.

    JobIdstring

    The asynchronous task ID.

    72dcd26b-f12d-4c27-b3af-18f6aed5****
    RequestIdstring

    The request ID.

    365F4154-92F6-4AE4-92F8-7FF34B540710

    Examples

    Sample success responses

    JSONformat

    {
      "JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****",
      "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710"
    }

    Error codes

    HTTP status codeError codeError messageDescription
    400IncorrectStatus.LoadBalancerThe status of %s [%s] is incorrect.-
    400IncorrectBusinessStatus.LoadBalancerThe business status of %s [%s]  is incorrect.The business status of %s [%s]  is incorrect.
    400IncorrectStatus.ListenerThe status of %s [%s] is incorrect.-
    400OperationDenied.CrossLoadBalancerQUICListenerThe operation is not allowed because of %s.The operation is not allowed because of %s.
    400ResourceAlreadyAssociated.ListenerThe specified resource %s is already associated.The specified resource %s is already associated.
    400OperationDenied.GRPCServerGroupThe operation is not allowed because of %s.-
    400ResourceAlreadyAssociated.CertificateThe specified resource %s is already associated.-
    400ResourceQuotaExceeded.SecurityPolicyAttachedNumThe quota of %s is exceeded for resource %s, usage %s/%s.The quota of %s is exceeded for resource %s. Usage: %s/%s.
    400ResourceQuotaExceeded.ServerGroupAttachedNumThe quota of %s is exceeded for resource %s, usage %s/%s.-
    400ResourceQuotaExceeded.LoadBalancerServersNumThe quota of %s is exceeded for resource %s, usage %s/%s.-
    400ResourceQuotaExceeded.ServerAddedNumThe quota of %s is exceeded for resource %s, usage %s/%s.-
    400OperationDenied.ServerGroupProtocolNotSupportThe operation is not allowed because of ServerGroupProtocolNotSupport.The operation is not allowed because the server group protocol is not supported.
    400UnsupportedFeature.FullTraceHttpsThe feature of FullTraceHttps is not supported for current instance.-
    400ResourceInConfiguring.ListenerThe specified resource of %s is being configured, please try again later.The specified resource of %s is being configured, please try again later.
    400Mismatch.VpcIdThe %s is mismatched for %s and %s.The %s is mismatched for %s and %s.
    400InvalidParameterInvalid parameter, please check the parameter input.Invalid parameter, please check the parameter input.
    403Forbidden.LoadBalancerAuthentication is failed for %s.Authentication is failed for %s.
    404ResourceNotFound.ListenerThe specified resource %s is not found.-
    404ResourceNotFound.ServerGroupThe specified resource %s is not found.-
    404ResourceNotFound.SecurityPolicyThe specified resource %s is not found.The specified resource %s is not found.
    404ResourceNotFound.CertificateThe specified resource %s is not found.The specified resource %s is not found.

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2024-12-20The Error code has changedView Change Details
    2024-01-29The Error code has changedView Change Details
    2024-01-24The Error code has changedView Change Details
    2023-11-06The Error code has changedView Change Details