Updates the configuration of a listener.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateListenerAttribute

The operation that you want to perform.

Set the value to UpdateListenerAttribute.

ListenerId String Yes lsr-bp1bpn0kn908w4nbw****

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

ClientToken String No 5A2CFF0E-5718-45B5-9D4D-70B3FF3898

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

DryRun Boolean No true

Specifies whether only to precheck the request. Valid values:

  • true: only prechecks the request and does not perform the requested operation. The system checks the required parameters, request format, and service limits. If the request fails the precheck, an error code is returned based on the cause of the failure. If the request passes the precheck, the DryRunOperation error code is returned.
  • false: prechecks the request and performs the requested operation. After the request passes the precheck, an HTTP 2xx status code is returned and the system performs the operation. This is the default value.
ListenerDescription String No test

The description of the listener.

The description must be 2 to 256 characters in length, and can contain only the characters specified by the following expression:

/^([^\x00-\xff]|[\w.,;/@-]){2,256}$/.

RequestTimeout Integer No 3

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.

IdleTimeout Integer No 15

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.

GzipEnabled Boolean No false

Specifies whether to enable gzip compression to compress specific types of files.

Http2Enabled Boolean No false

Specifies whether to enable HTTP/2.

Valid values: true and false.

Note Only HTTPS listeners support this parameter.
SecurityPolicyId String No tls_cipher_policy_1_0

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

Note Only HTTPS listeners support this parameter.
XForwardedForConfig Object No

The configuration of the XForwardFor headers.

XForwardedForClientCertClientVerifyAlias String No test_client-verify-alias_123456

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

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

Note Only HTTPS listeners support this parameter.
XForwardedForClientCertClientVerifyEnabled Boolean No true

Specifies whether to use the X-Forwarded-Clientcert-clientverify header to obtain the verification result of the client certificate.

Valid values: true and false.

Note Only HTTPS listeners support this parameter.
XForwardedForClientCertFingerprintAlias String No test_finger-print-alias_123456

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

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

Note Only HTTPS listeners support this parameter.
XForwardedForClientCertFingerprintEnabled Boolean No true

Specifies whether to use the X-Forwarded-Clientcert-fingerprint header to obtain the fingerprint of the client certificate.

Valid values: true and false. Default value: false.

Note Only HTTPS listeners support this parameter.
XForwardedForClientCertIssuerDNAlias String No test_issue-dn-alias_123456

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

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

Note Only HTTPS listeners support this parameter.
XForwardedForClientCertIssuerDNEnabled Boolean No true

Specifies whether to use the X-Forwarded-Clientcert-issuerdn header to obtain information about the authority that issues the client certificate.

Valid values: true and false. Default value: false.

Note Only HTTPS listeners support this parameter.
XForwardedForClientCertSubjectDNAlias String No test_subject-dn-alias_123456

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, and can contain letters, hyphens (-), underscores (_), and digits.

Note Only HTTPS listeners support this parameter.
XForwardedForClientCertSubjectDNEnabled Boolean No true

Specifies whether to use the X-Forwarded-Clientcert-subjectdn header to obtain information about the owner of the client certificate.

Valid values: true and false. Default value: false.

Note Only HTTPS listeners support this parameter.
XForwardedForClientSrcPortEnabled Boolean No true

Specifies whether to use the X-Forwarded-Client-Port header to obtain the port over which the client communicates with the ALB instance.

Valid values: true and false. Default value: false.

Note HTTP and HTTPS listeners support this parameter.
XForwardedForEnabled Boolean No true

Specifies whether to use the X-Forwarded-For header to obtain the real IP address of the client.

Valid values: true and false. Default value: true.

Note HTTP and HTTPS listeners support this parameter.
XForwardedForProtoEnabled Boolean No true

Specifies whether to use the X-Forwarded-Proto header to obtain the listener protocol of the ALB instance.

Valid values: true and false. Default value: false.

Note HTTP, HTTPS, and QUIC listeners support this parameter.
XForwardedForSLBIdEnabled Boolean No true

Specifies whether to use the SLB-ID header to obtain the ID of the ALB instance.

Valid values: true and false. Default value: false.

Note HTTP, HTTPS, and QUIC listeners support this parameter.
XForwardedForSLBPortEnabled Boolean No true

Specifies whether to use the X-Forwarded-Port header to obtain the listener port of the ALB instance.

Valid values: true and false. Default value: false.

Note HTTP, HTTPS, and QUIC listeners support this parameter.
QuicConfig Object No

The configuration information about the QUIC listener to be associated.

QuicListenerId String No lsn-333

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

Note The original listener and the QUIC listener must belong to the same ALB instance. In addition, make sure that the QUIC listener is not associated with another listener.
QuicUpgradeEnabled Boolean No true

Specifies whether to enable the QUIC update feature.

Valid values: true and false. Default value: false.

Note Only HTTPS listeners support this parameter.
Certificates Array No

The certificates.

CertificateId String No 12315790212_166f8204689_1714763408_70998****

