CreateEndpointGroup

更新时间:
复制 MD 格式

Create an endpoint group.

Operation description

  • Before you create a virtual endpoint group for a Layer 4 listener, you must first create a default endpoint group.

  • CreateEndpointGroup is an asynchronous operation. After you send a request, the system returns an endpoint group ID and begins creating the endpoint group in the background. You can call DescribeEndpointGroup to query the status of the endpoint group:

    • If the endpoint group is in the init state, it is being created. In this state, you can only perform query operations.

    • If the endpoint group is in the active state, it has been created.

  • You cannot make concurrent calls to the CreateEndpointGroup operation for the same Global Accelerator instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ga:CreateEndpointGroup

create

*EndpointGroup

acs:ga:{#regionId}:{#accountId}:endpointgroup/*

*Listener

acs:ga:{#regionId}:{#accountId}:listener/{#listenerId}

*Accelerator

acs:ga:{#regionId}:{#accountId}:ga/{#acceleratorId}

  • ga:AcceleratorMainland
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to cn-hangzhou.

cn-hangzhou

ClientToken

string

No

The client token used to ensure request idempotence.

You can generate this token, but you must ensure it is unique for each request. The token can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the RequestId of the request as the ClientToken. Each request has a unique RequestId.

123e4567-e89b-12d3-a456-426655440000

AcceleratorId

string

Yes

The ID of the GA instance.

ga-bp1odcab8tmno0hdq****

Name

string

No

The name of the endpoint group.

The name must be 1 to 128 characters long, start with a letter or a Chinese character, and can contain digits, periods (.), underscores (_), and hyphens (-).

group1

Description

string

No

The description of the endpoint group.

The description can be up to 200 characters long and cannot start with http:// or https://.

EndpointGroup

EndpointGroupRegion

string

Yes

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

cn-hangzhou

ListenerId

string

Yes

The ID of the listener.

lsr-bp1bpn0kn908w4nbw****

TrafficPercentage

integer

No

The percentage of traffic distributed to the endpoint group when the listener is associated with multiple endpoint groups. Valid values: 1 to 100.

20

HealthCheckIntervalSeconds

integer

No

The health check interval, in seconds.

3

HealthCheckPath

string

No

The path used for health checks.

/healthcheck

HealthCheckPort

integer

No

The port used for health checks.

20

HealthCheckProtocol

string

No

The protocol used for health checks. Valid values:

  • tcp or TCP: TCP

  • http or HTTP: HTTP

  • https or HTTPS: HTTPS

tcp

ThresholdCount

integer

No

The number of consecutive health checks that must succeed or fail before an endpoint's status changes between healthy and unhealthy. 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 type of the endpoint. Valid values:

  • Domain: a custom domain name.

  • Ip: a custom IP address.

  • IpTarget: a custom private IP address.

  • PublicIp: an Alibaba Cloud public IP address.

  • 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.

  • ENI: an elastic network interface (ENI).

  • NLB: a Network Load Balancer (NLB) instance.

Note
  • If you set the endpoint type to ECS, ENI, SLB, ALB, NLB, or IpTarget, the system automatically creates a service-linked role named AliyunServiceRoleForGaVpcEndpoint if the role does not exist.

  • If you set the endpoint type to ALB, the system automatically creates a service-linked role named AliyunServiceRoleForGaAlb if the role does not exist.

  • If you set the endpoint type to OSS, the system automatically creates a service-linked role named AliyunServiceRoleForGaOss if the role does not exist.

  • If you set the endpoint type to NLB, the system automatically creates a service-linked role named AliyunServiceRoleForGaNlb if the role does not exist.

Note

For more information, see Service-linked roles.

Ip

EnableClientIPPreservation

boolean

No

Specifies whether to preserve client source IP addresses. Valid values:

  • true: preserves client source IP addresses.

  • false (default): does not preserve client source IP addresses.

Note
  • By default, this feature is disabled for endpoint groups that are associated with TCP or UDP listeners. You can enable this feature based on your business requirements.

  • By default, this feature is enabled for endpoint groups that are associated with HTTP or HTTPS listeners. The source IP address is retrieved from the X-Forwarded-For header field. This feature cannot be disabled.

  • EnableClientIPPreservation and EnableProxyProtocol cannot both be set to true.

  • For more information, see Preserve client source IP addresses.

false

Weight

integer

Yes

The weight of the endpoint.

Valid values: 0 to 255.

Note

If you set the weight of an endpoint to 0, GA stops distributing traffic to it. Proceed with caution.

20

EnableProxyProtocol

boolean

No

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

  • true: uses the PROXY protocol.

  • false (default): does not use the PROXY protocol.

Note
  • This parameter can be configured only for endpoint groups that are associated with TCP listeners.

  • EnableClientIPPreservation and EnableProxyProtocol cannot both be set to true.

  • For more information, see Preserve client source IP addresses.

false

Endpoint

string

Yes

The IP address, domain name, or resource ID of the endpoint. The value of this parameter depends on the value of the Type parameter.

120.1.XX.XX

SubAddress

string

No

The private IP address of the ENI.

Note

This parameter applies only when the endpoint type is set to ENI. If you omit this parameter, the primary private IP address of the ENI is used.

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 only when the endpoint type is set to IpTarget.

vpc-bp1quce3451z5b2hv****

VSwitchIds

array

No

A list of vSwitches in the VPC.

string

No

The ID of the vSwitch.

You can specify a maximum of two vSwitch IDs for an endpoint group of an intelligent routing listener.

Note

This parameter is required when the endpoint type is IpTarget.

  • The vSwitch must belong to the VPC specified by the VpcId parameter.

vsw-bp12mho4ze51ezagm****

Provider

string

No

The AI service provider. Set this to BAILIAN to use Alibaba Cloud Model Studio.

BAILIAN

ApiKeys

array

No

The API keys for the AI service.

string

No

The API key for the AI service.

sk-***********

EndpointRequestProtocol

string

No

The protocol used by the backend service. Valid values:

  • HTTP (default)

  • HTTPS

Note
  • This parameter is available only for endpoint groups of HTTP or HTTPS listeners.

  • For an HTTP listener, the backend service protocol must be HTTP.

HTTP

EndpointProtocolVersion

string

No

The version of the backend service protocol. Valid values:

  • HTTP1.1 (default): HTTP/1.1.

  • HTTP2: HTTP/2.

Note

This parameter is available only when EndpointRequestProtocol is set to HTTPS.

HTTP1.1

EndpointGroupType

string

No

The type of the endpoint group. Valid values:

  • default (default): a default endpoint group.

  • virtual: a virtual endpoint group.

Note

Before you create a virtual endpoint group for a Layer 4 listener, make sure that you have created a default endpoint group.

default

PortOverrides

array<object>

No

The listener-to-endpoint port mappings.

object

No

The listener-to-endpoint port mappings.

ListenerPort

integer

No

The listener port for the port mapping.

Note
  • For TCP listeners, you cannot configure port mappings for virtual endpoint groups. If a listener is associated with a virtual endpoint group, you cannot configure port mappings for the default endpoint group. If a default endpoint group has port mappings configured, you cannot add a virtual endpoint group.

  • After you configure port mappings, you cannot change the listener protocol, except for switching between HTTP and HTTPS.

  • When you modify the listener port range, the new range must include all listener ports used in port mappings. For example, if the listener port range is 80-82 and the listener ports are mapped to endpoint ports 100-102, you cannot change the listener port range to 80-81.

443

EndpointPort

integer

No

The endpoint port for the port mapping.

80

HealthCheckEnabled

boolean

No

Specifies whether to enable health checks. Valid values:

  • true: enables health checks.

  • false: disables health checks.

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. The tag key cannot be an empty string.

The tag key can be up to 64 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify up to 20 tag keys.

test-key

Value

string

No

The tag value. The tag value can be an empty string.

The tag value can be up to 128 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify up to 20 tag values.

test-value

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run. The system checks the required parameters, request format, and service limits. If the request fails the dry run, the system returns an error message. If the request passes the dry run, the system returns an HTTP 2xx status code.

  • false (default): sends a normal request. If the request passes the check, the system returns an HTTP 2xx status code and creates the endpoint group.

false

HealthCheckHost

string

No

The domain name used for health checks.

www.taobao.com

EndpointIpVersion

string

No

The IP version used to communicate with the backend service. Valid values:

  • IPv4 (default): GA uses only IPv4 to communicate with the backend service.

  • IPv6: GA uses only IPv6 to communicate with the backend service.

  • ProtocolAffinity: GA uses the same IP version as the client request to communicate with the backend service.

IPv4

Response elements

Element

Type

Description

Example

object

The data returned.

EndpointGroupId

string

The endpoint group ID.

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.