CreateListener

Updated at:

Creates a listener for an Alibaba Cloud Global Accelerator (GA) instance.

Operation description

Take note of the following items when you invoke this operation:

  • CreateListener is an asynchronous operation. After you invoke this operation, the system returns a listener ID, but the listener is not immediately created. The creation task is still running in the background. You can invoke DescribeListener to query the status of the listener:
    • When the listener is in the init state, the listener is being created. In this state, you can only execute query operations and cannot execute other operations.

    • When the listener is in the active state, the listener is created.

  • You cannot invoke CreateListener to concurrently create listeners for the same Alibaba Cloud Global Accelerator (GA) instance.

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 Alibaba Cloud Global Accelerator (GA) instance. Set the value to cn-hangzhou.

cn-hangzhou

ClientToken

string

No

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 the value is unique among different requests. The client token can contain only ASCII characters.

Note

If you do not set this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId of each API request is unique.

123e4567-e89b-12d3-a456-426655440000

AcceleratorId

string

Yes

The instance ID of the Alibaba Cloud Global Accelerator (GA).

ga-bp1odcab8tmno0hdq****

Name

string

No

The name of the listener.

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

Listener

Description

string

No

The description of the listener.

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

Listener

ClientAffinity

string

No

The client affinity.

  • If you do not set this parameter, client affinity is not maintained. This means that connection requests from the same client may not always be routed to the same endpoint.

  • If you set the value to SOURCE_IP, client affinity is maintained. When a client accesses a stateful application, all requests from the same client are routed to the same endpoint, regardless of the source port and protocol.

SOURCE_IP

Protocol

string

No

The network transmission protocol type of the listener. Valid values:

  • tcp: TCP.

  • udp: UDP.

  • http: HTTP.

  • https: HTTPS.

tcp

PortRanges

array<object>

Yes

The listener port information. Valid values for the listener port: 1 to 65499. The maximum number of ports that you can configure depends on the listener routing type and protocol type. For more information, see Listener ports.

object

No

The listener port information.

Valid values for the listener port: 1 to 65499.

The maximum number of ports that you can configure depends on the listener routing type and protocol type. For more information, see Listener ports.

FromPort

integer

Yes

The start listener port that is used to accept and forward requests to endpoints.

Valid values: 1 to 65499. The value of FromPort must be less than or equal to the value of ToPort.

The maximum number of ports that you can configure depends on the listener routing type and protocol type. For more information, see Listener ports.

Note

For HTTP or HTTPS listeners, you can configure only one listener port. This means that the start port and the end port must be the same.

20

ToPort

integer

Yes

The end listener port that is used to accept and forward requests to endpoints.

Valid values: 1 to 65499. The value of FromPort must be less than or equal to the value of ToPort.

The maximum number of ports that you can configure depends on the listener routing type and protocol type. For more information, see Listener ports.

Note

For HTTP or HTTPS listeners, you can configure only one listener port. This means that the start port and the end port must be the same.

20

Certificates

array<object>

No

The list of SSL certificates.

object

No

The list of SSL certificates.

Id

string

No

The ID of the SSL certificate.

Note

This parameter is required only for HTTPS listeners.

449****-cn-hangzhou

XForwardedForConfig

object

No

The configuration of the XForward fields.

XForwardedForGaIdEnabled

boolean

No

Specifies whether to use the GA-ID header field to retrieve the Alibaba Cloud Global Accelerator (GA) instance ID. Valid values:

  • true: yes.

  • false (default): no.

Note

This parameter is supported only by HTTP and HTTPS listeners.

false

XForwardedForGaApEnabled

boolean

No

Specifies whether to use the GA-AP header field to retrieve the acceleration area information. Valid values:

  • true: yes.

  • false (default): no.

Note

This parameter is supported only by HTTP and HTTPS listeners.

false

XForwardedForProtoEnabled

boolean

No

Specifies whether to use the GA-X-Forward-Proto header field to retrieve the listener protocol of the Alibaba Cloud Global Accelerator (GA) instance. Valid values:

  • true: yes.

  • false (default): no.

Note

This parameter is supported only by HTTP and HTTPS listeners.

false

XForwardedForPortEnabled

boolean

No

Specifies whether to use the GA-X-Forward-Port header field to retrieve the listener port of the Alibaba Cloud Global Accelerator (GA) instance. Valid values:

  • true: yes.

  • false (default): no.

