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 a 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 the 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 ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

DryRun Boolean No true

Specifies whether to precheck the request. Valid values:

  • true: prechecks the request. Resources are not created. The system checks the required parameters, request format, and service limits. If the request fails the precheck, an error code is returned based on the cause of failure. If the request passes the precheck, the DryRunOperation error code is returned.
  • false: sends the request. This is the default value. If the request passes the precheck, a 2XX HTTP status code is returned and the operation is performed.
AcceleratorId String Yes ga-bp1odcab8tmno0hdq****

The ID of the GA instance.

ListenerId String Yes lsr-bp1bpn0kn908w4nbw****

The ID of the listener.

EndpointGroupConfigrations.N.EndpointGroupName String No group1

The name of the endpoint group.

EndpointGroupConfigrations.N.EndpointGroupDescription String No group1

The description of the endpoint group.

EndpointGroupConfigrations.N.EndpointGroupRegion String Yes cn-hangzhou

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

EndpointGroupConfigrations.N.TrafficPercentage Long No 20

The weight of the listener if the listener is associated with multiple endpoint groups.

EndpointGroupConfigrations.N.HealthCheckEnabled Boolean No true

Specifies whether health check is enabled. Valid values:

  • true: Health check is enabled.
  • false: Health check is disabled.
EndpointGroupConfigrations.N.HealthCheckIntervalSeconds Long No 3

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

EndpointGroupConfigrations.N.HealthCheckPath String No /healthcheck

The path of the health check.

EndpointGroupConfigrations.N.HealthCheckPort Long No 20

The port of the health check.

EndpointGroupConfigrations.N.HealthCheckProtocol String No tcp

The protocol of the health check. Valid values:

  • tcp
  • http
  • https
EndpointGroupConfigrations.N.ThresholdCount Long No 3

The number of consecutive failed health checks that must occur before an endpoint can be considered unhealthy.

EndpointGroupConfigrations.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: an Alibaba Cloud public IP address
  • ECS: an Alibaba Cloud Elastic Compute Service (ECS) instance
  • SLB: an Alibaba Cloud Server Load Balancer (SLB) instance
EndpointGroupConfigrations.N.EndpointConfigurations.N.Weight Long No 20

The weight of the endpoint.

EndpointGroupConfigrations.N.EndpointConfigurations.N.Endpoint String No 120.XX.XX.21

The IP address or domain name of the endpoint.

EndpointGroupConfigrations.N.EndpointRequestProtocol String No HTTP

The protocol of the backend service.

  • HTTP
  • HTTPS
EndpointGroupConfigrations.N.EndpointGroupType String No default

The type of the endpoint group. Valid values:

  • default: a default endpoint group
  • virtual: a virtual endpoint group
EndpointGroupConfigrations.N.PortOverrides.N.ListenerPort Long No 443

The listener port.

EndpointGroupConfigrations.N.PortOverrides.N.EndpointPort Long No 80

The endpoint port.

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 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****
&EndpointGroupConfigrations=[{"EndpointGroupName":"group1","EndpointGroupDescription":"group1","EndpointGroupRegion":"cn-hangzhou","TrafficPercentage":20,"HealthCheckEnabled":true,"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}]}]
&<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

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