All Products
Search
Document Center

Server Load Balancer:ListServerGroupServers

Last Updated:Jul 13, 2026

Queries the servers in a server group.

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

alb:ListServerGroupServers

get

*ServerGroup

acs:alb:{#regionId}:{#accountId}:servergroup/{#servergroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

NextToken

string

No

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • You do not need to specify this parameter for the first request or if no next query exists.

  • If a next query exists, set the value to the NextToken value returned in the previous API call.

FFmyTO70tTpLG6I3FmYAXG****

MaxResults

integer

No

The maximum number of records to return in this request. Valid values: 1 to 100. If this parameter is not specified, the default value is 20.

50

ServerGroupId

string

No

The server group ID.

sgp-cb25e2i2vr******

ServerIds

array

No

The list of server IDs.

string

No

The server ID. A maximum of 40 servers can be displayed in a single call.

  • If the server group type is Instance, this parameter specifies the resource ID of an ECS instance, ENI, or ECI instance.

  • If the server group type is Ip, this parameter specifies an IP address.

  • If the server group type is Fc, this parameter specifies the ARN of a Function Compute function.

i-bp1e0u8f10by57wl****

Tag

array<object>

No

The tags that are bound to the server group. You can specify up to 10 tags in a single request.

object

No

The tags that are bound to the server group. You can specify up to 10 tags in a single request.

Key

string

No

The tag key. You can specify up to 10 tag keys.

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

Test

Value

string

No

The tag value. You can specify up to 10 tag values.

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

Test

Response elements

Element

Type

Description

Example

object

The response struct.

MaxResults

integer

The maximum number of records returned in this request.

50

NextToken

string

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next query exists.

  • If NextToken is returned, the value indicates the token for the next query.

caeba0bbb2be03f8****

RequestId

string

The request ID.

CEF72CEB-54B6-4AE8-B225-F876FF*****

Servers

array<object>

The list of servers.

object

The backend server struct.

Description

string

The description of the backend server.

test

Port

integer

The port used by the backend server. Valid values: 1 to 65535.

80

ServerId

string

The backend server ID.

Note

If ServerType is set to Fc, ServerId specifies the ARN of the Function Compute function.

i-bp1f9kdprbgy9uiu****

ServerIp

string

The specified IP address.

192.168.XX.XX

ServerType

string

The server type of the backend server.

Ecs

Status

string

The status of the backend server. Valid values:

  • Adding: being added.

  • Available: available.

  • Configuring: being configured.

  • Removing: being removed.

Available

Weight

integer

The weight of the backend server. A server with a higher weight receives more requests.

100

ServerGroupId

string

The server group ID.

sgp-qy042e1jabmprh****

RemoteIpEnabled

boolean

Indicates whether remote IP is enabled. Valid values:

  • true: enabled.

  • false: disabled.

true

TotalCount

integer

The total number of records that match the specified filter conditions.

3

Examples

Success response

JSON format

{
  "MaxResults": 50,
  "NextToken": "caeba0bbb2be03f8****",
  "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF*****",
  "Servers": [
    {
      "Description": "test",
      "Port": 80,
      "ServerId": "i-bp1f9kdprbgy9uiu****",
      "ServerIp": "192.168.XX.XX",
      "ServerType": "Ecs",
      "Status": "Available",
      "Weight": 100,
      "ServerGroupId": "sgp-qy042e1jabmprh****",
      "RemoteIpEnabled": true
    }
  ],
  "TotalCount": 3
}

Error codes

HTTP status code

Error code

Error message

Description

403 Forbidden.ServerGroup Authentication has failed for ServerGroup.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.