Note

This parameter is supported only by HTTP and HTTPS listeners.

false

XRealIpEnabled

boolean

No

Specifies whether to use the X-Real-IP header field to retrieve the actual client IP address. Valid values:

  • true: yes.

  • false (default): no.

Note

This parameter is supported only by HTTP and HTTPS listeners.

false

SecurityPolicyId

string

No

The instance ID of the security policy. Valid values:

  • tls_cipher_policy_1_0

    • Supported TLS versions: TLSv1.0, TLSv1.1, and TLSv1.2.

    • Supported encryption algorithm 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: TLSv1.1 and TLSv1.2.

    • Supported encryption algorithm 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 versions: TLSv1.2.

    • Supported encryption algorithm 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 versions: TLSv1.2.

    • Supported encryption algorithm 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: TLSv1.2 and TLSv1.3.

    • Supported encryption algorithm 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 is supported only by HTTPS listeners.

tls_cipher_policy_1_0

Type

string

No

The routing type of the listener. Valid values:

  • Standard (default): intelligent routing.

  • CustomRouting: custom route.

Note
  • The custom route feature for listeners is in invitational preview. To use this feature, contact your Alibaba Cloud account manager.

  • You cannot configure both routing types for listeners of the same standard Alibaba Cloud Global Accelerator (GA) instance. After the routing type is configured, it cannot be changed. For more information, see Listener overview.

Standard

EndpointGroupConfigurations

array<object>

No

The configuration information of the endpoint group for the intelligent routing listener.

You can configure up to 10 endpoint groups of this type.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

array<object>

No

The configuration of the endpoint group for the intelligent routing listener.

You can configure up to 10 endpoint groups of this type.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

EndpointGroupName

string

No

The name of the endpoint group for the intelligent routing listener.

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

You can enter up to 10 endpoint group names.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

test

EndpointGroupDescription

string

No

The description of the endpoint group for the intelligent routing listener.

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

You can enter up to 10 endpoint group descriptions.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

test

EndpointGroupRegion

string

No

The region ID of the endpoint group for the intelligent routing listener.

You can enter up to 10 region IDs for the endpoint group.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

cn-hangzhou

TrafficPercentage

integer

No

The traffic distribution ratio. When an intelligent routing listener has multiple endpoint groups, this parameter specifies the proportion of traffic distributed to different endpoint groups.

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

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

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

100

HealthCheckEnabled

boolean

No

Specifies whether to enable health checks for the endpoint group of the intelligent routing listener. Valid values:

  • true: enables health checks.

  • false (default): disables health checks.

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

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

false

HealthCheckIntervalSeconds

integer

No

The interval between two consecutive health checks. Unit: seconds.

You can enter up to 10 health check intervals.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

3

HealthCheckPath

string

No

The health check path.

You can enter up to 10 health check paths.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

/healthcheck

HealthCheckPort

integer

No

The health check port. Valid values: 1 to 65535.

You can enter up to 10 health check ports.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

20

HealthCheckProtocol

string

No

The health check protocol. Valid values:

  • tcp or TCP: TCP.

  • http or HTTP: HTTP.

  • https or HTTPS: HTTPS.

You can enter up to 10 health check protocols.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

tcp

ThresholdCount

integer

No

The number of consecutive health checks that are required to change the health check status. This refers to the number of consecutive failed health checks required to change the status from healthy to unhealthy, or the number of consecutive successful health checks required to change the status from unhealthy to healthy. Valid values: 2 to 10. Default value: 3.

You can enter up to 10 threshold counts for health check status changes.

Note

You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

3

EndpointConfigurations

array<object>

No

The endpoint configuration information for the intelligent routing listener.

object

No

The endpoint configuration information for the intelligent routing listener.

Type

string

No

The endpoint type for the intelligent routing listener. Valid values:

  • Domain: custom domain name.

  • Ip: custom IP address.

  • PublicIp: Alibaba Cloud public IP address.

  • ECS: Alibaba Cloud ECS instance.

  • SLB: Alibaba Cloud SLB instance.

  • ALB: Alibaba Cloud ALB instance.

  • OSS: Alibaba Cloud OSS instance.

  • ENI: Alibaba Cloud elastic network interface controller (NIC).

  • NLB: Alibaba Cloud NLB instance.

  • IpTarget: custom private IP.

