Invokes the CreateCustomRoutingEndpoints operation to create endpoints for a custom route type listener.
Operation description
After you configure a custom route type listener, the Alibaba Cloud Global Accelerator (GA) instance generates a port mapping table based on the configured listener port range, the protocol and port range of the destination endpoint group, and the IP address information of the endpoints (vSwitches). This way, traffic is deterministically routed to specific IP addresses and ports in the vSwitches.
This operation creates endpoints for a custom route type listener. When you invoke this operation, take note of the following items:
- CreateCustomRoutingEndpoints is an asynchronous operation. After a request is sent, the system returns a request ID, but the endpoints are not yet created. The creation node continues to run in the background. You can invoke the DescribeCustomRoutingEndpointGroup operation to query the status of the endpoint group to confirm whether the endpoints are created:
If the endpoint group is in the updating state, the endpoints are being created. In this state, you can only execute query operations.
If the endpoint group is in the active state, the endpoints are created.
The CreateCustomRoutingEndpoints operation does not support concurrent requests to create endpoints for custom route listeners within the same Alibaba Cloud Global Accelerator (GA) instance.
Before you begin
Before you create endpoints for a custom route type listener, make sure that the following operations are complete:
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.
Applications are deployed as backend services of Global Accelerator to accept forwarded requests. Custom route type listeners support only vSwitches as the backend service type.
You have obtained the permissions to use custom route type listeners and created a custom route type listener. The custom route type for listeners is in invitational preview. To use this feature, contact your account manager. To create a custom route type listener, see CreateListener.
An endpoint group for the custom route type listener is created. For more information, see CreateCustomRoutingEndpointGroups.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ga:CreateCustomRoutingEndpoints |
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 cn-hangzhou. |
cn-hangzhou |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of a 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 |
| EndpointGroupId |
string |
Yes |
The ID of the endpoint group in which you want to create an endpoint. |
epg-bp1bpn0kn908w4nb**** |
| EndpointConfigurations |
array<object> |
Yes |
The endpoint configurations. You can specify up to 20 endpoint configurations. |
|
|
array<object> |
No |
The endpoint configurations. You can specify up to 20 endpoint configurations. |
||
| Type |
string |
No |
The backend service type of the endpoint. Valid values: PrivateSubNet (default): private CIDR block. |
PrivateSubNet |
| Endpoint |
string |
No |
The instance ID of the endpoint vSwitch. |
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> |
Yes |
The traffic destination configurations. You can specify up to 20 traffic destinations for each endpoint. |
||
| Address |
string |
Yes |
The IP address of the traffic destination that can receive traffic. This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom. You can specify up to 20 traffic destination IP addresses for each endpoint. |
10.0.XX.XX |
| PortRanges |
array<object> |
No |
The port range of the traffic destination that can receive traffic. The port range must fall within the backend service port range of the endpoint group. If this parameter is left empty, all ports of the traffic destination are supported. This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom. You can specify up to 20 port ranges for each endpoint, and up to 20 port ranges for each traffic destination. |
|
|
object |
No |
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 leave this parameter empty, traffic is forwarded to all destination ports. This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom. You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 port ranges for each destination. |
||
| FromPort |
integer |
No |
The first port of the destination port range. The value of this parameter must fall within the 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 and specify up to 20 first ports for each destination. |
80 |
| ToPort |
integer |
No |
The last port of the destination port range. The value of this parameter must fall within the 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 and specify up to 20 last ports for each destination. |
80 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
04F0F334-1335-436C-A1D7-6C044FE73368 |
| EndpointIds |
array |
The list of endpoint IDs. |
|
|
string |
The list of endpoint IDs. |
epg-bp1dmlohjjz4kqaun**** |
Examples
Success response
JSON format
{
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"EndpointIds": [
"epg-bp1dmlohjjz4kqaun****"
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | NotExist.EndPointGroup | endpoint group %s is not exist | The endpoint group %s does not exist. |
| 400 | StateError.Accelerator | accelerator state %s is illegal | The GA instance is in an invalid state %s. |
| 400 | StateError.EndPointGroup | endpoint group state %s is illegal | The endpoint group is in an invalid state. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.