Creates one or more endpoint groups.

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 CreateEndpointGroups

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

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 1F4B6A4A-C89E-489E-BAF1-52777EE148EF

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 of each API request may be different.
DryRun Boolean No true

Specifies whether to only precheck this request. Valid values:

  • true: prechecks the request but does not create the endpoint group. The system prechecks the required parameters, request syntax, and limits. If the request fails the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false (default): sends the request. If the request passes the precheck, a 2xx HTTP status code is returned and the endpoint group is created.
AcceleratorId String Yes ga-bp1odcab8tmno0hdq****

The ID of the GA instance.

ListenerId String Yes lsr-bp1bpn0kn908w4nbw****

The ID of the listener.

Note If the protocol of the listener is HTTP or HTTPS, only one endpoint group is created after you call the CreateEndpointGroups operation.
EndpointGroupConfigurations.N.EndpointGroupName 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.

You can enter the names of at most 10 endpoint groups.

EndpointGroupConfigurations.N.EndpointGroupDescription String No group1

The description of the endpoint group.

You can enter the descriptions of at most 10 endpoint groups.

EndpointGroupConfigurations.N.EndpointGroupRegion String Yes cn-hangzhou

The ID of the region where you want to create the endpoint group.

You can enter the region IDs of at most 10 endpoint groups.

EndpointGroupConfigurations.N.TrafficPercentage Long No 20

The value of the traffic distribution ratio. If a listener is associated with multiple endpoint groups, you can set this parameter to distribute different percentages of traffic to the endpoint groups.

Valid values: 1 to 100.

You can specify the traffic distribution ratios for at most 10 endpoint groups.

EndpointGroupConfigurations.N.HealthCheckEnabled Boolean No false

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

  • true: enables the health check feature.
  • false (default): disables the health check feature.

You can enable the health check feature for at most 10 endpoint groups.

EndpointGroupConfigurations.N.HealthCheckIntervalSeconds Long No 3

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

You can specify at most 10 health check intervals.

EndpointGroupConfigurations.N.HealthCheckPath String No /healthcheck

The path to which health check requests are sent.

You can specify at most 10 health check paths.

EndpointGroupConfigurations.N.HealthCheckPort Long No 20

The port that is used for health checks. Valid values: 1 to 65535.

You can specify at most 10 ports for health checks.

EndpointGroupConfigurations.N.HealthCheckProtocol String No tcp

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

  • tcp: TCP
  • http: HTTP
  • https: HTTPS

You can specify at most 10 health check protocols.

EndpointGroupConfigurations.N.ThresholdCount Long No 3

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

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

You can specify the number of consecutive health check successes or failures for at most 10 endpoint groups.

EndpointGroupConfigurations.N.EndpointConfigurations.N.Type String No 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

You can specify at most 100 endpoint types in an endpoint group.

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.

EndpointGroupConfigurations.N.EndpointConfigurations.N.Weight Long No 20

The weight of the endpoint.

Valid values: 0 to 255. Default value: 100.

You can set the weights of at most 100 endpoints in an endpoint group.

Note If the weight of an endpoint is set to 0, GA stops distributing network traffic to the endpoint. Proceed with caution.
EndpointGroupConfigurations.N.EndpointConfigurations.N.Endpoint String No 47.0.XX.XX

The IP address or domain name of the endpoint.

You can specify at most 100 endpoint IP addresses or domain names in an endpoint group.

EndpointGroupConfigurations.N.EndpointRequestProtocol String No HTTP

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

  • HTTP (default): HTTP
  • HTTPS: HTTPS

You can specify at most 10 backend service protocols.

Note
  • You can set this parameter only if the listener that is associated with the endpoint group uses HTTP or HTTPS.
  • For an HTTP listener, the backend service protocol must be HTTP.
EndpointGroupConfigurations.N.EndpointGroupType String No default

The type of the endpoint group. Valid values:

  • default: a default endpoint group. This is the default value.
  • virtual: a virtual endpoint group.

You can specify the types of at most 10 endpoint groups.

Note Only HTTP and HTTPS listeners support virtual endpoint groups.
EndpointGroupConfigurations.N.PortOverrides.N.ListenerPort Long No 443

The listener port that is mapped to the endpoint port.

You can specify listener ports in at most five port mappings.

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

The endpoint port that is mapped to the listener port.

You can specify endpoint ports in at most five port mappings.

EndpointGroupConfigurations.N.EnableClientIPPreservationToa Boolean No false

Specifies whether to preserve client IP addresses by using the TCP Option Address (TOA) module. Valid values:

  • true: yes
  • false (default): no

You can specify this parameter for at most 10 endpoint groups.

EndpointGroupConfigurations.N.EnableClientIPPreservationProxyProtocol Boolean No false

Specifies whether to use the proxy protocol to preserve client IP addresses. Valid values:

  • true: yes
  • false (default): no

You can specify this parameter for at most 10 endpoint groups.

Response parameters

Parameter Type Example Description
RequestId String 6FEA0CF3-D3B9-43E5-A304-D217037876A8

The ID of the request.

EndpointGroupIds Array of String ['epg-bp1dmlohjjz4kqaun****','epg-bp1v1u72cx35ogofe****', ...]

The IDs of the endpoint groups.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateEndpointGroups
&RegionId=cn-hangzhou
&ClientToken=1F4B6A4A-C89E-489E-BAF1-52777EE148EF
&DryRun=true
&AcceleratorId=ga-bp1odcab8tmno0hdq****
&ListenerId=lsr-bp1bpn0kn908w4nbw****
&EndpointGroupConfigurations=[{"EndpointGroupName":"group1","EndpointGroupDescription":"group1","EndpointGroupRegion":"cn-hangzhou","TrafficPercentage":20,"HealthCheckEnabled":false,"HealthCheckIntervalSeconds":3,"HealthCheckPath":"/healthcheck","HealthCheckPort":20,"HealthCheckProtocol":"tcp","ThresholdCount":3,"EndpointConfigurations":[{"Type":"Ip","Weight":20,"Endpoint":"120.XX.XX.21"}],"EndpointRequestProtocol":"HTTP","EndpointGroupType":"default","PortOverrides":[{"ListenerPort":443,"EndpointPort":80}],"EnableClientIPPreservationToa":false,"EnableClientIPPreservationProxyProtocol":false}]
&Common request parameters

Sample success responses

XML format

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

<CreateEndpointGroupsResponse>
    <RequestId>6FEA0CF3-D3B9-43E5-A304-D217037876A8</RequestId>
    <EndpointGroupIds>['epg-bp1dmlohjjz4kqaun****','epg-bp1v1u72cx35ogofe****', ...]</EndpointGroupIds>
</CreateEndpointGroupsResponse>

JSON format

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

{
  "RequestId" : "6FEA0CF3-D3B9-43E5-A304-D217037876A8",
  "EndpointGroupIds" : [ "['epg-bp1dmlohjjz4kqaun****','epg-bp1v1u72cx35ogofe****', ...]" ]
}

Error codes

HttpCode Error code Error message Description
400 Domain.NotFit The domain is not fit the rule The error message returned because the domain name does not obtain an ICP number.
400 EndpointGroupExclusive.Listener All endpoint group must under the same listener. The error message returned because all the endpoint groups must be associated with the same listener.
400 RegionConflict.EndpointGroup Endpoint group under the same listener must have different region. The error message returned because the endpoint groups that are associated with the same listener must be deployed in different regions.
400 QuotaExceeded.EndpointGroup The number of endpoint group exceeds the limit. The error message returned because the number of endpoint groups reaches the upper limit.
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 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 reaches the upper limit.
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 reaches the upper limit.

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