You can enter up to 100 endpoint types in an endpoint group of an intelligent routing listener.

Note
  • This parameter is required when the value of Type (listener routing type) is Standard (intelligent routing).

  • If the endpoint type is ECS, ENI, SLB, ALB, NLB, or IpTarget and the service-linked role does not exist, the system automatically creates a service-linked role named AliyunServiceRoleForGaVpcEndpoint.

  • If the endpoint type is ALB and the service-linked role does not exist, the system automatically creates a service-linked role named AliyunServiceRoleForGaAlb.

  • If the endpoint type is OSS and the service-linked role does not exist, the system automatically creates a service-linked role named AliyunServiceRoleForGaOss.

  • If the endpoint type is NLB and the service-linked role does not exist, the system automatically creates a service-linked role named AliyunServiceRoleForGaNlb.

Note

For more information, see Service-linked roles.

Ip

Weight

integer

No

The weight of the endpoint for the intelligent routing listener.

Valid values: 0 to 255.

You can enter up to 100 endpoint weights in an endpoint group of an intelligent routing listener.

Note
  • This parameter is required when the value of Type (listener routing type) is Standard (intelligent routing).

  • If the weight of an endpoint is set to 0, Global Accelerator stops distributing traffic to the endpoint. Proceed with caution.

20

Endpoint

string

No

The IP address or domain name of the endpoint for the intelligent routing listener.

You can enter up to 100 IP addresses or domain names of endpoints in an endpoint group of an intelligent routing listener.

Note

This parameter is required when the value of Type (listener routing type) is Standard (intelligent routing).

47.0.XX.XX

SubAddress

string

No

The private IP of the elastic network interface controller (NIC).

Note

This parameter is optional when the endpoint type is ENI. If you do not configure this parameter, the primary private IP of the ENI is used by default.

172.168.XX.XX

EnableClientIPPreservation

boolean

No

Specifies whether to enable client IP address preservation by using the automatic retrieval method. Valid values:

  • true: enables client IP address preservation.

  • false (default): disables client IP address preservation.

Note
  • By default, client IP address preservation is disabled for endpoint groups associated with UDP or TCP listeners. You can configure this parameter based on your business requirements.

  • By default, client IP address preservation is enabled for endpoint groups associated with HTTP or HTTPS listeners. The client IP address is retrieved by using the X-Forwarded-For header field. You cannot disable this feature.

  • EnableClientIPPreservation and EnableProxyProtocol cannot be set to true at the same time.

  • For more information, see Preserve client IP addresses.

EnableProxyProtocol

boolean

No

Specifies whether to enable client IP address preservation by using the Proxy Protocol method. Valid values:

  • true: enables client IP address preservation.

  • false (default): disables client IP address preservation.

Note
  • This parameter is supported only for endpoint groups associated with TCP listeners.

  • EnableClientIPPreservation and EnableProxyProtocol cannot be set to true at the same time.

  • For more information, see Preserve client IP addresses.

VpcId

string

No

The ID of the VPC.

You can enter up to 1 VPC ID in an endpoint group of an intelligent routing listener.

Note

This parameter is required and takes effect only when the endpoint type is IpTarget.

vpc-bp13r1kpr2lel****

VSwitchIds

array

No

The list of vSwitches in the VPC.

string

No

The ID of the vSwitch.

You can enter up to 2 vSwitch IDs in an endpoint group of an intelligent routing listener.

Note

This parameter is required and takes effect only when the endpoint type is IpTarget.

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

vsw-0jlhcznhw5m7pz2fa****

Provider

string

No

The provider of the endpoint configuration.

BAILIAN

ApiKeys

array

No

The API keys in the endpoint group configuration.

string

No

The API keys in the endpoint group configuration.

sk-******

EndpointRequestProtocol

string

No

Terms of Service protocol of the endpoint for the intelligent routing listener. Valid values:

  • HTTP (default): HTTP.

  • HTTPS: HTTPS.

You can enter up to 10 backend service protocols.

Note
  • You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

  • This parameter is supported only when you create an endpoint group for an HTTP or HTTPS intelligent routing listener.

  • For HTTP listeners, Terms of Service protocol supports and only supports HTTP.

HTTP

EndpointProtocolVersion

string

No

