Domain name for API request: ga2.intl.tencentcloudapi.com.
This API is used to create a listener.
A maximum of 20 requests can be initiated per second for this API.
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: CreateListener. |
| Version | Yes | String | Common Params. The value used for this API: 2025-01-15. |
| Region | No | String | Common Params. This parameter is not required. |
| GlobalAcceleratorId | Yes | String | Global acceleration instance ID. |
| Name | Yes | String | Name. Parameter format: starting with a letter or Chinese characters, 2–128 characters in length, supporting letters, digits, Chinese characters, . - _ |
| PortRanges | Yes | PortRanges | Port range. |
| Description | No | String | Description. Maximum length cannot exceed 100 characters. |
| ListenerType | No | String | Listening type, defaults to smart routing. Enumeration values:
|
| Protocol | No | String | Protocol. Default value: TCP. Supports configuration of 'TCP', 'UDP', 'HTTP', and 'HTTPS'. |
| IdleTimeout | No | Integer | Connection idle wait time. 1. For HTTP/HTTPS listener, the default value is 15, with a supported range of 1-60. |
| GetRealIpType | No | String | Layer-4 source IP retrieval mode. Supports 'TOA', 'ProxyProtocol', and 'ProxyProtocolV2'. This parameter can be filled in only when the Layer-4 source IP retrieval mode is enabled. |
| ClientAffinity | No | String | Whether to enable session persistence. Supports configuration of 'Open' and 'Close'. Enumeration values:
Only supported for layer-4 listeners. For layer-7 listeners, modification is not supported. |
| RequestTimeout | No | Integer | Request timeout. Value range: [1, 180] Default value: 60 This parameter is configurable only for HTTPS listeners. |
| XForwardedForRealIp | No | Boolean | Whether to enable layer-7 source IP retrieval mode. |
| CertificationType | No | String | Parsing method. Enumeration values:
For an HTTPS listener, this field is required. |
| CipherPolicyId | No | String | Encryption algorithm kit. Supports configuration of 'tls_policy_1.0-2', 'tls_policy_1.1-2', 'tls_policy_1.2', 'tls_policy_1.2_strict', 'tls_policy_1.2_strict-1.3'. |
| ServerCertificates.N | No | Array of String | Server certificate. Input limit: currently only support importing one cert; to use multiple certs, use the cert api CreateListenerAdditionalCert to add other certs. This field is required for HTTPS listeners. |
| ClientCaCertificates.N | No | Array of String | Client certificate. Input limit: 1. Currently only support importing one cert. To use multiple certs, use the cert api CreateListenerAdditionalCert to add other certs. 2. The cert must be a CA certificate. This field is required when HTTPS listener and mutual authentication are enabled. |
| HttpVersion | No | String | HTTPS listener supports version selection Enumeration values:
|
| Parameter Name | Type | Description |
|---|---|---|
| TaskId | String | Task ID. |
| ListenerId | String | Listener ID. |
| 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. |
POST / HTTP/1.1
Host: ga2.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateListener
<Common request parameters>
{
"GlobalAcceleratorId": "ga-80bzejka",
"Name": "garendu-UDP",
"PortRanges": {
"FromPort": 12,
"ToPort": 12
},
"Description": "garendu-UDP-desc",
"ListenerType": "Standard",
"IdleTimeout": 13,
"GetRealIpType": "TOA",
"ClientAffinity": "Open"
}
{
"Response": {
"ListenerId": "lsr-5lkfom8v",
"RequestId": "3ca6812c-4782-4ca8-8ef7-e3753ab8a4c7",
"TaskId": "85233b38-72cf-49ef-b3e8-c63ac9be774c"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation.InsufficientResources | Insufficient resources to create the port range. |
| InvalidParameter.ApplicationLayerListenerCannotCarryParameters | Layer-7 listeners do not support carrying the parameter %(value)s. |
| InvalidParameter.HttpListenerCannotCarryParameters | Http listeners do not support carrying the parameter %(value)s. |
| InvalidParameter.HttpsListenerCanCarryParameters | |
| InvalidParameter.SinglePort | Only a single port is supported. |
| InvalidParameter.TcpListenerCarryParameters | |
| InvalidParameter.TransportLayerListenerCannotCarryParameters | Layer-4 listeners do not support carrying the parameter %(value)s. |
| InvalidParameterValue.InstanceName | Instance name must start with an uppercase/lowercase character or Chinese character, and support digits, periods, hyphens, and underscores. |
| InvalidParameterValue.Malformed | Parameter value %(value)s of %(parameter)s is invalid. A correct and complete value is in the form of %(template)s. |
| InvalidParameterValue.Range | The value %(value)s of the parameter %(parameter)s must be within the range %(value_range)s. |
| InvalidParameterValue.SegmentPortRange | FromPort %(fromPort)s should be less than or equal to ToPort %(toPort)s. |
| InvalidParameterValue.TcpSeriesListenerPortEqual | The current TCP protocol series listener port duplicates an existing listener port. |
| InvalidParameterValue.ThirdAreaListenerPortEqual | Currently, the global acceleration instance has third-party node acceleration regions configured. The listener port cannot be the same. |
| InvalidParameterValue.ThirdAreaListenerPortSegment | Currently, the global acceleration instance does not support configuring listener port ranges for third-party nodes. |
| InvalidParameterValue.TooLong | Parameter value %(value)s length cannot be greater than %(max_size)s. |
| InvalidParameterValue.UdpSeriesListenerPortEqual | The current UDP listener port is duplicated with an existing listener port. |
| LimitExceeded | The quota limit is exceeded. |
| MissingParameter | Parameters are missing. |
| UnsupportedOperation.CurrentAccountNotAllowed | The current account does not support this operation. |
| UnsupportedOperation.InstanceStateNotAllowedOperate | Current instance status does not allow this operation. |
| UnsupportedOperation.ListenerPortSegment | The current account does not support port range configuration. |
| UnsupportedOperation.OnlyTcpListenerSupportToa | For TCP listeners only, client IP can be obtained through TOA. |
| UnsupportedOperation.TOAFeatureNotEnabled | The TOA feature is not enabled for the current global acceleration instance. Contact Tencent Cloud customer service to submit a request. |
| UnsupportedOperation.UdpListenerNotSupportProxyProtocol | |
| UnsupportedOperation.UnlawfulCertificate |
文档反馈