Creates endpoint groups for a custom routing listener.
Operation description
Global Accelerator (GA) forwards client requests to endpoints in an endpoint group based on the routing type of the listener that is associated with the endpoint group.
- After you configure an intelligent routing listener for a GA instance, the GA instance selects a nearby and healthy endpoint group and forwards client requests to a healthy endpoint in the endpoint group.
- 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.
You can call this operation to create endpoint groups for custom routing listeners. For information about how to create endpoint groups for intelligent routing listeners, see CreateEndpointGroup .
When you call this operation, take note of the following items:
-
CreateCustomRoutingEndpointGroups 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 or ListCustomRoutingEndpointGroups operation to query the status of the endpoint groups that are associated with custom routing listeners.
- If one or more endpoint groups are in the init state, it indicates that the endpoint groups are being created. In this case, you can perform only query operations.
- If all endpoint groups are in the active state, it indicates that the endpoint groups are created.
-
The CreateCustomRoutingEndpointGroups operation cannot be called repeatedly for the same GA instance within a specific period of time.
Prerequisites
Make sure that the following requirements are met before you call this operation:
- A standard GA instance is created. For more information, see CreateAccelerator .
- A bandwidth plan is associated with the standard GA instance. For more information, see BandwidthPackageAddAccelerator .
- An application is deployed to receive requests that are forwarded from GA. You can specify only vSwitches as endpoints for custom routing listeners.
- The permissions to use custom routing listeners are acquired and a custom routing listener is created for the 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 .
Debugging
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:
- The required resource types are displayed in bold characters.
- 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ga:CreateCustomRoutingEndpointGroups | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The ID of the region where the GA instance is deployed. 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 token, but you must make sure that the token is unique among all 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 for each API request is different.
| 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 GA instance. | ga-bp1odcab8tmno0hdq**** |
ListenerId | string | Yes | The ID of the custom routing listener. | lsr-bp1bpn0kn908w4nbw**** |
EndpointGroupConfigurations | array<object> | Yes | The information about the endpoint groups. You can specify at most five endpoint groups. | |
object | Yes | The information about the endpoint groups. You can specify at most five endpoint groups. | ||
EndpointGroupRegion | string | Yes | The ID of the region in which the endpoint group resides. You can specify at most five region IDs. | cn-hangzhou |
Name | string | No | The name of the endpoint group. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter. You can specify at most five endpoint group names. | test |
Description | string | No | The description of the endpoint group. The description cannot exceed 256 characters in length and cannot contain You can specify at most five endpoint group descriptions. | test |
DestinationConfigurations | array<object> | No | The mapping configuration of the endpoint group. You need to specify the backend service ports and protocols for the endpoint group. The ports are mapped to listener ports. You can specify at most 20 mapping configurations for each endpoint group. | |
object | No | The mapping configuration of the endpoint group. You need to specify the backend service ports and protocols for the endpoint group. The ports are mapped to listener ports. You can specify at most 20 mapping configurations for each endpoint group. | ||
Protocols | array | No | The backend service protocol. You can specify up to four backend service protocols in each mapping configuration. | |
string | No | The backend service protocol. Valid values:
You can specify up to four backend service protocols in each mapping configuration. | TCP | |
FromPort | integer | No | The first backend service port for the endpoint group. Valid values: 1 to 65499. The value of FromPort must be smaller than or equal to the value of ToPort. You can specify at most 20 first backend service ports for each endpoint group. | 80 |
ToPort | integer | No | The last backend service port for the endpoint group. Valid values: 1 to 65499. The value of FromPort must be smaller than or equal to the value of ToPort. You can specify at most 20 last backend service ports for each endpoint group. | 80 |
EndpointConfigurations | array<object> | No | The information about the endpoints. You can specify at most 10 endpoints for each endpoint group. | |
object | No | The information about the endpoints. You can specify at most 10 endpoints for each endpoint group. | ||
Type | string | No | The type of endpoint. Set the value to PrivateSubNet, which specifies a private CIDR block. This is the default value. | PrivateSubNet |
Endpoint | string | No | The name of the vSwitch that is specified as an endpoint. | vsw-test01 |
TrafficToEndpointPolicy | string | No | The traffic policy that is used to process traffic to the endpoint. Valid values:
If you set this parameter to AllowCustom, you must specify IP addresses and port ranges as the destinations to which traffic is distributed. 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. | DenyAll |
PolicyConfigurations | array<object> | No | The destination to which traffic is forwarded. You can specify at most 20 destinations for each endpoint. | |
object | No | The destination to which traffic is forwarded. You can specify at most 20 destinations for each endpoint. | ||
Address | string | No | The IP address of the destination to which traffic is forwarded. This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom. You can specify at most 20 destination IP addresses for each endpoint. | 10.0.XX.XX |
PortRanges | array<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 at most 20 destinations in each endpoint and specify at most five port ranges for each 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 at most 20 destinations in each endpoint and specify at most five 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 at most 20 destinations in each endpoint and specify at most five 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 at most 20 destinations in each endpoint and specify at most five last ports for each destination. | 80 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"EndpointGroupIds": [
"epg-bp1dmlohjjz4kqaua****"
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-07-23 | The Error code has changed | View Change Details |
2023-04-20 | The internal configuration of the API is changed, but the call is not affected | View Change Details |