Invokes the CreateCustomRoutingEndpointGroups operation to create endpoint groups for a custom routing type listener in batches.
Operation description
Global Accelerator allocates traffic to endpoints within endpoint groups based on the forwarding method defined by the listener routing type.
After you configure an intelligent routing listener, the Alibaba Cloud Global Accelerator (GA) instance automatically selects the nearest healthy endpoint group for traffic forwarding based on latency factors (primarily depending on geographic location and network link conditions), and ultimately delivers client network access requests to healthy endpoints.
After you configure a custom routing type listener, the Alibaba Cloud Global Accelerator (GA) instance generates a port mapping table based on the configured listener port range, destination endpoint group protocol and port range, and IP address information of the endpoints (vSwitches), to deterministically route traffic to specific IP addresses and ports within vSwitches.
This operation creates endpoint groups for a custom routing type listener. To create endpoint groups for an intelligent routing listener, invoke CreateEndpointGroup.
When you invoke this operation, take note of the following items:
- CreateCustomRoutingEndpointGroups is an asynchronous operation. After you send a request, the system returns a request ID, but the endpoint groups for the custom routing type listener are not yet created. The creation task continues to execute in the background. You can invoke DescribeCustomRoutingEndpointGroup or ListCustomRoutingEndpointGroups to query the status of the endpoint groups:
If an endpoint group is in the init state, the endpoint groups are being created in batches. In this state, you can only execute query operations.
When all endpoint groups are in the active state, the batch creation is complete.
CreateCustomRoutingEndpointGroups does not support concurrent creation of endpoint groups for custom routing type listeners within the same Alibaba Cloud Global Accelerator (GA) instance.
Before you begin
Before you create endpoint groups for a custom routing type listener, make sure that you have completed the following operations:
A standard Global Accelerator instance is created. For more information, see CreateAccelerator.
A bandwidth plan is attached to the standard Alibaba Cloud Global Accelerator (GA) instance. For more information, see BandwidthPackageAddAccelerator.
You have deployed the relevant applications as backend services for Global Accelerator to accept forwarded requests. Custom routing type listeners support only vSwitches as the backend service type.
You have applied for permissions to use custom routing type listeners and created a custom routing type listener. The custom routing type for listeners is in invitational preview. To use this feature, contact your account manager. To create a custom routing type listener, see CreateListener.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ga:CreateCustomRoutingEndpointGroups |
create |
*CustomRoutingEndpointGroup
|
None | 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 ap-southeast-1. |
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 token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters. Note
If you do not specify this parameter, the system automatically uses the RequestId value as the ClientToken value. The RequestId value is different for each API request. |
123e4567-e89b-12d3-a456-426655440000 |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
|
false |
| AcceleratorId |
string |
Yes |
The ID of the Alibaba Cloud Global Accelerator (GA) instance. |
ga-bp1odcab8tmno0hdq**** |
| ListenerId |
string |
Yes |
The ID of the custom routing type listener. |
lsr-bp1bpn0kn908w4nbw**** |
| EndpointGroupConfigurations |
array<object> |
Yes |
The endpoint group configurations. You can specify up to 5 endpoint group configurations. |
|
|
array<object> |
No |
The endpoint group configurations. You can specify up to 5 endpoint group configurations. |
||
| EndpointGroupRegion |
string |
Yes |
The region ID of the endpoint group. You can specify up to 5 endpoint group region IDs. |
cn-hangzhou |
| Name |
string |
No |
The name of the endpoint group. The name must be 1 to 128 characters in length and must start with a letter or Chinese character. The name can contain digits, underscores (_), and hyphens (-). You can specify up to 5 endpoint group names. |
test |
| Description |
string |
No |
The description of the endpoint group. The description can be up to 256 characters in length and cannot contain You can specify up to 5 endpoint group descriptions. |
test |
| DestinationConfigurations |
array<object> |
No |
The mapping configurations of the endpoint group. You must specify the backend service port range and protocol type for the endpoint group. The specified information forms a mapping relationship with the associated listener port range. You can specify up to 20 mapping port range and protocol type entries for each endpoint group. |
|
|
object |
No |
The mapping configurations of the endpoint group. You must specify the backend service port range and protocol type for the endpoint group. The specified information forms a mapping relationship with the associated listener port range. You can specify up to 20 mapping port range and protocol type entries for each endpoint group. |
||
| Protocols |
array |
No |
The protocol types of the backend service for the endpoint group. You can specify up to 4 backend service protocol types in each mapping port range and protocol type entry for the endpoint group. |
|
|
string |
No |
The protocol of the backend service. Valid values:
You can specify up to four protocols for each mapping configuration. |
TCP |
|
| FromPort |
integer |
No |
The start port of the backend service for the endpoint group. 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 port entries for each endpoint group. |
80 |
| ToPort |
integer |
No |
The end port of the backend service for the endpoint group. 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 port entries for each endpoint group. |
80 |
| EndpointConfigurations |
array<object> |
No |
The endpoint configurations. You can specify up to 10 endpoint configurations for each endpoint group. |
|
|
array<object> |
No |
The endpoint configurations. You can specify up to 10 endpoint configurations for each endpoint group. |
||
| Type |
string |
No |
The type of the backend service for the endpoint. Valid values: PrivateSubNet (default): private CIDR block. |
PrivateSubNet |
| Endpoint |
string |
No |
The name of the endpoint vSwitch instance. |
vsw-test01 |
| TrafficToEndpointPolicy |
string |
No |
The traffic policy for the backend service. Valid values:
|
DenyAll |
| PolicyConfigurations |
array<object> |
No |
The traffic destination configurations. You can specify up to 20 traffic destinations for each endpoint. |
|
|
array<object> |
No |
The configurations of the traffic policies. You can specify up to 20 traffic policies for each endpoint. |
||
| Address |
string |
No |
The IP address that is allowed to access the backend service. This parameter is required only when TrafficToEndpointPolicy is set to AllowCustom. You can specify up to 20 IP addresses for each endpoint. |
10.0.XX.XX |
| PortRanges |
array<object> |
No |
The port range that is allowed to access the backend service. The port range must be within the port range of the backend service. If you leave this parameter empty, traffic is allowed to access all ports. 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 five port ranges for each traffic policy. |
|
|
object |
No |
The port range that is allowed to access the backend service. The port range must be within the port range of the backend service. If you leave this parameter empty, traffic is allowed to access all ports. 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 five port ranges for each traffic policy. |
||
| FromPort |
integer |
No |
The first port of the allowed port range. The value of this parameter must be in 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 five first ports for each traffic policy. |
80 |
| ToPort |
integer |
No |
The last port of the allowed port range. The value of this parameter must be in 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 five last ports for each traffic policy. |
80 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
04F0F334-1335-436C-A1D7-6C044FE73368 |
| EndpointGroupIds |
array |
The list of endpoint group IDs. |
|
|
string |
The list of endpoint group IDs. |
epg-bp1dmlohjjz4kqaua**** |
Examples
Success response
JSON format
{
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"EndpointGroupIds": [
"epg-bp1dmlohjjz4kqaua****"
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | StateError.Accelerator | accelerator state %s is illegal | The GA instance is in an invalid state %s. |
| 400 | NotExist.Accelerator | accelerator %s is not exist | The GA instance %s does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.