All Products
Search
Document Center

Global Accelerator:CreateListener

Last Updated:Apr 15, 2026

Create a listener for your GA instance.

Operation description

Note the following when you call this operation:

  • CreateListener is an asynchronous operation. After you send a request, the system returns a listener ID but the listener is still being created in the background. You can call DescribeListener to check the listener's status:
    • An init status indicates that the listener is being created. In this state, you can only perform query operations.

    • An active status indicates that the listener is ready.

  • You cannot concurrently create multiple listeners for the same Global Accelerator instance by using the CreateListener operation.

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

ga:CreateListener

create

*Listener

acs:ga:{#regionId}:{#accountId}:listener/*

*Accelerator

acs:ga:{#regionId}:{#accountId}:ga/{#acceleratorId}

  • ga:TLSVersion
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the Global Accelerator instance. Set the value to cn-hangzhou.

cn-hangzhou

ClientToken

string

No

A client token that ensures the idempotence of the request.

Generate a unique token on your client for each request. The token must contain only ASCII characters.

Note

If you omit this parameter, the system uses the request's RequestId as the ClientToken.

123e4567-e89b-12d3-a456-426655440000

AcceleratorId

string

Yes

The ID of the Global Accelerator instance.

ga-bp1odcab8tmno0hdq****

Name

string

No

The name of the listener.

The name must be 1 to 128 characters long, start with a letter or a Chinese character, and can contain digits, periods (.), underscores (_), and hyphens (-).

Listener

Description

string

No

The description of the listener.

The description can be up to 200 characters long and cannot start with http:// or https://.

Listener

ClientAffinity

string

No

The client affinity for the listener.

  • By default, client affinity is disabled, and requests from the same client may be routed to different endpoints.

  • Set to SOURCE_IP to enable client affinity. This setting directs all requests from the same client to the same endpoint, regardless of the source port or protocol.

SOURCE_IP

Protocol

string

No

The listener's network protocol. Valid values:

  • tcp: TCP.

  • udp: UDP.

  • http: HTTP.

  • https: HTTPS.

tcp

PortRanges

array<object>

Yes

The listener port range. The port numbers must be within the range of 1 to 65499. The maximum number of allowed ports depends on the listener's routing type and protocol. For more information, see Listener ports.

object

No

The listener port range.

The port numbers must be within the range of 1 to 65499.

The maximum number of allowed ports depends on the listener's routing type and protocol. For more information, see Listener ports.

FromPort

integer

Yes

The first port in the listener range used to receive and forward requests to endpoints.

The port number must be in the range of 1 to 65499, and the value of FromPort must be less than or equal to the value of ToPort.

Note

For HTTP or HTTPS listeners, you can specify only one listener port. In this case, the value of FromPort must be the same as the value of ToPort.

20

ToPort

integer

Yes

The last port in the listener range used to receive and forward requests to endpoints.

The port number must be in the range of 1 to 65499, and the value of FromPort must be less than or equal to the value of ToPort.

Note

For HTTP or HTTPS listeners, you can specify only one listener port. In this case, the value of FromPort must be the same as the value of ToPort.

20

Certificates

array<object>

No

The SSL certificates for an HTTPS listener.

object

No

The SSL certificates for an HTTPS listener.

Id

string

No

The ID of the SSL certificate.

Note

This parameter is required only for HTTPS listeners.

449****-cn-hangzhou

XForwardedForConfig

object

No

Settings for X-Forwarded-For related headers.

XForwardedForGaIdEnabled

boolean

No

Specifies whether to use the GA-ID header to pass the Global Accelerator instance ID to the backend server. Valid values:

  • true

  • false (Default)

Note

This parameter applies only to HTTP and HTTPS listeners.

false

XForwardedForGaApEnabled

boolean

No

Specifies whether to use the GA-AP header to pass information about the acceleration region to the backend server. Valid values:

  • true

  • false (Default)

Note

This parameter applies only to HTTP and HTTPS listeners.

false

XForwardedForProtoEnabled

boolean

No

Specifies whether to use the GA-X-Forward-Proto header to pass the listener protocol of the Global Accelerator instance to the backend server. Valid values:

  • true

  • false (Default)

Note

This parameter applies only to HTTP and HTTPS listeners.

false

XForwardedForPortEnabled

boolean

No

Specifies whether to use the GA-X-Forward-Port header to pass the listener port of the Global Accelerator instance to the backend server. Valid values:

  • true

  • false (Default)

Note

This parameter applies only to HTTP and HTTPS listeners.

false

XRealIpEnabled

boolean

No

Specifies whether to use the X-Real-IP header to pass the client's real IP address to the backend server. Valid values:

  • true

  • false (Default)

Note

This parameter applies only to HTTP and HTTPS listeners.

false

SecurityPolicyId

string

No

The ID of the security policy. Valid values:

  • tls_cipher_policy_1_0

    • Supported TLS versions: TLS 1.0, TLS 1.1, and TLS 1.2.

    • Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

  • tls_cipher_policy_1_1

    • Supported TLS versions: TLS 1.1 and TLS 1.2.

    • Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

  • tls_cipher_policy_1_2

    • Supported TLS version: TLS 1.2.

    • Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.

  • tls_cipher_policy_1_2_strict

    • Supported TLS version: TLS 1.2.

    • Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA.

  • tls_cipher_policy_1_2_strict_with_1_3

    • Supported TLS versions: TLS 1.2 and TLS 1.3.

    • Supported cipher suites: TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_128_CCM_8_SHA256, ECDHE-ECDSA-AES128-GCM-SHA256, ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES128-SHA256, ECDHE-ECDSA-AES256-SHA384, ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-ECDSA-AES128-SHA, ECDHE-ECDSA-AES256-SHA, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA.

Note

This parameter applies only to HTTPS listeners.

tls_cipher_policy_1_0

Type

string

No

The routing type of the listener. Valid values:

  • Standard (default): standard routing.

  • CustomRouting: custom routing.

Note
  • Custom routing is in invitation-only preview. To use this feature, contact your Alibaba Cloud account manager.

  • A standard Global Accelerator instance supports only one routing type for all of its listeners. The routing type cannot be changed after the listener is created. For more information, see Listener overview.

Standard

EndpointGroupConfigurations

array<object>

No

The configurations of the endpoint groups for a standard listener.

You can specify up to 10 endpoint groups.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

array<object>

No

The configurations of the endpoint groups for a standard listener.

You can specify up to 10 endpoint groups.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

EndpointGroupName

string

No

The name of the endpoint group.

The name must be 1 to 128 characters long, start with a letter or a Chinese character, and can contain digits, periods (.), underscores (_), and hyphens (-).

You can enter up to 10 endpoint group names.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

test

EndpointGroupDescription

string

No

The description of the endpoint group.

The description can be up to 200 characters long and cannot contain http:// or https://.

You can enter up to 10 endpoint group descriptions.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

test

EndpointGroupRegion

string

No

The ID of the region where the endpoint group is created.

You can enter up to 10 endpoint group region IDs.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

cn-hangzhou

TrafficPercentage

integer

No

The traffic distribution ratio. If a standard listener is associated with multiple endpoint groups, this parameter specifies the percentage of traffic that is distributed to each endpoint group.

Valid values: 1 to 100. Default value: 100.

You can enter traffic distribution values for up to 10 endpoint groups.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

100

HealthCheckEnabled

boolean

No

Specifies whether to enable health checks for the endpoint group. Valid values:

  • true: Enables health checks.

  • false (Default): Disables health checks.

You can enable health checks for up to 10 endpoint groups.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

false

HealthCheckIntervalSeconds

integer

No

The health check interval, in seconds.

You can enter up to 10 health check intervals.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

3

HealthCheckPath

string

No

The path to which health check requests are sent.

You can enter up to 10 health check paths.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

/healthcheck

HealthCheckPort

integer

No

The port that is used for health checks. Valid values: 1 to 65535.

You can enter a maximum of 10 ports for health checks.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

20

HealthCheckProtocol

string

No

The protocol over which health check requests are sent. Valid values:

  • tcp or TCP: TCP

  • http or HTTP: HTTP

  • https or HTTPS: HTTPS

You can enter up to 10 health check protocols.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

tcp

ThresholdCount

integer

No

The number of consecutive successful health checks required to mark an endpoint as healthy, or consecutive failed health checks to mark an endpoint as unhealthy. Valid values: 2 to 10. Default value: 3.

You can enter up to 10 values for the number of consecutive health checks required to trigger a health status change.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

3

EndpointConfigurations

array<object>

No

The endpoint configurations.

object

No

The endpoint configurations.

Type

string

No

The type of the endpoint. Valid values:

  • Domain: a custom domain name.

  • Ip: a custom IP address.

  • PublicIp: a public IP address of an Alibaba Cloud service.

  • ECS: an Elastic Compute Service (ECS) instance.

  • SLB: a Server Load Balancer (SLB) instance.

  • ALB: an Application Load Balancer (ALB) instance.

  • OSS: an Object Storage Service (OSS) bucket.

  • ENI: an elastic network interface (ENI).

  • NLB: a Network Load Balancer (NLB) instance.

  • IpTarget: a custom private IP address.

You can specify up to 100 endpoints in an endpoint group.

Note
  • This parameter applies only when the listener's routing type (Type) is Standard.

  • When you add endpoints, Global Accelerator may create service-linked roles to access your resources. The role created depends on the endpoint type:

Note

For more information, see Service-linked roles.

Ip

Weight

integer

No

The weight of the endpoint.

Valid values: 0 to 255.

In an endpoint group for an intelligent routing type listener, you can enter weights for up to 100 endpoints.

Note
  • This parameter applies only when the listener's routing type (Type) is Standard.

  • If an endpoint's weight is set to 0, Global Accelerator stops sending traffic to it. Use this setting with caution.

20

Endpoint

string

No

The IP address or domain name of the endpoint.

In an endpoint group of an intelligent routing listener, you can enter up to 100 IP addresses or domain names of endpoints.

Note

This parameter applies only when the listener's routing type (Type) is Standard.

47.0.XX.XX

SubAddress

string

No

The private IP address of the ENI.

Note

If the endpoint type is ENI, you can specify this parameter. If you do not specify this parameter, the primary private IP address of the ENI is used.

172.168.XX.XX

EnableClientIPPreservation

boolean

No

Specifies whether to preserve client source IP addresses. Valid values:

  • true: enables the feature.

  • false (default): disables the feature.

Note
  • This feature is disabled by default for endpoint groups of TCP or UDP listeners. You can enable it as needed.

  • This feature is enabled by default for endpoint groups of HTTP or HTTPS listeners. Client source IP addresses are retrieved from the X-Forwarded-For header. You cannot disable this feature.

  • You cannot set both EnableClientIPPreservation and EnableProxyProtocol to true.

  • For more information, see Preserve client source IP addresses.

EnableProxyProtocol

boolean

No

Specifies whether to use the proxy protocol to preserve client source IP addresses. Valid values:

  • true: enables the feature.

  • false (default): disables the feature.

Note
  • You can configure this parameter only for endpoint groups of TCP listeners.

  • You cannot set both EnableClientIPPreservation and EnableProxyProtocol to true.

  • For more information, see Preserve client source IP addresses.

VpcId

string

No

The ID of the Virtual Private Cloud (VPC).

In an endpoint group of an intelligent routing listener, you can enter a maximum of 1 VPC ID.

Note

This parameter is required only for IpTarget endpoints.

vpc-bp13r1kpr2lel****

VSwitchIds

array

No

The list of vSwitches in the VPC. You can specify up to two vSwitch IDs.

string

No

The ID of the vSwitch.

In an endpoint group for a smart routing type listener, you can enter a maximum of 2 vSwitch IDs.

Note

This parameter is required only for IpTarget endpoints.

  • The vSwitch must belong to the VPC specified by the VpcId parameter.

vsw-0jlhcznhw5m7pz2fa****

Provider

string

No

BAILIAN

ApiKeys

array

No

string

No

sk-******

EndpointRequestProtocol

string

No

The protocol used by the backend service. Valid values:

  • HTTP (default)

  • HTTPS

You can enter up to 10 backend service protocols.

Note
  • This parameter applies only when the listener's routing type (Type) is Standard.

  • You can configure this parameter only for endpoint groups of HTTP or HTTPS listeners.

  • For an HTTP listener, the backend service protocol must be HTTP.

HTTP

EndpointProtocolVersion

string

No

The protocol version of the backend service. Valid values:

  • HTTP1.1 (default): HTTP/1.1

  • HTTP2: HTTP/2

Note

This parameter is available only when EndpointRequestProtocol is set to HTTPS.

HTTP1.1

EndpointGroupType

string

No

The type of the endpoint group. Valid values:

  • default (default): a default endpoint group.

  • virtual: a virtual endpoint group.

You can enter up to 10 endpoint group types.

Note
  • This parameter applies only when the listener's routing type (Type) is Standard.

  • You can create virtual endpoint groups only for HTTP or HTTPS listeners.

default

PortOverrides

array<object>

No

The port mapping. You can specify up to five port mappings.

object

No

The port mapping.

ListenerPort

integer

No

The listener port that is specified in the port mapping.

You can enter up to 5 listener ports for port mappings.

Note
  • This parameter applies only when the listener's routing type (Type) is Standard.

  • For TCP listeners, you cannot configure a port mapping for a virtual endpoint group. If a virtual endpoint group already exists for the listener, you cannot configure a port mapping for the default endpoint group. If a port mapping is configured for the default endpoint group, you cannot add a virtual endpoint group to the listener.

  • After you configure a port mapping, you cannot modify the listener protocol, except for switching between HTTP and HTTPS.

  • When you modify the listener port range, make sure that the new port range includes all listener ports that are specified in the port mapping. For example, if the listener port range is 80-82 and the listener ports are mapped to the endpoint ports 100-102, you cannot change the listener port range to 80-81.

443

EndpointPort

integer

No

The endpoint port that is specified in the port mapping.

You can enter a maximum of 5 endpoint ports for port mapping.

Note
  • This parameter applies only when the listener's routing type (Type) is Standard.

  • For TCP listeners, you cannot configure a port mapping for a virtual endpoint group. If a virtual endpoint group already exists for the listener, you cannot configure a port mapping for the default endpoint group. If a port mapping is configured for the default endpoint group, you cannot add a virtual endpoint group to the listener.

  • After you configure a port mapping, you cannot modify the listener protocol, except for switching between HTTP and HTTPS.

  • When you modify the listener port range, make sure that the new port range includes all listener ports that are specified in the port mapping. For example, if the listener port range is 80-82 and the listener ports are mapped to the endpoint ports 100-102, you cannot change the listener port range to 80-81.

80

HealthCheckHost

string

No

The domain name that is used for health checks.

www.taobao.com

EndpointIpVersion

string

No

The IP version used by the backend service. Valid values:

  • IPv4 (default): GA uses only IPv4 addresses to communicate with backend services.

  • IPv6: GA uses only IPv6 addresses to communicate with backend services.

  • ProtocolAffinity: GA uses the same IP version as the client request to communicate with backend services.

IPv4

CustomRoutingEndpointGroupConfigurations

array<object>

No

The configurations of the endpoint groups for a custom routing listener.

You can specify up to five endpoint groups.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

array<object>

No

The configurations of the endpoint groups for a custom routing listener.

You can specify up to five endpoint groups.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

EndpointGroupRegion

string

No

The ID of the region where the endpoint group is created.

You can enter up to 5 endpoint group region IDs.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

cn-hangzhou

Name

string

No

The name of the endpoint group.

The name must be 1 to 128 characters long, start with a letter or a Chinese character, and can contain digits, periods (.), underscores (_), and hyphens (-).

You can enter up to 5 endpoint group names.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

test

Description

string

No

The description of the endpoint group.

The description can be up to 200 characters long and cannot contain http:// or https://.

You can enter up to 5 endpoint group descriptions.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

test

DestinationConfigurations

array<object>

No

The mapping configurations for the endpoint group.

You must specify the port ranges and protocols for the backend service. The settings are mapped to the associated listener port ranges.

You can specify up to 20 mapping configurations for each endpoint group.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

object

No

The mapping configurations for the endpoint group.

You must specify the port ranges and protocols for the backend service. The settings are mapped to the associated listener port ranges.

You can specify up to 20 mapping configurations for each endpoint group.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

Protocols

array

No

The protocols of the backend service.

You can specify up to four backend service protocols for each mapping configuration.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

string

No

The protocol of the backend service. Valid values:

  • TCP

  • UDP

  • TCP,UDP

For each endpoint group of a listener that uses the custom routing type, you can specify up to four backend service protocol types in the port mapping and protocol type settings.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

TCP

FromPort

integer

No

The first port of the backend service.

The valid port range is 1 to 65499. The value of FromPort must be less than or equal to the value of ToPort.

In each endpoint group for a custom routing type listener, you can enter up to 20 backend service starting ports.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

80

ToPort

integer

No

The last port of the backend service.

The valid port range is 1 to 65499. The value of FromPort must be less than or equal to the value of ToPort.

In each endpoint group of a listener of the custom routing type, you can enter a maximum of 20 backend service ports.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

80

EndpointConfigurations

array<object>

No

The endpoint configurations.

You can specify up to 10 endpoints for each endpoint group.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

array<object>

No

The endpoint configurations.

You can specify up to 10 endpoints for each endpoint group.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

Type

string

No

The type of the backend service for a custom routing listener. Valid value:

PrivateSubNet (default): a private CIDR block.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

PrivateSubNet

Endpoint

string

No

The vSwitch of the custom routing listener.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

vsw-test01

TrafficToEndpointPolicy

string

No

The traffic policy for the backend service of a custom routing listener. Valid values:

  • DenyAll (default): Denies all traffic to the specified backend service.

  • AllowAll: Allows all traffic to the specified backend service.

  • AllowCustom: Allows traffic to specific destinations. You must specify the IP addresses and port ranges of the allowed destinations. If no port range is specified, all ports of the destination are allowed.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

DenyAll

PolicyConfigurations

array<object>

No

The destination configurations for a custom routing listener.

You can specify up to 20 destinations for each endpoint.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

array<object>

No

The destination configurations for a custom routing listener.

You can specify up to 20 destinations for each endpoint.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

Address

string

No

The IP address of the destination that is allowed to receive traffic.

This parameter is required only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify up to 20 destination IP addresses for each endpoint.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

10.0.XX.XX

PortRanges

array<object>

No

The port range of the destination that is allowed to receive traffic. The port range must be within the port range of the backend service.

If you leave this parameter empty, all ports of the destination are allowed.

This parameter is required only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify up to 20 port ranges for each endpoint, and up to 5 port ranges for each destination.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

object

No

The port range of the destination that is allowed to receive traffic. The port range must be within the port range of the backend service.

If you leave this parameter empty, all ports of the destination are allowed.

This parameter is required only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify up to 20 port ranges for each endpoint, and up to 5 port ranges for each destination.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

FromPort

integer

No

The first port of the destination that is allowed to receive traffic. The port must be within the port range of the backend service.

This parameter is required only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify up to 20 port ranges for each endpoint, and up to 5 first ports for each destination.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

80

ToPort

integer

No

The last port of the destination that is allowed to receive traffic. The port must be within the port range of the backend service.

This parameter is required only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify up to 20 port ranges for each endpoint, and up to 5 last ports for each destination.

Note

This parameter applies only when the listener's routing type (Type) is CustomRouting.

80

IdleTimeout

integer

No

The connection idle timeout, in seconds.

  • TCP: 10–900 seconds. Default: 900 seconds.

  • UDP: 10–20 seconds. Default: 20 seconds.

  • HTTP/HTTPS: 1–60 seconds. Default: 15 seconds.

900

RequestTimeout

integer

No

The request timeout for HTTP/HTTPS connections, in seconds.

Valid values: 1–180 seconds. Default: 60 seconds.

Note

This parameter applies only to HTTP or HTTPS listeners. If the backend server does not respond within the timeout period, Global Accelerator returns an HTTP 504 error to the client.

15

HttpVersion

string

No

The maximum HTTP version. Valid values:

  • http3: HTTP/3

  • http2 (default): HTTP/2

  • http1.1: HTTP/1.1

Note

This parameter applies only to HTTPS listeners.

http2

Response elements

Element

Type

Description

Example

object

The data returned for the request.

RequestId

string

The request ID.

04F0F334-1335-436C-A1D7-6C044FE73368

ListenerId

string

The ID of the created listener.

lsr-bp1bpn0kn908w4nbw****

Examples

Success response

JSON format

{
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
  "ListenerId": "lsr-bp1bpn0kn908w4nbw****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 Resource.QuotaFull The resource quota is exceeded. The number of resources has reached the upper limit.
400 ProtocalIllegal.Listener The specified listener protocol is invalid. The specified listener protocol is invalid.
400 NotExist.Accelerator The accelerated instance does not exist. The GA instance does not exist.
400 StateError.Accelerator The state of the accelerated instance is invalid. The status of the GA instance is invalid.
400 QuotaExceeded.Listener The maximum number of listeners is exceeded. The maximum number of listeners is exceeded.
400 QuotaExceeded.ListenerPort The maximum number of listener ports is exceeded. The maximum number of listener ports is exceeded.
400 NotExist.ListenerPort listener port %s is not exist
400 PortRangeIllegal.Listener The specified listener port range is invalid. The specified listener port range is invalid.
400 PortRangeIllegal.Count The hugePort listener only supports one port range. The mass port listener (port number greater than 300) only supports one port range.
400 PortConflict.Listener The listener port configuration is in conflict. The listener port configurations are in conflict.
400 PortRangeIllegal.ExceedGaAbility The listener port range is invalid. For each accelerator instance, you can only create a listener with port range over 300 for each protocol (TCP and UDP). The listener port range is invalid. For each accelerator instance, you can only create a listener with port range over 300 for each protocol (TCP and UDP).
400 PortRangeIllegal.UDP UDP ports 250, 4789, and 4790 are system reserved ports.
400 SystemPort.Listener Ports 65500-65535 are system reserved ports. Ports 65500 to 65535 are reserved by the system.
400 PortRanges.MustOne The portRanges must be one for HTTPS and HTTP type listener. Only one port is supported for HTTPS and HTTP type listeners.
400 SecurityPolicyId.NotNeed No security policy ID is required for the listener. No security policy ID is required for the listener.
400 SecurityPolicyIdIllegal.Listener The listener security policy ID %s is illegal. The security policy ID of the listener is invalid.
500 UnknownError An error occurred while processing your request. Please try again. If the error persists, please submit a ticket. An error occurred while the request was being processed. Try again later.
403 Forbbiden.SubUser You are not authorized to operate on the specified resource because your account was created by another user. The current account is a RAM user and does not have permissions to manage the specified resources.
403 Forbidden The user is not authorized to operate on the specified resource. The current account does not have permissions to manage the specified resources.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.