CreateCustomRoutingEndpointGroups

Updated at:

Invokes the CreateCustomRoutingEndpointGroups operation to create endpoint groups for custom routing listeners in batches.

Operation description

Global Accelerator allocates traffic to endpoints in an endpoint group based on the forwarding method defined by the listener routing type.

  • After you configure an intelligent routing listener, the Global Accelerator (GA) instance can automatically select the nearest and healthy endpoint group for traffic forwarding based on latency factors (which mainly depend on geographical location and network link conditions), and ultimately deliver client network access requests to healthy endpoints.

  • After you configure a custom routing listener, the GA instance can generate 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 endpoint (vSwitch). This allows the GA instance to deterministically route traffic to specific IP addresses and ports in the vSwitch.

This operation is used to create endpoint groups for custom routing listeners. For the API operation used to create endpoint groups for intelligent routing listeners, see CreateEndpointGroup.

When you invoke this operation, take note of the following items:

  • The CreateCustomRoutingEndpointGroups operation is asynchronous. The system returns a request ID, but the endpoint groups for the custom routing listener are not yet created, and the creation task is still running in the background. You can invoke DescribeCustomRoutingEndpointGroup or ListCustomRoutingEndpointGroups to query the status of the endpoint groups for the custom routing listener:
    • If an endpoint group is in the init state, it indicates that the endpoint groups are being created in batches. In this state, you can only execute query operations and cannot execute other operations.

    • If all endpoint groups are in the active state, it indicates that the endpoint groups are created in batches.

  • The CreateCustomRoutingEndpointGroups operation does not support concurrent creation of endpoint groups for custom routing listeners within the same GA instance.

Before you begin

Before you create endpoint groups for a custom routing listener, make sure that the following operations are completed:

  • A standard Global Accelerator (GA) instance is created. For more information, see CreateAccelerator.

  • A bandwidth plan is associated with the standard GA instance. For more information, see BandwidthPackageAddAccelerator.

  • You have completed the deployment of relevant applications as backend services of Global Accelerator to accept forwarded requests. The backend service type for custom routing listeners only supports vSwitches.

  • You have applied for the permissions to use custom routing listeners and created a custom routing listener. The feature that allows you to select the custom routing type for a listener is in invitational preview. To use this feature, contact your Alibaba Cloud account manager. For more information about how to create a custom routing listener, see CreateListener.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ga:CreateCustomRoutingEndpointGroups

create

*CustomRoutingEndpointGroup

