Creates an endpoint group.
Operation description
-
When you call this operation to create a virtual endpoint group for a Layer 4 listener, make sure that a default endpoint group is created.
-
CreateEndpointGroup is an asynchronous operation. After you call this operation, the system returns an endpoint group ID, but the endpoint group is not yet created and the creation task is still running in the background. You can call DescribeEndpointGroup to query the status of the endpoint group:
-
When the endpoint group is in the init state, the endpoint group is being created. In this state, you can only perform query operations.
-
When the endpoint group is in the active state, the endpoint group is created.
-
-
You cannot call the CreateEndpointGroup operation to concurrently create endpoint groups for the same Global Accelerator (GA) instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ga:CreateEndpointGroup |
create |
*EndpointGroup
*Listener
*Accelerator
|
|
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 the value 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 |
| AcceleratorId |
string |
Yes |
The ID of the Global Accelerator (GA) instance. |
ga-bp1odcab8tmno0hdq**** |
| Name |
string |
No |
The name of the endpoint group. The name must be 1 to 128 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter or a Chinese character. |
group1 |
| Description |
string |
No |
The description of the endpoint group. The description can be up to 200 characters in length, and cannot start with |
EndpointGroup |
| EndpointGroupRegion |
string |
Yes |
The region ID of the endpoint group. |
cn-hangzhou |
| ListenerId |
string |
Yes |
The ID of the listener. |
lsr-bp1bpn0kn908w4nbw**** |
| TrafficPercentage |
integer |
No |
The traffic percentage that is distributed to the endpoint group when the listener has multiple endpoint groups. Valid values: 1 to 100. |
20 |
| HealthCheckIntervalSeconds |
integer |
No |
The interval between two consecutive health checks. Unit: seconds. |
3 |
| HealthCheckPath |
string |
No |
The health check path. |
/healthcheck |
| HealthCheckPort |
integer |
No |
The health check port. |
20 |
| HealthCheckProtocol |
string |
No |
The health check protocol. Valid values:
|
tcp |
| ThresholdCount |
integer |
No |
The number of consecutive health checks that must succeed or fail before the health check status changes from success to failure or from failure to success. Valid values: 2 to 10. Default value: 3. |
3 |
| EndpointConfigurations |
array<object> |
No |
The endpoint configurations. |
|
|
object |
No |
The endpoint configurations. |
||
| Type |
string |
Yes |
The endpoint type. Valid values:
Note
Note
For more information, see Service-linked roles. |
Ip |
| EnableClientIPPreservation |
boolean |
No |
Specifies whether to enable client IP address preservation by using the automatic retrieval method. Valid values:
Note
|
false |
| Weight |
integer |
Yes |
The weight of the endpoint. Valid values: 0 to 255. Note
If the weight of an endpoint is set to 0, Global Accelerator stops distributing traffic to the endpoint. Proceed with caution. |
20 |
| EnableProxyProtocol |
boolean |
No |
Specifies whether to enable client IP address preservation by using the Proxy Protocol. Valid values:
Note
|
false |
| Endpoint |
string |
Yes |
The IP address, domain name, or instance ID of the endpoint. Specify the value based on the endpoint type. |
120.1.XX.XX |
| SubAddress |
string |
No |
The private IP address of the elastic network interface controller (NIC). Note
This parameter is optional when the endpoint type is ENI. If you do not set this parameter, the primary private IP address of the elastic network interface controller (NIC) is used by default. |
172.168.X.X |
| VpcId |
string |
No |
The ID of the virtual private cloud (VPC). You can specify at most one VPC ID for an endpoint group of an intelligent routing listener. Note
This parameter is required and takes effect only when the endpoint type is IpTarget. |
vpc-bp1quce3451z5b2hv**** |
| VSwitchIds |
array |
No |
The vSwitches in the VPC. |
|
|
string |
No |
The ID of the vSwitch. You can specify at most two vSwitch IDs for an endpoint group of an intelligent routing listener. Note
This parameter is required and takes effect only when the endpoint type is IpTarget.
|
vsw-bp12mho4ze51ezagm**** |
|
| Provider |
string |
No |
The service provider in the endpoint configuration. |
BAILIAN |
| ApiKeys |
array |
No |
The API keys in the endpoint configuration. |
|
|
string |
No |
The first API key in the endpoint configuration. |
sk-*********** |
|
| EndpointRequestProtocol |
string |
No |
The backend service protocol. Valid values:
Note
|
HTTP |
| EndpointProtocolVersion |
string |
No |
The version of the backend service protocol. Valid values:
Note
You can specify the backend service protocol version only when the EndpointRequestProtocol parameter is set to HTTPS. |
HTTP1.1 |
| EndpointGroupType |
string |
No |
The endpoint group type. Valid values:
Note
When you create a virtual endpoint group for a Layer 4 listener, make sure that a default endpoint group is created. Valid values:
|
default |
| PortOverrides |
array<object> |
No |
The port mappings. |
|
|
object |
No |
The port mappings. |
||
| ListenerPort |
integer |
No |
The listener port in the port mapping. Note
|
443 |
| EndpointPort |
integer |
No |
The endpoint port in the port mapping. |
80 |
| HealthCheckEnabled |
boolean |
No |
Specifies whether to enable health checks. Valid values:
|
true |
| Tag |
array<object> |
No |
The tags of the endpoint group. |
|
|
object |
No |
The tags of the endpoint group. |
||
| Key |
string |
No |
The tag key of the endpoint group. The tag key cannot be an empty string. The tag key can be up to 64 characters in length, and cannot start with You can specify up to 20 tag keys. |
test-key |
| Value |
string |
No |
The tag value of the endpoint group. The tag value can be an empty string. The tag value can be up to 128 characters in length, and cannot start with You can specify up to 20 tag values. |
test-value |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
|
false |
| HealthCheckHost |
string |
No |
The domain name used for health checks. |
www.taobao.com |
| EndpointIpVersion |
string |
No |
The IP version of the backend IP address. Valid values:
|
IPv4 |
| ProxyTunnel |
object |
No |
The proxy tunnel configuration. |
|
| ConnectAuthPrefix |
string |
No |
The authentication prefix for the proxy tunnel connection. |
prefix-auth |
| ConnectAuthSuffix |
string |
No |
The authentication suffix for the proxy tunnel connection. |
suffix-auth |
| ConnectSessionHashHdr |
string |
No |
The name of the request header used for session hashing. |
X-Session-Hash |
| ConnectTunnelTimeout |
integer |
No |
The timeout period for the proxy tunnel connection. Unit: milliseconds. |
5000 |
| TunnelServerPort |
integer |
No |
The tunnel server port. |
8443 |
| TunnelServerType |
string |
No |
The address type of the tunnel server. Valid values: ip (IPv4 address) and domain (domain name). |
domain |
| TunnelServer |
string |
No |
The IPv4 address or domain name of the tunnel server. |
tunnel.example.com |
| HealthCheckSuccessCodes |
string |
No |
The set of status codes that indicate a successful health check. |
http_2xx,http_3xx |
| HealthCheckMethod |
string |
No |
The HTTP request method used for health checks. |
GET |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned information. |
||
| EndpointGroupId |
string |
The ID of the endpoint group. |
epg-bp1dmlohjjz4kqaun**** |
| RequestId |
string |
The request ID. |
04F0F334-1335-436C-A1D7-6C044FE73368 |
Examples
Success response
JSON format
{
"EndpointGroupId": "epg-bp1dmlohjjz4kqaun****",
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Domain.NotFit | The domain is not fit the rule | The domain name does not have an ICP number. |
| 400 | Resource.QuotaFull | The resource quota is exceeded. | The number of resources has reached the upper limit. |
| 400 | NotExist.ListenerPort | The listening port %s does not exist. | The listening port does not exist. |
| 400 | NoPermission.EnableHealthCheck | You do not have permission to enable health check. | The current account does not have the permissions to enable health checks. |
| 400 | NotExist.Listener | The listener does not exist. | The listener does not exist. |
| 400 | NotActive.Listener | The state of the listener is not active. | The listener is unstable. |
| 400 | NotExist.Accelerator | The accelerated instance does not exist. | The GA instance does not exist. |
| 400 | StateError.Accelerator | The state of the accelerated instance is invalid. | The status of the GA instance is invalid. |
| 400 | NotExist.BusinessRegion | The business region does not exist. | The business region does not exist. |
| 400 | NotExist.BasicBandwidthPackage | You must specify the basic bandwidth package. | You must specify the basic bandwidth package. |
| 400 | QuotaExceeded.EndPoint | The maximum number of endpoints is exceeded. | The maximum number of endpoints is exceeded. |
| 400 | Exist.EndpointGroup | The endpoint group already exists. | The endpoint group already exists. |
| 400 | NoPermission.VpcEndpoint | You are not authorized to perform the operation. | The user does not have permissions to create service linked roles. Contact the Alibaba Cloud account owner or the permission administrator to grant the current user AliyunGlobalAccelerationFullAccess or create custom permission policies for service linked role. The following content describes the detailed information about custom permission policies: ServiceName: vpcendpoint.ga.aliyuncs.com. Service linked role name: AliyunServiceRoleForGaVpc. Endpoint Permission: ram:CreateServiceLinkedRole. |
| 400 | EndPointRequestProtocolIllegal.EndpointGroup | endpoint group request protoco is illegal | |
| 400 | QuotaExceeded.PortOverride | The number of port override exceeds the limit. | The number of port override exceeds the limit. |
| 500 | UnknownError | An error occurred while processing your request. Please try again. If the error persists, please submit a ticket. | An error occurred while the request was being processed. Try again later. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.