Create endpoints in a specified endpoint group that is associated with the custom routing listener of a Global Accelerator (GA) instance.
Usage notes
After you configure a custom routing listener for a GA instance, the instance generates a port mapping table based on the listener port range, protocols and port ranges of the associated endpoint groups, and IP addresses of endpoints (vSwitches), and forwards client requests to specified IP addresses and ports in the vSwitches.
This operation is used to create endpoints for custom routing listeners. When you call this operation to create endpoints in an endpoint group, take note of the following items:
- CreateCustomRoutingEndpoints is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the DescribeCustomRoutingEndpointGroup operation to query the status of an endpoint group and determine whether endpoints are created in the endpoint group.
- If the endpoint group is in the updating state, it indicates that endpoints are being created. In this case, you can perform only query operations.
- If the endpoint group is in the active state, it indicates that endpoints are created.
- The CreateCustomRoutingEndpoints operation cannot be called repeatedly for the same GA instance within a specific period of time.
Prerequisites
The following operations are complete before you call this operation:
- Create a standard GA instance. For more information, see CreateAccelerator.
- Associate a bandwidth plan with the standard GA instance. For more information, see BandwidthPackageAddAccelerator.
- Deploy an application that serves as the endpoint of the GA instance. The application is used to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
- Apply for the permissions to use custom routing listeners, and create a custom routing listener for the standard GA instance. Custom routing listeners are in invitational preview. To use custom routing listeners, contact your account manager. For more information about how to create a custom routing listener, see CreateListener.
- Create an endpoint group for the custom routing listener. For more information, see CreateCustomRoutingEndpointGroups.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateCustomRoutingEndpoints | The operation that you want to perform. Set the value to CreateCustomRoutingEndpoints. |
RegionId | String | Yes | cn-hangzhou | The ID of the region where the GA instance is deployed. Set the value to cn-hangzhou. |
ClientToken | String | No | 123e4567-e89b-12d3-a456-426655440000 | 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 ensure that it is unique among all requests. The token can contain only ASCII characters. Note If you do not set this parameter, the system sets ClientToken to the value of RequestId. The value of RequestId for each API request may be different. |
EndpointGroupId | String | Yes | epg-bp1bpn0kn908w4nb**** | The ID of the endpoint group in which to create endpoints. |
EndpointConfigurations.N.Type | String | No | PrivateSubNet | The type of endpoint. Set the value to PrivateSubNet, which specifies a private CIDR block. This is the default value. |
EndpointConfigurations.N.Endpoint | String | No | vsw-test01 | The name of the vSwitch that is specified as an endpoint. |
EndpointConfigurations.N.TrafficToEndpointPolicy | String | No | DenyAll | The traffic policy that is used to process traffic to the endpoint. Valid values:
|
EndpointConfigurations.N.PolicyConfigurations.N.Address | String | Yes | 10.0.XX.XX | The IP address of the destination to which traffic is distributed. This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom. You can specify up to 20 destination IP addresses for each endpoint. |
EndpointConfigurations.N.PolicyConfigurations.N.PortRanges.N.FromPort | Integer | No | 80 | The first port of the port range of the destination. 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 at most 20 destination port ranges for each endpoint and specify at most 20 first ports for each destination. |
EndpointConfigurations.N.PolicyConfigurations.N.PortRanges.N.ToPort | Integer | No | 80 | The last port of the port range of the destination. 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 at most 20 destination port ranges for each endpoint and specify at most 20 last ports for each destination. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 04F0F334-1335-436C-A1D7-6C044FE73368 | The ID of the request. |
EndpointIds | Array of String | epg-bp1dmlohjjz4kqaun**** | The IDs of the endpoints. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CreateCustomRoutingEndpoints
&RegionId=cn-hangzhou
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&EndpointGroupId=epg-bp1bpn0kn908w4nb****
&EndpointConfigurations=[{"Type":"PrivateSubNet","Endpoint":"vsw-test01","TrafficToEndpointPolicy":"DenyAll","PolicyConfigurations":[{"Address":"10.0.XX.XX","PortRanges":[{"FromPort":80,"ToPort":80}]}]}]
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateCustomRoutingEndpointsResponse>
<RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
<EndpointIds>epg-bp1dmlohjjz4kqaun****</EndpointIds>
</CreateCustomRoutingEndpointsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "04F0F334-1335-436C-A1D7-6C044FE73368",
"EndpointIds" : [ "epg-bp1dmlohjjz4kqaun****" ]
}
Error codes
For a list of error codes, visit the API Error Center.