Terms of Service protocol version of the endpoint for the intelligent routing listener. Valid values:

  • HTTP1.1 (default): HTTP/1.1.

  • HTTP2: HTTP/2.

Note

You can configure Terms of Service protocol version only when the value of EndpointRequestProtocol (backend service protocol) is HTTPS.

HTTP1.1

EndpointGroupType

string

No

The endpoint group type for the intelligent routing listener. Valid values:

  • default (default): default endpoint group.

  • virtual: virtual endpoint group.

You can enter up to 10 endpoint group types.

Note
  • You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

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

default

PortOverrides

array<object>

No

The port mapping relationships.

object

No

The port mapping relationships.

ListenerPort

integer

No

The listener port for port mapping.

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

Note
  • You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

  • For TCP listeners: Virtual endpoint groups do not support port mapping. If a virtual endpoint group already exists under the listener, the default endpoint group cannot be configured with port mapping. If the default endpoint group is already configured with port mapping, you cannot add a virtual endpoint group.

  • After port mapping is configured, the following limits apply to subsequent listener modifications: You cannot modify the listener protocol, except for switching between HTTP and HTTPS.

  • Listener port: The modified listener port range must include all listener ports currently configured for port mapping. For example, if the listener port range is 80-82 and port mapping is configured to endpoint ports 100-102, you cannot change the listener port range to 80-81 later.

443

EndpointPort

integer

No

The endpoint port for port mapping.

You can enter up to 5 endpoint ports for port mapping.

Note
  • You can configure the endpoint group and endpoint information for an intelligent routing listener only when the value of Type (listener routing type) is Standard (intelligent routing).

  • For TCP listeners: Virtual endpoint groups do not support port mapping. If a virtual endpoint group already exists under the listener, the default endpoint group cannot be configured with port mapping. If the default endpoint group is already configured with port mapping, you cannot add a virtual endpoint group.

  • After port mapping is configured, the following limits apply to subsequent listener modifications: You cannot modify the listener protocol, except for switching between HTTP and HTTPS.

  • Listener port: The modified listener port range must include all listener ports currently configured for port mapping. For example, if the listener port range is 80-82 and port mapping is configured to endpoint ports 100-102, you cannot change the listener port range to 80-81 later.

80

HealthCheckHost

string

No

The domain name for health checks.

www.taobao.com

EndpointIpVersion

string

No

The IP address protocol of the backend service. Valid values:

  • IPv4 (default): GA communicates with the endpoint service only by using IPv4 addresses.

  • IPv6: GA communicates with the endpoint service only by using IPv6 addresses.

  • ProtocolAffinity: The IP protocol used by GA to communicate with the endpoint service is the same as the IP protocol used by the client request.

IPv4

HealthCheckMethod

string

No

The HTTP request method used for health checks.

GET

HealthCheckSuccessCodes

string

No

The set of HTTP status codes that indicate a successful health check.

http_2xx,http_3xx

CustomRoutingEndpointGroupConfigurations

array<object>

No

The endpoint group configurations for a custom route listener.

You can configure up to five endpoint groups of this type.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

array<object>

No

The endpoint group configurations for a custom route listener.

You can configure up to five endpoint groups of this type.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

EndpointGroupRegion

string

No

The region ID of the endpoint group for a custom route listener.

You can specify up to five region IDs for endpoint groups.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

cn-hangzhou

Name

string

No

The name of the endpoint group for a custom route listener.

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

You can specify up to five endpoint group names.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

test

Description

string

No

The description of the endpoint group for a custom route listener.

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

You can specify descriptions for up to five endpoint groups.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

test

DestinationConfigurations

array<object>

No

The mapping configurations of the endpoint group for a custom route listener.

You must specify the service port range and protocol type of the backend service in the endpoint group. The specified information is mapped to the service port range of the associated listener.

You can specify up to 20 port range and protocol mappings for each endpoint group of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

object

No

The mapping configurations of the endpoint group for a custom route listener.

You must specify the service port range and protocol type of the backend service in the endpoint group. The specified information is mapped to the service port range of the associated listener.

You can specify up to 20 port range and protocol mappings for each endpoint group of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

Protocols

array

No

The protocol type of the backend Terms of Service in the endpoint group for a custom route listener.

You can specify up to four backend Terms of Service protocol types in the port range and protocol mappings for each endpoint group of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

string

No

