Creates an endpoint group.

Debugging

OpenAPI Explorer automatically calculates the signature value. 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 the 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 the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Note If you do not set this parameter, the system automatically uses RequestId as ClientToken. RequestId may be different for each API request.
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 you want to create the endpoint group.

ListenerId String Yes lsr-bp1bpn0kn908w4nbw****

The ID of the listener.

TrafficPercentage Integer No 20

The traffic ratio for the endpoint group when the specified listener is associated with multiple endpoint groups.

Valid values: 1 to 100.

HealthCheckIntervalSeconds Integer No 3

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

HealthCheckPath String No /healthcheck

The path to which health check requests are sent.

HealthCheckPort Integer No 20

The port used for health checks.

HealthCheckProtocol String No tcp

The protocol over which health check requests are sent. Valid values:

  • tcp: TCP
  • http: HTTP
  • https: HTTPS
ThresholdCount Integer No 3

The number of consecutive health check failures that must occur before a healthy endpoint is considered unhealthy, or the number of consecutive health check successes that must occur before an unhealthy endpoint is considered healthy.

Valid values: 2 to 10. Default value: 3.

EndpointRequestProtocol String No HTTP

The protocol used by the backend service. Valid values:

  • HTTP: This is the default value.
  • HTTPS
Note
  • You can set this parameter only when the listener that is associated with the endpoint group uses HTTP or HTTPS.
  • For an HTTP listener, the backend service protocol must be HTTP.
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 (default): yes
  • false: no
EndpointConfigurations.N.Type String Yes Ip

The type of the endpoint. Valid values:

  • Domain: a custom domain name
  • Ip: a custom IP address
  • PublicIp: a public IP address provided by Alibaba Cloud
  • ECS: an Elastic Compute Service (ECS) instance
  • SLB: a Server Load Balancer (SLB) instance
  • ALB: an Application Load Balancer (ALB) instance
  • OSS: an Object Storage Service (OSS) bucket
Note
  • If you set this parameter to ECS or SLB and the service-linked role AliyunServiceRoleForGaVpcEndpoint does not exist, the system automatically creates the service-linked role.
  • If you set this parameter to ALB and the service-linked role AliyunServiceRoleForGaAlb does not exist, the system automatically creates the service-linked role.
  • If you set this parameter to OSS and the service-linked role AliyunServiceRoleForGaOss does not exist, the system automatically creates the service-linked role.

    For more information, see Service-linked roles.

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: yes
  • false (default): no
EndpointConfigurations.N.Weight Integer Yes 20

The weight of the endpoint.

Valid values: 0 to 255. Default value: 100

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 aware of the impact on your business before you set the endpoint weight to 0.
EndpointConfigurations.N.Endpoint String Yes 120.1.XX.XX

The IP address or domain name of the endpoint.

PortOverrides.N.ListenerPort Integer No 443

The listener port that is mapped to the endpoint port.

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

The endpoint port that is mapped to the listener port.

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.1.XX.XX"}]
&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

HttpCode Error code Error message Description
400 NotExist.ListenerPort The listening port %s does not exist. The error message returned because the specified listener port %s does not exist.
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 unstable.
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 state.
400 NotExist.BusinessRegion The business 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 is specified.
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 unauthorized to create the service-linked role. Contact the owner of the Alibaba Cloud account or the administrator to acquire the AliyunGlobalAccelerationFullAccess permission or create a custom permission policy. The service name of the custom permission policy must be vpcendpoint.ga.aliyuncs.com, the service-linked role must be AliyunServiceRoleForGaVpcEndpoint, and the ram:CreateServiceLinkedRole permission must be granted.
400 QuotaExceeded.PortOverride The number of port override exceeds the limit. The error message returned because the number of port mappings has reached the upper limit.

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