The ID of the certificate. Only server certificates are supported.

DefaultActions Array No

The actions of the default forwarding rule.

ForwardGroupConfig Object No

The configuration of the forwarding action. This parameter is required if the Type parameter is set to ForwardGroup.

ServerGroupTuples Array Yes

The destination server groups to which requests are forwarded.

ServerGroupId String Yes rsp-cige6j5e7p****

The ID of the destination server group.

Type String Yes ForwardGroup

The type of the forwarding action.

Set the value to ForwardGroup. This value indicates that requests are forwarded to multiple vServer groups.

Response parameters

Parameter Type Example Description
JobId String 72dcd26b-f12d-4c27-b3af-18f6aed5****

The ID of the asynchronous task.

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

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateListenerAttribute
&ListenerId=lsr-bp1bpn0kn908w4nbw****
&ClientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF3898
&DryRun=true
&ListenerDescription=test
&RequestTimeout=3
&IdleTimeout=15
&GzipEnabled=false
&Http2Enabled=false
&SecurityPolicyId=tls_cipher_policy_1_0
&XForwardedForConfig={"XForwardedForClientCertClientVerifyAlias":"test_client-verify-alias_123456","XForwardedForClientCertClientVerifyEnabled":true,"XForwardedForClientCertFingerprintAlias":"test_finger-print-alias_123456","XForwardedForClientCertFingerprintEnabled":true,"XForwardedForClientCertIssuerDNAlias":"test_issue-dn-alias_123456","XForwardedForClientCertIssuerDNEnabled":true,"XForwardedForClientCertSubjectDNAlias":"test_subject-dn-alias_123456","XForwardedForClientCertSubjectDNEnabled":true,"XForwardedForClientSrcPortEnabled":true,"XForwardedForEnabled":true,"XForwardedForProtoEnabled":true,"XForwardedForSLBIdEnabled":true,"XForwardedForSLBPortEnabled":true}
&QuicConfig={"QuicListenerId":"lsn-333","QuicUpgradeEnabled":true}
&Certificates=[{"CertificateId":"12315790212_166f8204689_1714763408_70998****"}]
&DefaultActions=[{"ForwardGroupConfig":{"ServerGroupTuples":[{"ServerGroupId":"rsp-cige6j5e7p****"}]},"Type":"ForwardGroup"}]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateListenerAttributeResponse>
    <JobId>72dcd26b-f12d-4c27-b3af-18f6aed5****</JobId>
    <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
</UpdateListenerAttributeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HTTP status code Error code Error message Description
400 IncorrectStatus.LoadBalancer The status of %s [%s] is incorrect. The error message returned because the status of the specified %s [%s] resource is invalid.
400 IncorrectBusinessStatus.LoadBalancer The business status of %s [%s] is incorrect. The error message returned because the service status of the specified %s [%s] resource is invalid.
400 IncorrectStatus.Listener The status of %s [%s] is incorrect. The error message returned because the status of the specified %s [%s] resource is invalid.
400 OperationDenied.CrossLoadBalancerQUICListener The operation is not allowed because of %s. The error message returned because the operation is not allowed due to %s.
400 ResourceAlreadyAssociated.Listener The specified resource %s is already associated. The error message returned because the specified %s resource is already associated.
400 OperationDenied.GRPCServerGroup The operation is not allowed because of %s. The error message returned because the operation is not allowed due to %s.
400 ResourceAlreadyAssociated.Certificate The specified resource %s is already associated. The error message returned because the specified %s resource is already associated.
400 ResourceQuotaExceeded.SecurityPolicyAttachedNum The quota of %s is exceeded for resource %s, usage %s/%s. The error message returned because the usage %s of the specified %s resource has exceeded the quota %s.
400 ResourceQuotaExceeded.ServerGroupAttachedNum The quota of %s is exceeded for resource %s, usage %s/%s. The error message returned because the usage %s of the specified %s resource has exceeded the quota %s.
400 ResourceQuotaExceeded.LoadBalancerServersNum The quota of %s is exceeded for resource %s, usage %s/%s. The error message returned because the usage %s of the specified %s resource has exceeded the quota %s.
400 ResourceQuotaExceeded.ServerAddedNum The quota of %s is exceeded for resource %s, usage %s/%s. The error message returned because the usage %s of the specified %s resource has exceeded the quota %s.
400 OperationDenied.ServerGroupProtocolNotSupport The operation is not allowed because of ServerGroupProtocolNotSupport. The error message returned because the specified server group protocol is invalid.
404 ResourceNotFound.Listener The specified resource %s is not found. The error message returned because the specified %s resource does not exist.
404 ResourceNotFound.ServerGroup The specified resource %s is not found. The error message returned because the specified %s resource does not exist.
404 ResourceNotFound.SecurityPolicy The specified resource %s is not found. The error message returned because the specified %s resource does not exist.
404 ResourceNotFound.Certificate The specified resource %s is not found. The error message returned because the specified %s resource does not exist.

For a list of error codes, visit the API Error Center.