The protocol type of the backend Terms of Service in the endpoint group for a custom route listener. Valid values:

  • TCP: TCP.

  • UDP: UDP.

  • TCP,UDP: TCP and UDP.

You can specify up to four backend Terms of Service protocol types in the port range and protocol mappings for each endpoint group of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

TCP

FromPort

integer

No

The start port of the backend service in the endpoint group for a custom route listener.

Valid values: 1 to 65499. The value of FromPort must be less than or equal to the value of ToPort.

You can specify up to 20 start ports of the backend service for each endpoint group of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

80

ToPort

integer

No

The end port of the backend service in the endpoint group for a custom route listener.

Valid values: 1 to 65499. The value of FromPort must be less than or equal to the value of ToPort.

You can specify up to 20 end ports of the backend service for each endpoint group of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

80

EndpointConfigurations

array<object>

No

The endpoint configurations for a custom route listener.

You can specify up to 10 endpoints for each endpoint group of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

array<object>

No

The endpoint configurations for a custom route listener.

You can specify up to 10 endpoints for each endpoint group of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

Type

string

No

The backend service type of the endpoint for a custom route listener. Valid values:

  • PrivateSubNet (default): private network CIDR block.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

PrivateSubNet

Endpoint

string

No

The name of the vSwitch instance for the endpoint of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

vsw-test01

TrafficToEndpointPolicy

string

No

The traffic access policy for the backend service of the endpoint for a custom route listener. Valid values:

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

  • AllowAll: allows all access traffic to the specified backend service.

  • AllowCustom: specifies the destinations that can accept access traffic. You must specify the IP address and port range of the destination. If the port range is left empty, all ports of the destination are supported.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

DenyAll

PolicyConfigurations

array<object>

No

The traffic destination configurations for the endpoint of a custom route listener.

You can specify up to 20 traffic destinations for each endpoint of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

array<object>

No

The traffic destination configurations for the endpoint of a custom route listener.

You can specify up to 20 traffic destinations for each endpoint of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

Address

string

No

The IP address of the destination that can accept access traffic.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify up to 20 destination IP addresses for each endpoint of a custom route listener.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

10.0.XX.XX

PortRanges

array<object>

No

The service port range of the destination that can accept access traffic. The service port range must fall within the service port range of the backend service in the endpoint group.

If this parameter is left empty, all ports of the destination are supported.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify port ranges for up to 20 destinations for each endpoint of a custom route listener. You can specify up to five port ranges for each destination.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

object

No

The service port range of the destination that can accept access traffic. The service port range must fall within the service port range of the backend service in the endpoint group.

If this parameter is left empty, all ports of the destination are supported.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify port ranges for up to 20 destinations for each endpoint of a custom route listener. You can specify up to five port ranges for each destination.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

FromPort

integer

No

The start port of the destination that can accept access traffic. The port must fall within the backend service port range of the endpoint group.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify port ranges for up to 20 destinations for each endpoint of a custom route listener. You can specify up to five start ports for each destination.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

80

ToPort

integer

No

The end port of the destination that can accept access traffic. The port must fall within the backend service port range of the endpoint group.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify port ranges for up to 20 destinations for each endpoint of a custom route listener. You can specify up to five end ports for each destination.

Note

You can configure endpoint groups and endpoints for a custom route listener only when Type is set to CustomRouting.

80

IdleTimeout

integer

No

The idle connection timeout period. Unit: seconds.

  • TCP: 10 to 900. Default value: 900.

  • UDP: 10 to 20. Default value: 20.

  • HTTP/HTTPS: 1 to 60. Default value: 15.

900

RequestTimeout

integer

No

The request timeout period for HTTP or HTTPS connections. Unit: seconds.

Valid values: 1 to 180. Default value: 60.

Note

This parameter takes effect only for listeners whose protocol type is HTTP or HTTPS. If the backend server does not return a response within the timeout period, Global Accelerator stops waiting and returns an HTTP 504 error code to the client.

15

HttpVersion

string

No

The maximum version of the HTTP protocol. Valid values:

  • http3: HTTP/3.

  • http2 (default): HTTP/2.

  • http1.1: HTTP/1.1.

Note

This parameter is supported only by HTTPS listeners.

http2

Response elements

Element

Type

Description

Example

object

The response information.

RequestId

string

The request ID.

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

ListenerId

string

The listener ID.

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.