acs:ga:{#regionId}:{#accountId}:ga/{#gaId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the 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 the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The client token can contain only ASCII characters.

Note

If you do not set this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId of each API request is unique.

123e4567-e89b-12d3-a456-426655440000

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run and does not create the endpoint groups for the custom routing listener. The system checks whether required parameters are set, the request format, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.

  • false (default): sends a Normal request. If the request passes the dry run, an HTTP 2xx status code is returned and the endpoint groups for the custom routing listener are created.

false

AcceleratorId

string

Yes

The instance ID of the Global Accelerator (GA).

ga-bp1odcab8tmno0hdq****

ListenerId

string

Yes

The ID of the custom routing listener.

lsr-bp1bpn0kn908w4nbw****

EndpointGroupConfigurations

array<object>

Yes

The endpoint group configurations.

You can specify configurations for up to 5 endpoint groups.

array<object>

No

The endpoint group configurations.

You can specify configurations for up to 5 endpoint groups.

Description

string

No

The description of the endpoint group.

The description can be up to 256 characters in length and cannot contain http:// or https://.

You can specify descriptions for up to 5 endpoint groups.

test

DestinationConfigurations

array<object>

No

The mapping configurations of the endpoint group.

You must specify service port range and protocol type of the backend service in the endpoint group. The specified information forms a mapping relationship with service port range of the associated listener.

You can specify up to 20 mapping port ranges and protocol types for each endpoint group.

object

No

The mapping configurations of the endpoint group.

You must specify service port range and protocol type of the backend service in the endpoint group. The specified information forms a mapping relationship with service port range of the associated listener.

You can specify up to 20 mapping port ranges and protocol types for each endpoint group.

FromPort

integer

No

The start port of the backend service in the endpoint group.

Valid values: 1 to 65499. The value of FromPort must be less than or equal to the value of ToPort, which means the start port must be less than or equal to the end port of the backend service in the endpoint group.

You can specify up to 20 start ports of the backend service for each endpoint group.

80

Protocols

array

No

The backend protocol type (Terms of Service) in the endpoint group.

You can specify up to 4 backend protocol types (Terms of Service) for each mapping port range and protocol type configuration in the endpoint group.

string

No

The backend protocol type (Terms of Service) in the endpoint group. Valid values:

  • TCP: TCP.

  • UDP: UDP.

  • TCP,UDP: TCP and UDP.

You can specify up to 4 backend protocol types (Terms of Service) for each mapping port range and protocol type configuration in the endpoint group.

TCP

ToPort

integer

No

The end port of the backend service in the endpoint group.

Valid values: 1 to 65499. The value of FromPort must be less than or equal to the value of ToPort, which means the start port must be less than or equal to the end port of the backend service in the endpoint group.

You can specify up to 20 end ports of the backend service for each endpoint group.

80

EndpointConfigurations

array<object>

No

The endpoint configurations.

You can specify configurations for up to 10 endpoints in each endpoint group.

array<object>

No

The endpoint configurations.

You can specify configurations for up to 10 endpoints in each endpoint group.

Endpoint

string

No

The name of the vSwitch instance that serves as the endpoint.

vsw-test01

PolicyConfigurations

array<object>

No

The traffic destination configurations.

You can specify up to 20 traffic destinations for each endpoint.

array<object>

No

The traffic destination configurations.

You can specify up to 20 traffic destinations for each endpoint.

Address

string

No

The IP address of the traffic destination that is allowed to receive access traffic.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify up to 20 IP addresses of traffic destinations for each endpoint.

10.0.XX.XX

PortRanges

array<object>

No

Service port range of the traffic destination that is allowed to receive access traffic. Service port range must fall within service port range of the backend service in 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 port ranges for up to 20 traffic destinations for each endpoint, and up to 5 port ranges for each traffic destination.

object

No

Service port range of the traffic destination that is allowed to receive access traffic. Service port range must fall within service port range of the backend service in 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 port ranges for up to 20 traffic destinations for each endpoint, and up to 5 port ranges for each traffic destination.

FromPort

integer

No

The service port of the traffic destination that is allowed to receive access traffic. The port value must fall within the port range of the backend service in the endpoint group.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify port ranges for up to 20 traffic destinations for each endpoint, and up to 5 service ports for each traffic destination.

80

ToPort

integer

No

The service port of the traffic destination that is allowed to receive access traffic. The port value must fall within the port range of the backend service in the endpoint group.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify port ranges for up to 20 traffic destinations for each endpoint, and up to 5 service ports for each traffic destination.

80

TrafficToEndpointPolicy

string

No

The traffic policy for the backend service. Valid values:

  • AllowAll: allows all access traffic to access the specified backend service.

  • DenyAll (default): denies all access traffic from accessing the specified backend service.

  • AllowCustom: specifies the traffic destinations that are allowed to receive access traffic. You must specify the IP address and port range of the traffic destination. If the port range is left empty, all ports of the traffic destination are supported.

DenyAll

Type

string

No

The backend service type of the endpoint. Valid values:

  • PrivateSubNet (default): private CIDR block.

PrivateSubNet

EndpointGroupRegion

string

Yes

The region ID of the endpoint group.

You can specify region IDs for up to 5 endpoint groups.

cn-hangzhou

Name

string

No

The name of the endpoint group.

The name must be 1 to 128 characters in length. It must start with an uppercase letter, a lowercase letter, or a Chinese character, and can contain digits, underscores (_), and hyphens (-).

You can enter up to five endpoint group names.

test

Response elements

Element

Type

Description

Example

object

The returned information.

EndpointGroupIds

array

The list of endpoint group IDs.

string

The list of endpoint group IDs.

epg-bp1dmlohjjz4kqaua****

RequestId

string

The request ID.

04F0F334-1335-436C-A1D7-6C044FE73368

Examples

Success response

JSON format

{
  "EndpointGroupIds": [
    "epg-bp1dmlohjjz4kqaua****"
  ],
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
}

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.