All Products
Search
Document Center

Global Accelerator:CreateEndpointGroup

Last Updated:Apr 10, 2024

Creates an endpoint group.

Operation description

  • When you call this operation to create a virtual endpoint group for a Layer 4 listener, make sure that a default endpoint group is created.

  • CreateEndpointGroup is an asynchronous operation. After you send a request, the system returns the ID of an endpoint group, but the endpoint group is still being created in the system background. You can call the DescribeEndpointGroup operation to query the state of the endpoint group.

    • If the endpoint group is in the init state, it indicates that the endpoint group is being created. In this case, you can perform only query operations.
    • If the endpoint group is in the active state, it indicates that the endpoint group is created.
  • The CreateEndpointGroup operation cannot be repeatedly called for the same Global Accelerator (GA) instance within a specific period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ga:CreateEndpointGroupWrite
  • 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

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
123e4567-e89b-12d3-a456-426655440000
AcceleratorIdstringYes

The ID of the GA instance.

ga-bp1odcab8tmno0hdq****
NamestringNo

The name of the endpoint group.

The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

group1
DescriptionstringNo

The description of the endpoint group.

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

EndpointGroup
EndpointGroupRegionstringYes

The ID of the region in which to create the endpoint group.

cn-hangzhou
ListenerIdstringYes

The ID of the listener.

lsr-bp1bpn0kn908w4nbw****
TrafficPercentageintegerNo

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

Valid values: 1 to 100.

20
HealthCheckIntervalSecondsintegerNo

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

3
HealthCheckPathstringNo

The path to which to send health check requests.

/healthcheck
HealthCheckPortintegerNo

The port that is used for health checks.

20
HealthCheckProtocolstringNo

The protocol over which to send health check requests. Valid values:

  • tcp or TCP
  • http or HTTP
  • https or HTTPS
tcp
ThresholdCountintegerNo

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.

3
EndpointConfigurationsobject []No

The configurations of endpoints in the endpoint group.

TypestringYes

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 Classic Load Balancer (CLB) 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 this parameter to ECS, ENI, SLB, ALB, or NLB and the AliyunServiceRoleForGaVpcEndpoint service-linked role does not exist, the system automatically creates the service-linked role.

  • If you set this parameter to ALB and the AliyunServiceRoleForGaAlb service-linked role does not exist, the system automatically creates the role.

  • If you set this parameter to OSS and the AliyunServiceRoleForGaOss service-linked role does not exist, the system automatically creates the role.

  • If you set this parameter to NLB and the AliyunServiceRoleForGaNlb service-linked role does not exist, the system automatically creates the role.

For more information, see Service-linked roles.

Ip
EnableClientIPPreservationbooleanNo

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

  • true
  • false (default)
false
WeightintegerYes

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 the endpoint. Proceed with caution.
20
EnableProxyProtocolbooleanNo

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

  • true
  • false (default)
false
EndpointstringYes

Enter the IP address, domain name, or instance ID based on the value of the Type parameter.

120.1.XX.XX
SubAddressstringNo

The private IP address of the ENI.

Note This parameter is available only when you set the endpoint type to ENI. If you leave this parameter empty, the primary private IP address of the ENI is used.
172.168.XX.XX
EndpointRequestProtocolstringNo

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

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

    The type of the endpoint group. Valid values:

    • default (default): a default endpoint group.
    • virtual: a virtual endpoint group.
    Note When you call this operation to create a virtual endpoint group for a Layer 4 listener, make sure that a default endpoint group is created.
    default
    PortOverridesobject []No

    The mappings between ports.

    ListenerPortintegerNo

    The listener port that is mapped to the endpoint port.

    Note
  • Only HTTP and HTTPS listeners support port mappings.
  • The listener port must be the one used by the current listener.
  • 443
    EndpointPortintegerNo

    The endpoint port that is mapped to the listener port.

    80
    HealthCheckEnabledbooleanNo

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

    • true
    • false
    true
    Tagobject []No

    Tags of GA instances.

    KeystringNo

    The tag key of the GA instance. The tag key cannot be an empty string.

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

    You can specify up to 20 tag keys.

    test-key
    ValuestringNo

    The tag value of the GA instance. The tag value cannot be an empty string.

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

    You can specify up to 20 tag values.

    test-value

    Response parameters

    ParameterTypeDescriptionExample
    object
    EndpointGroupIdstring

    The ID of the endpoint group.

    epg-bp1dmlohjjz4kqaun****
    RequestIdstring

    The ID of the request.

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

    Examples

    Sample success responses

    JSONformat

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

    Error codes

    HTTP status codeError codeError messageDescription
    400Domain.NotFitThe domain is not fit the ruleThe domain name does not have an ICP number.
    400Resource.QuotaFullThe resource quota is exceeded.The number of resources has reached the upper limit.
    400NotExist.ListenerPortThe listening port %s does not exist.The listening port does not exist.
    400NoPermission.EnableHealthCheckYou do not have permission to enable health check.The current account does not have the permissions to enable health checks.
    400NotExist.ListenerThe listener does not exist.The listener does not exist.
    400NotActive.ListenerThe state of the listener is not active.The listener is unstable.
    400NotExist.AcceleratorThe accelerated instance does not exist.The GA instance does not exist.
    400StateError.AcceleratorThe state of the accelerated instance is invalid.The status of the GA instance is invalid.
    400NotExist.BusinessRegionThe business region does not exist.The business region does not exist.
    400NotExist.BasicBandwidthPackageYou must specify the basic bandwidth package.You must specify the basic bandwidth package.
    400QuotaExceeded.EndPointThe maximum number of endpoints is exceeded.The maximum number of endpoints is exceeded.
    400Exist.EndpointGroupThe endpoint group already exists.The endpoint group already exists.
    400NoPermission.VpcEndpointYou 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.
    400EndPointRequestProtocolIllegal.EndpointGroupendpoint group request protoco is illegal-
    400QuotaExceeded.PortOverrideThe number of port override exceeds the limit.The number of port override exceeds the limit.
    400NotExist.ListenerPortlistener port %s is not exist-
    500UnknownErrorAn 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.

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2023-11-22The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 400
      delete Error Codes: 500
    2023-09-14The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 400
      delete Error Codes: 500
    2023-06-20The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 400
      delete Error Codes: 500
    2023-04-20The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 400
      delete Error Codes: 500
    2023-03-31The Error code has changed. The request parameters of the API has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 400
      delete Error Codes: 500
    Input ParametersThe request parameters of the API has changed.
      Added Input Parameters: Tag