tencent cloud

APIs

ModifyListenerAttributes

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-09-28 14:17:45

1. API Description

Domain name for API request: alb.intl.tencentcloudapi.com.

Modifies listener properties.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ModifyListenerAttributes.
Version Yes String Common Params. The value used for this API: 2025-10-30.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ListenerId Yes String Listener ID, format: lst- followed by 8 alphanumeric characters.
LoadBalancerId Yes String Cloud Load Balancer instance ID, in the format of "alb-" followed by 8 alphanumeric characters.
CaCertificateIds.N No Array of String CA certificate ID list for the listener configuration. Currently only support adding 1 CA certificate.
CaEnabled No Boolean Whether mutual authentication is enabled.
Valid values:
true: enabled.
false (default value): not enabled.
CertificateIds.N No Array of String List of server certificate IDs.
ClientToken No String Client Token, used for ensuring request idempotency.

Generate a parameter value from your client to underwrite the uniqueness of the value for different requests. ClientToken supports only ASCII characters.
DefaultActions.N No Array of DefaultAction List of default forward rule actions. Currently, a listener supports adding only 1 default forward rule action.
GzipEnabled No Boolean Whether to enable Gzip compression.
Http2Enabled No Boolean Whether to enable HTTP/2. Only HTTPS protocol supports this parameter.
IdleTimeout No Integer Specify the idle timeout for a connection. Unit: seconds.
Valid values: 1-600.
Default value: 15.
If no access request is received within the set time, load balancing will temporarily disconnect the current connection and reestablish a new connection when the next request arrives.
ListenerName No String Custom listener name, 1–255 characters in length. It must contain Chinese and harmless string characters, and can contain Chinese, letters, digits, dashes (-), forward slashes (/), half-width periods (.), and underscores (_).
RequestTimeout No Integer Specify the request timeout. Unit: seconds.
Value: 1-600.
Default value: 60.
If the real server does not respond within the timeout period, load balancing will abandon waiting and return an HTTP 504 error code to the client.
SecurityPolicyId No String Security policy ID in the format of tls- followed by 8 alphanumeric characters.
XForwardedForConfig No XForwardedForConfig XForwardedFor configuration.

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Modifying a Listener

Input Example

POST / HTTP/1.1
Host: alb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyListenerAttributes
<Common request parameters>

{
    "CaCertificateIds": [
        "Fm8Wp7x8"
    ],
    "CaEnabled": false,
    "CertificateIds": [
        "Fm8Wp7x8"
    ],
    "DefaultActions": [
        {
            "TargetGroupConfig": {
                "TargetGroupStickySession": {
                    "Enabled": false,
                    "Timeout": 1000
                },
                "TargetGroups": [
                    {
                        "TargetGroupId": "lbtg-0zrnc9qa",
                        "Weight": 10
                    }
                ]
            },
            "Type": "TargetGroup"
        }
    ],
    "GzipEnabled": false,
    "Http2Enabled": true,
    "IdleTimeout": 15,
    "ListenerId": "lst-d9p3k7wa",
    "ListenerName": "http_listener",
    "LoadBalancerId": "alb-f8q2xk9m",
    "RequestTimeout": 60,
    "SecurityPolicyId": "tls-t2ckydug",
    "XForwardedForConfig": {
        "XForwardedForAlbIdEnabled": false,
        "XForwardedForClientSrcPortEnabled": false,
        "XForwardedForHostEnabled": false,
        "XForwardedForMode": "append",
        "XForwardedForPortEnabled": false,
        "XForwardedForProtoEnabled": false,
        "XTencentClientIDNEnabled": false,
        "XTencentClientSDNEnabled": false,
        "XTencentClientSerialEnabled": false,
        "XTencentClientVerifyEnabled": false
    }
}

Output Example

{
    "Response": {
        "RequestId": "3b848733-70e5-4558-ae39-4b9938eb7609"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백