Creates an endpoint group.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. OpenAPI Explorer automatically calculates signature values. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateEndpointGroup

The operation that you want to perform. Set the value to CreateEndpointGroup.

RegionId String Yes cn-hangzhou

The ID of the region where your Global Accelerator (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 your client to generate a token. Make sure that you use a unique token for each request. The token can contain only ASCII characters and cannot exceed 64 characters in length.

AcceleratorId String Yes ga-bp1odcab8tmno0hdq****

The ID of the GA instance.

Name String No group1

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.

Description String No EndpointGroup

The description of the endpoint group.

EndpointGroupRegion String Yes cn-hangzhou

The ID of the region where the endpoint group is deployed.

ListenerId String Yes lsr-bp1bpn0kn908w4nbw****

The ID of the listener that is associated with the endpoint group.

TrafficPercentage Integer No 20

The weight of the endpoint group. If the specified listener is associated with multiple endpoint groups, you must specify the weight of the current endpoint group.

HealthCheckIntervalSeconds Integer No 3

The interval at which health checks are performed. Unit: seconds.

HealthCheckPath String No /healthcheck

The path on which health checks run.

HealthCheckPort Integer No 20

The port that is used for health checks.

HealthCheckProtocol String No tcp

The protocol that is used for health checks. Valid values:

  • tcp
  • http
  • https
ThresholdCount Integer No 3

The threshold of consecutive failed health checks. If the number of consecutive failed health checks exceeds the specified value, the system considers the endpoint unhealthy.

EndpointRequestProtocol String No HTTP

The protocol that is used by the backend service. Valid values:

  • HTTP: This is the default value.
  • HTTPS
Note
  • You can configure this parameter only when the listener that is associated with the endpoint group uses the HTTP or HTTPS protocol.
  • An HTTP listener supports only HTTP as the backend service protocol.
EndpointGroupType String No default

The type of the endpoint group. Valid values:

  • default: The endpoint group is a default endpoint group. This is the default value.
  • virtual: The endpoint group is a virtual endpoint group.
Note Only HTTP and HTTPS listeners support virtual endpoint groups.
HealthCheckEnabled Boolean No true

Specifies whether to enable the health check feature. Valid values:

  • true: enables the health check feature. This is the default value.
  • false: disables the health check feature.
EndpointConfigurations.N.Type String Yes Ip

The type of the endpoint. Valid values:

  • Domain: a custom domain name
  • Ip: a custom IP address
  • PublicIp: an Alibaba Cloud public IP address
  • ECS: an Alibaba Cloud Elastic Compute Service (ECS) instance
  • SLB: an Alibaba Cloud Server Load Balancer (SLB) instance
Note If you set this parameter to ECS or SLB and the service-linked role does not exist, the system automatically creates a service-linked role named AliyunServiceRoleForGaVpcEndpoint. For more information, see AliyunServiceRoleForGaVpcEndpoint.
EndpointConfigurations.N.EnableClientIPPreservation Boolean No false

Specifies whether to obtain and preserve the IP addresses of clients that access the endpoint by using the TCP Option Address (TOA) module. Valid values:

  • true: enables the client IP address preservation feature.
  • false: disables the client IP address preservation feature. This is the default value.
EndpointConfigurations.N.Weight Integer Yes 20

The weight of the endpoint.

Valid values: 0 to 255.

Note If you set the weight of an endpoint to 0, GA does not route network traffic to the endpoint. Make sure that you are fully aware of the impact on your business before you set the endpoint weight to 0.
EndpointConfigurations.N.Endpoint String Yes 120.XX.XX.21

The IP address or domain name of the endpoint.

PortOverrides.N.ListenerPort Integer No 443

The listening port for port mapping.

Note
  • Only HTTP and HTTPS listeners support port mapping.
  • The listening port configured for port mapping must be the same as the port used by the current listener.
PortOverrides.N.EndpointPort Integer No 80

The endpoint port for port mapping.

Response parameters

Parameter Type Example Description
EndpointGroupId String epg-bp1dmlohjjz4kqaun****

The ID of the endpoint group.

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

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateEndpointGroup
&RegionId=cn-hangzhou
&ClientToken=123e4567-e89b-12d3-a456-426655440000    
&AcceleratorId=ga-bp1odcab8tmno0hdq****
&Name=group1
&Description=EndpointGroup
&EndpointGroupRegion=cn-hangzhou
&ListenerId=lsr-bp1bpn0kn908w4nbw****
&TrafficPercentage=20
&HealthCheckIntervalSeconds=3
&HealthCheckPath=/healthcheck
&HealthCheckPort=20
&HealthCheckProtocol=tcp
&ThresholdCount=3
&EndpointConfigurations=[{"Type":"Ip","EnableClientIPPreservation":false,"Weight":20,"Endpoint":"120.XX.XX.21"}] 
&EndpointRequestProtocol=HTTP
&EndpointGroupType=default
&PortOverrides=[{"ListenerPort":443,"EndpointPort":80}]
&HealthCheckEnabled=true
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateEndpointGroupResponse>
    <EndpointGroupId>epg-bp1dmlohjjz4kqaun****</EndpointGroupId>
    <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
</CreateEndpointGroupResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "EndpointGroupId" : "epg-bp1dmlohjjz4kqaun****",
  "RequestId" : "04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

HTTP status code Error code Error message Description
400 NotExist.ListenerPort The listening port %s does not exist. The error message returned because listening port %s does not exist.
400 NoPermission.EnableHealthCheck You do not have permission to enable health check. The error message returned because you are not authorized to enable the health check feature. Submit a ticket to apply for the permissions.
400 NotExist.Listener The listener does not exist. The error message returned because the specified listener does not exist.
400 NotActive.Listener The state of the listener is not active. The error message returned because the specified listener is in an unstable status.
400 NotExist.Accelerator The accelerated instance does not exist. The error message returned because the specified GA instance does not exist.
400 StateError.Accelerator The state of the accelerated instance is invalid. The error message returned because the specified GA instance is in an invalid status.
400 NotExist.BusinessRegion The specified region does not exist. The error message returned because the specified region does not exist.
400 NotExist.BasicBandwidthPackage You must specify the basic bandwidth package. The error message returned because no basic bandwidth plan are bound to the GA instance.
400 QuotaExceeded.EndPoint The maximum number of endpoints is exceeded. The error message returned because the number of endpoints has reached the upper limit.
400 Exist.EndpointGroup The endpoint group already exists. The error message returned because the specified endpoint group already exists.
400 NoPermission.VpcEndpoint You are not authorized to perform the operation. The error message returned because you are not authorized to create the service-linked role. Contact the owner of the Alibaba Cloud account or the account administrator to grant the current user the AliyunGlobalAccelerationFullAccess permission or custom permissions that allow the current user to create the service-linked role. A custom permission policy contains the following information: 1. service name: vpcendpoint.ga.aliyuncs.com. 2. service-linked role: AliyunServiceRoleForGaVpcEndpoint. 3. required permissions: ram:CreateServiceLinkedRole.
400 QuotaExceeded.PortOverride The number of port override exceeds the limit. The error message returned because the number of port overrides has reached the upper limit.

For a list of error codes, visit the API Error Center.