Invokes the CreateCustomRoutingEndpointTrafficPolicies operation to create an endpoint traffic policy (custom route type listener).
Operation description
This operation takes effect only when the traffic policy of the backend service for the endpoint is set to allow traffic to specified destinations that can accept access traffic. You can invoke DescribeCustomRoutingEndpoint to query the traffic policy of the backend service for a specified endpoint. This operation takes effect only when TrafficToEndpointPolicy is set to AllowCustom (specifying destinations that can accept access traffic).
Before you invoke this operation, take note of the following items:
- CreateCustomRoutingEndpointTrafficPolicies is an asynchronous operation. After you send a request, the system returns a request ID, but the endpoint traffic policies for the custom route type listener are not yet created. The creation task continues to run in the background. You can invoke DescribeCustomRoutingEndpointGroup to query the status of the endpoint group to confirm whether the traffic policies are created.
If the endpoint group is in the updating state, the traffic policies are being created. In this state, you can only execute query operations.
If the endpoint group is in the active state, the traffic policies are created.
The CreateCustomRoutingEndpointTrafficPolicies operation does not support concurrent creation of endpoint traffic policies within the same Global Accelerator instance.
Before you begin
Before you create an endpoint traffic policy, make sure that you have completed the following operations:
-
A standard Global Accelerator instance is created. For more information, see CreateAccelerator.
-
If the billing method of the standard Global Accelerator instance is pay-by-bandwidth, a basic bandwidth plan is attached to the standard Global Accelerator instance. For more information, see BandwidthPackageAddAccelerator.
-
You have deployed the required applications as backend services to accept forwarded requests from Global Accelerator. The backend service type for custom route type listeners supports only vSwitches.
-
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 is created for the custom route type listener. For more information, see CreateCustomRoutingEndpointGroups.
-
An endpoint is created for the custom route type listener. For more information, see CreateCustomRoutingEndpoints.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ga:CreateCustomRoutingEndpointTrafficPolicies |
create |
*CustomRoutingEndpointTrafficPolicy
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the Global Accelerator instance. Set the value to ap-southeast-1. |
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 |
| EndpointId |
string |
Yes |
The ID of the endpoint for which you want to create traffic policies. |
ep-2zewuzypq5e6r3pfh**** |
| PolicyConfigurations |
array<object> |
Yes |
The traffic policy configurations. You can specify up to 500 traffic policies for each endpoint. |
|
|
array<object> |
No |
The traffic policy configurations. You can specify up to 500 traffic policies for each endpoint. |
||
| Address |
string |
No |
The IP address of the traffic destination that is allowed to receive traffic. This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom. You can specify up to 500 traffic destination IP addresses for each endpoint. Note
This parameter is required. |
10.0.XX.XX |
| PortRanges |
array<object> |
No |
The port range of the traffic destination that is allowed to receive traffic. The port range must fall within the backend service port range of the endpoint group. If you leave this parameter 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 500 port ranges for each endpoint, and up to 10 port ranges for each traffic destination. |
|
|
object |
No |
The port range of the traffic destination that is allowed to receive traffic. The port range must fall within the backend service port range of the endpoint group. If you leave this parameter 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. |
||
| FromPort |
integer |
No |
The start port of the traffic destination that is allowed to receive traffic. The port value must fall within the backend service port range of the endpoint group. This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom. If you leave both the start port and end port empty, all ports of the traffic destination are supported. You can specify up to 500 port ranges for each endpoint, and up to 10 start ports for each traffic destination. |
80 |
| ToPort |
integer |
No |
The end port of the traffic destination that is allowed to receive traffic. The port value must fall within the backend service port range of the endpoint group. This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom. If you leave both the start port and end port empty, all ports of the traffic destination are supported. You can specify up to 500 port ranges for each endpoint, and up to 10 end ports for each traffic destination. |
80 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
04F0F334-1335-436C-A1D7-6C044FE73368 |
| PolicyIds |
array |
The IDs of the traffic policies. |
|
|
string |
The IDs of the traffic policies. |
ply-bptest2**** |
Examples
Success response
JSON format
{
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"PolicyIds": [
"ply-bptest2****"
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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.