CreateListener

Updated at: 2025-03-07 07:51

A listener checks connection requests and distributes the requests to endpoints based on forwarding rules that are defined by the scheduling algorithm. You can call the CreateListener operation to create a listener for a GA instance.

Operation description

When you call this operation, take note of the following items:

  • CreateListener is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the DescribeListener operation to query the status of the task.

    • If the listener is in the init state, the listener is being created. In this state, you can perform only query operations.
    • If the listener is in the active state, the listener is created.
  • You cannot repeatedly call the CreateListener operation for the same GA instance within the specified period of time.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
OperationAccess levelResource typeCondition keyAssociated operation
ga:CreateListenercreate
*Listener
acs:ga:{#regionId}:{#accountId}:listener/*
*Accelerator
acs:ga:{#regionId}:{#accountId}:ga/{#acceleratorId}
  • ga:TLSVersion
none

Request parameters

ParameterTypeRequiredDescriptionExample
ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region where the GA instance is deployed. Set the value to cn-hangzhou.

cn-hangzhou
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note
If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId is different for each API request.
123e4567-e89b-12d3-a456-426655440000
AcceleratorIdstringYes

The ID of the GA instance.

ga-bp1odcab8tmno0hdq****
NamestringNo

The name of the listener.

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

Listener
DescriptionstringNo

The description of the listener.

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

Listener
ClientAffinitystringNo

Specifies whether to enable client affinity for the listener.

  • If this parameter is left empty, client affinity is disabled. After client affinity is disabled, requests from a specific client IP address may be forwarded to different endpoints.
  • To enable client affinity, set this parameter to SOURCE_IP. In this case, when a client accesses stateful applications, requests from the same client are forwarded to the same endpoint regardless of the source port or protocol.
SOURCE_IP
ProtocolstringNo

The network transmission protocol that you want to use for the listener. Valid values:

  • tcp: TCP
  • udp: UDP
  • http: HTTP
  • https: HTTPS
tcp
PortRangesarray<object>Yes

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

objectYes

The listener ports.

Valid values: 1 to 65499.

The maximum number of ports that can be configured varies based on the routing type and protocol of the listener. For more information, see Listener overview.

FromPortintegerYes

The first port of the listener port range that you want to use to receive and forward requests to endpoints.

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

The maximum number of ports that can be configured varies based on the routing type and protocol of the listener. For more information, see Listener overview.

Note
You can configure only one listener port for an HTTP or HTTPS listener. In this case, the first port is the same as the last port.
20
ToPortintegerYes

The last port of the listener port range that you want to use to receive and forward requests to endpoints.

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

The maximum number of ports that can be configured varies based on the routing type and protocol of the listener. For more information, see Listener overview.

Note
You can configure only one listener port for an HTTP or HTTPS listener. In this case, the first port is the same as the last port.
20
Certificatesarray<object>No

The SSL certificates.

objectNo

The SSL certificates.

IdstringNo

The ID of the SSL certificate.

Note
This parameter is required only when you create an HTTPS listener.
449****-cn-hangzhou
XForwardedForConfigobjectNo

The XForward headers.

XForwardedForGaIdEnabledbooleanNo

Specifies whether to use the GA-ID header to retrieve the ID of the GA instance. Valid values:

  • true: yes
  • false (default): no
Note
This parameter is available only when you create an HTTPS or HTTP listener.
false
XForwardedForGaApEnabledbooleanNo

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

  • true: yes
  • false (default): no
Note
This parameter is available only when you create an HTTPS or HTTP listener.
false
XForwardedForProtoEnabledbooleanNo

Specifies whether to use the GA-X-Forward-Proto header to retrieve the listener protocol of the GA instance. Valid values:

  • true: yes
  • false (default): no
Note
This parameter is available only when you create an HTTPS or HTTP listener.
false
XForwardedForPortEnabledbooleanNo

Specifies whether to use the GA-X-Forward-Port header to retrieve the listener ports of the GA instance. Valid values:

  • true: yes
  • false (default): no
Note
This parameter is available only when you create an HTTPS or HTTP listener.
false
XRealIpEnabledbooleanNo

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

  • true: yes
  • false (default): no
Note
This parameter is available only when you create an HTTPS or HTTP listener.
false
SecurityPolicyIdstringNo

The ID of the security policy. Valid values:

  • tls_cipher_policy_1_0

    • Supported Transport Layer Security (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 is available only when you create an HTTPS listener.
tls_cipher_policy_1_0
TypestringNo

The routing type of the listener. Valid values:

  • Standard (default): intelligent routing
  • CustomRouting: custom routing
Note
  • Custom routing listeners are in invitational preview. To use custom routing listeners, contact your account manager.
  • You can create only listeners of the same routing type for a standard GA instance. You cannot change the routing types of listeners. For more information, see Listener overview.
  • Standard
    EndpointGroupConfigurationsarray<object>No

    The endpoint groups that are associated with the intelligent routing listener.

    You can configure up to 10 endpoint groups for an intelligent routing listener.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    objectNo

    The endpoint group that is associated with the intelligent routing listener.

    You can configure up to 10 endpoint groups for an intelligent routing listener.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    EndpointGroupNamestringNo

    The name of the endpoint group that is associated with the intelligent routing listener.

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

    You can enter the names of up to 10 endpoint groups.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    test
    EndpointGroupDescriptionstringNo

    The description of the endpoint group that is associated with the intelligent routing listener.

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

    You can enter the descriptions of up to 10 endpoint groups.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    test
    EndpointGroupRegionstringNo

    The region ID of the endpoint group that is associated with the intelligent routing listener.

    You can enter the IDs of up to 10 regions.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    cn-hangzhou
    TrafficPercentagelongNo

    The traffic distribution ratio. If an intelligent routing listener is associated with multiple endpoint groups, you can configure this parameter to specify the ratio of traffic distributed to each endpoint group.

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

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

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    100
    HealthCheckEnabledbooleanNo

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

    • true: enables the health check feature.
    • false (default): disables the health check feature.

    You can enable the health check feature for up to 10 endpoint groups.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    false
    HealthCheckIntervalSecondslongNo

    The interval at which health checks are performed. Unit: seconds.

    You can specify up to 10 health check intervals.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    3
    HealthCheckPathstringNo

    The health check path.

    You can specify up to 10 health check paths.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    /healthcheck
    HealthCheckPortlongNo

    The port that you want to use for health checks. Valid values: 1 to 65535.

    You can specify up to 10 ports for health checks.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    20
    HealthCheckProtocolstringNo

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

    • tcp or TCP
    • http or HTTP
    • https or HTTPS

    You can specify up to 10 health check protocols.

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    tcp
    ThresholdCountlongNo

    The number of failed consecutive health checks that must occur before a healthy endpoint group is considered unhealthy or the number of successful consecutive health checks that must occur before an unhealthy endpoint group is considered healthy. Valid values: 2 to 10. Default value: 3.

    You can specify up to 10 values (the number of consecutive health check successes or consecutive health check failures).

    Note
    You can configure endpoint groups and endpoints only if you set Type to Standard.
    3
    EndpointConfigurationsarray<object>No

    The endpoints that are associated with the intelligent routing listener.

    objectNo

    The endpoint that is associated with the intelligent routing listener.

    TypestringNo

    The type of the endpoint that is associated with the intelligent routing listener. Valid values:

    • Domain: a custom domain name.
    • Ip: a custom IP address.
    • PublicIp: a public IP address provided by Alibaba Cloud.
    • 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 endpoint types in the endpoint group that is associated with the intelligent routing listener.

    Note
  • If you set Type to Standard, you can configure the endpoint group and endpoint that are associated with the intelligent routing listener. In addition, this parameter is required.
  • If you set this parameter to ECS, ENI, SLB, ALB, NLB, or IpTarget and the AliyunServiceRoleForGaVpcEndpoint service-linked role does not exist, the system automatically creates the role.
  • If you set this parameter to ALB and the AliyunServiceRoleForGaAlb service-linked role does not exist, the system automatically creates the role.
  • If you set this parameter to OSS and the AliyunServiceRoleForGaOss service-linked role does not exist, the system automatically creates the role.
  • If you set this parameter to NLB and the AliyunServiceRoleForGaNlb service-linked role does not exist, the system automatically creates the role.
  • For more information, see Service-linked roles.

    Ip
    WeightlongNo

    The weight of the endpoint that is associated with the intelligent routing listener.

    Valid values: 0 to 255.

    You can specify the weights of up to 100 endpoints for an endpoint group of an intelligent routing listener.

    Note
  • If you set Type to Standard, you can configure the endpoint group and endpoint that are associated with the intelligent routing listener. In addition, this parameter is required.
  • If the weight of an endpoint is set to 0, GA stops distributing network traffic to the endpoint. Proceed with caution.
  • 20
    EndpointstringNo

    The IP address or domain name of the endpoint that is associated with the intelligent routing listener.

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

    Note
    If you set Type to Standard, you can configure endpoint groups and endpoints, and this parameter is required.
    47.0.XX.XX
    SubAddressstringNo

    The private IP address of the ENI.

    Note
    This parameter is available only when you set the endpoint type to ENI. If you leave this parameter empty, the primary private IP address of the ENI is used.
    172.168.XX.XX
    EnableClientIPPreservationbooleanNo

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

    • true
    • false (default)
    Note
  • By default, client IP address preservation is disabled for an endpoint group that is associated with a UDP or TCP listener. You can configure this parameter based on your business requirements.
  • By default, client IP address preservation is enabled for an endpoint group that is associated with a HTTP or HTTPS listener. Client IP addresses are obtained by using the X-Forwarded-For header. You cannot disable the feature.
  • EnableClientIPPreservation and EnableProxyProtocol cannot be set to true at the same time.
  • For more information, see Preserve client IP addresses.

    EnableProxyProtocolbooleanNo

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

    • true
    • false (default)
    Note
  • This parameter is supported only by 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.

    VpcIdstringNo

    The virtual private cloud (VPC) ID.

    You can specify one VPC ID for an endpoint group of an intelligent routing listener.

    Note
    This parameter is valid and required only if Type is set to IpTarget.
    vpc-bp13r1kpr2lel****
    VSwitchIdsarrayNo

    The IDs of vSwitches that are deployed in the VPC.

    stringNo

    The vSwitch IDs.

    You can specify two vSwitch IDs for an endpoint group of an intelligent routing listener.

    Note
  • This parameter is valid and required only if Type is set to IpTarget.
  • The vSwitch must belong to the VPC specified by VpcId.
  • vsw-0jlhcznhw5m7pz2fa****
    EndpointRequestProtocolstringNo

    The backend service protocol of the endpoint that is associated with the intelligent routing listener. Valid values:

    • HTTP (default)
    • HTTPS

    You can specify up to 10 backend service protocols.

    Note
  • You can configure endpoint groups and endpoints for an intelligent routing listener only if you set Type to Standard.
  • You can specify this parameter only for HTTP and HTTPS intelligent routing listeners.
  • For an HTTP listener, the backend service protocol must be HTTP.
  • HTTP
    EndpointProtocolVersionstringNo

    The backend service protocol version of the endpoint that is associated with the intelligent routing listener. Valid values:

    • HTTP1.1 (default)
    • HTTP2
    Note
    You can specify this parameter only if EndpointRequestProtocol is set to HTTPS.
    EndpointGroupTypestringNo

    The type of the endpoint group associated with the intelligent routing listener. Valid values:

    • default (default): a default endpoint group.
    • virtual: a virtual endpoint group.

    You can specify up to 10 endpoint group types.

    Note
  • You can configure endpoint groups and endpoints for an intelligent routing listener only if you set Type to Standard.
  • Only HTTP and HTTPS intelligent routing listeners support virtual endpoint groups.
  • default
    PortOverridesarray<object>No

    The port mappings.

    objectNo

    The port mapping.

    ListenerPortlongNo

    The listener port that is mapped to the endpoint port.

    You can specify listener ports in up to five port mappings.

    Note
  • You can configure endpoint groups and endpoints for an intelligent routing listener only if you set Type to Standard.
  • You cannot configure port mappings for virtual endpoint groups of TCP listeners. If a virtual endpoint group already exists on the listener, you cannot configure port mappings for the default endpoint group. If port mappings are configured for the default endpoint group, you cannot add a virtual endpoint group.
  • If you configure port mappings for a listener, you cannot modify the listener protocol. You can only switch between HTTP and HTTPS.
  • Listener port: When you modify the listener port range, make sure that the port range includes the ports configured in port mappings. For example, if you set the listener port range to 80 to 82 and map the listener ports to endpoint ports 100 to 102, you cannot change the listener port range to 80 to 81.
  • 443
    EndpointPortlongNo

    The endpoint port that is mapped to the listener port.

    You can specify endpoint ports in up to five port mappings.

    Note
  • You can configure endpoint groups and endpoints for an intelligent routing listener only if you set Type to Standard.
  • You cannot configure port mappings for virtual endpoint groups of TCP listeners. If a virtual endpoint group already exists on the listener, you cannot configure port mappings for the default endpoint group. If port mappings are configured for the default endpoint group, you cannot add a virtual endpoint group.
  • If you configure port mappings for a listener, you cannot modify the listener protocol. You can only switch between HTTP and HTTPS.
  • Listener port: When you modify the listener port range, make sure that the port range includes the ports configured in port mappings. For example, if you set the listener port range to 80 to 82 and map the listener ports to endpoint ports 100 to 102, you cannot change the listener port range to 80 to 81.
  • 80
    CustomRoutingEndpointGroupConfigurationsarray<object>No

    The endpoint group that is associated with the custom routing listener.

    The endpoint groups that are associated with the custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    objectNo

    The endpoint group that is associated with the custom routing listener.

    You can configure up to five endpoint groups for a custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    EndpointGroupRegionstringNo

    The region ID of the endpoint group that is associated with the custom routing listener.

    You can enter the region IDs of up to five endpoint groups.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    cn-hangzhou
    NamestringNo

    The name of the endpoint group that is associated with the custom routing listener.

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

    You can specify up to five endpoint group names.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    test
    DescriptionstringNo

    The description of the endpoint group that is associated with the custom routing listener.

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

    You can specify up to five endpoint group descriptions.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    test
    DestinationConfigurationsarray<object>No

    The mapping configurations of the endpoint group that is associated with the custom routing listener.

    You need to specify the port ranges and protocols used by the endpoint group. The ports are mapped to listener ports.

    You can specify up to 20 mapping configurations for an endpoint group of a custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    objectNo

    The mapping configurations of the endpoint group that is associated with the custom routing listener.

    You need to specify the port ranges and protocols used by the endpoint group. The ports are mapped to listener ports.

    You can specify up to 20 mapping configurations for an endpoint group of a custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    ProtocolsarrayNo

    The protocol used by the endpoint group that is associated with the custom routing listener.

    You can specify up to four protocol types for an endpoint group of a custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    stringNo

    The backend service protocol of the endpoint group that is associated with the custom routing listener. Valid values:

    • TCP
    • UDP
    • TCP,UDP

    You can specify up to four protocol types for an endpoint group of a custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    TCP
    FromPortintegerNo

    The start port used by the endpoint group that is associated with the custom routing listener.

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

    You can specify up to 20 start ports for an endpoint group of a custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    80
    ToPortintegerNo

    The end port used by the endpoint group that is associated with the custom routing listener.

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

    You can specify up to 20 end ports for an endpoint group of a custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    80
    EndpointConfigurationsarray<object>No

    The endpoints that are associated with the custom routing listener.

    You can configure up to 10 endpoints for an endpoint group of a custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    objectNo

    The endpoint that is associated with the custom routing listener.

    You can configure up to 10 endpoints for an endpoint group of a custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    TypestringNo

    The service type of the endpoint that is associated with the custom routing listener. Default value: PrivateSubNet. Set the value to

    PrivateSubNet, which specifies a private CIDR block.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    PrivateSubNet
    EndpointstringNo

    The name of the vSwitch attached to the endpoint of the custom routing listener.

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    vsw-test01
    TrafficToEndpointPolicystringNo

    The traffic policy for the endpoint that is associated with the custom routing listener. Default value: DenyAll. Valid values:

    • DenyAll (default): denies all traffic to the specified backend service.
    • AllowAll: allows all traffic to the specified backend service.
    • AllowCustom: allows traffic only to specified destinations in the endpoint. If you set this parameter to AllowCustom, you must specify IP addresses and port ranges as the destinations to which you want to distribute traffic. If you specify only IP addresses and do not specify port ranges, GA can forward traffic to the specified IP addresses over all destination ports.
    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    DenyAll
    PolicyConfigurationsarray<object>No

    The destinations in the endpoint that is associated with the custom routing listener.

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

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    objectNo

    The destination in the endpoint that is associated with the custom routing listener.

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

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    AddressstringNo

    The IP address of the destination.

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

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

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    10.0.XX.XX
    PortRangesarray<object>No

    The port ranges of the destination to which traffic is forwarded. The value of this parameter must fall within the port range of the endpoint group.

    If you do not specify this parameter, traffic is forwarded over all ports.

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

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

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    objectNo

    The port range of the destination to which traffic is forwarded. The value of this parameter must fall within the port range of the endpoint group.

    If you do not specify this parameter, traffic is forwarded over all ports.

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

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

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    FromPortintegerNo

    The start port of the port range. The value of this parameter must fall within the port range of the backend service.

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

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

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    80
    ToPortintegerNo

    The end port of the destination port range. The value of this parameter must fall within the port range of the backend service.

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

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

    Note
    You can configure endpoint groups and endpoints for a custom routing listener only if Type is set to CustomRouting.
    80
    IdleTimeoutintegerNo

    The timeout period of idle connections. Unit: seconds.

    • TCP: 10-900. Default value: 900. Unit: seconds.
    • UDP: 10-20. Default value: 20. Unit: seconds.
    • HTTP/HTTPS: 1-60. Default value: 15. Unit: seconds.
    900
    RequestTimeoutintegerNo

    The timeout period for HTTP or HTTPS requests. Unit: seconds.

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

    Note
    This parameter takes effect only for HTTP or HTTPS listeners. If the backend server does not respond within the timeout period, GA returns an HTTP 504 error code to the client.
    15
    HttpVersionstringNo

    The maximum version of the HTTP protocol. Valid values:

    • http3
    • http2 (default)
    • http1.1
    Note
    Only HTTPS listeners support this parameter.
    http2

    Response parameters

    ParameterTypeDescriptionExample
    ParameterTypeDescriptionExample
    object

    The returned information.

    RequestIdstring

    The ID of the request.

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

    The ID of the listener.

    lsr-bp1bpn0kn908w4nbw****

    Examples

    Sample success responses

    JSONformat

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

    Error codes

    HTTP status codeError codeError messageDescription
    HTTP status codeError codeError messageDescription
    400Resource.QuotaFullThe resource quota is exceeded.The number of resources has reached the upper limit.
    400ProtocalIllegal.ListenerThe specified listener protocol is invalid.The specified listener protocol is invalid.
    400NotExist.AcceleratorThe accelerated instance does not exist.The GA instance does not exist.
    400StateError.AcceleratorThe state of the accelerated instance is invalid.The status of the GA instance is invalid.
    400QuotaExceeded.ListenerThe maximum number of listeners is exceeded.The maximum number of listeners is exceeded.
    400QuotaExceeded.ListenerPortThe maximum number of listener ports is exceeded.The maximum number of listener ports is exceeded.
    400NotExist.ListenerPortlistener port %s is not exist-
    400PortRangeIllegal.ListenerThe specified listener port range is invalid.The specified listener port range is invalid.
    400PortRangeIllegal.CountThe hugePort listener only supports one port range.The mass port listener (port number greater than 300) only supports one port range.
    400PortConflict.ListenerThe listener port configuration is in conflict.The listener port configurations are in conflict.
    400PortRangeIllegal.ExceedGaAbilityThe 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).
    400PortRangeIllegal.UDPUDP ports 250, 4789, and 4790 are system reserved ports.-
    400SystemPort.ListenerPorts 65500-65535 are system reserved ports.Ports 65500 to 65535 are reserved by the system.
    400PortRanges.MustOneThe portRanges must be one for HTTPS and HTTP type listener.Only one port is supported for HTTPS and HTTP type listeners.
    400SecurityPolicyId.NotNeedNo security policy ID is required for the listener.No security policy ID is required for the listener.
    400SecurityPolicyIdIllegal.ListenerThe listener security policy ID %s is illegal.The security policy ID of the listener is invalid.
    403Forbbiden.SubUserYou 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.
    403ForbiddenThe user is not authorized to operate on the specified resource.The current account does not have permissions to manage the specified resources.
    500UnknownErrorAn 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.

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    Change timeSummary of changesOperation
    2024-12-23The Error code has changed. The request parameters of the API has changedView Change Details
    2024-07-20The Error code has changedView Change Details
    2024-03-27The Error code has changed. The request parameters of the API has changedView Change Details
    2023-11-06The Error code has changed. The request parameters of the API has changedView Change Details
    2023-10-25The Error code has changedView Change Details
    2023-04-20The Error code has changedView Change Details
    • On this page (1)
    • Operation description
    • Debugging
    • Authorization information
    • Request parameters
    • Response parameters
    • Examples
    • Error codes
    • Change history
    Feedback