All Products
Search
Document Center

Server Load Balancer:ListServerGroupServers

Last Updated:Mar 01, 2024

Queries servers in a server group.

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
alb:ListServerGroupServersRead
  • ServerGroup
    acs:alb:{#regionId}:{#accountId}:servergroup/{#servergroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NextTokenstringNo

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.
  • You must specify the token that is obtained from the previous query as the value of NextToken.
FFmyTO70tTpLG6I3FmYAXG****
MaxResultsintegerNo

The maximum number of entries to return. Valid values: 1 to 100. If you do not specify a value, the default value 20 is used.

50
ServerGroupIdstringNo

The server group ID.

rg-atstuj3rtop****
ServerIdsarrayNo

The IDs of the servers.

stringNo

The ID of the backend server. You can specify at most 40 server IDs in each call.

  • If the backend server group is of the Instance type, set this parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance.
  • If the backend server group is of the Ip type, set this parameter to an IP address.
  • If the backend server group is of the Fc type, set this parameter to the Alibaba Cloud Resource Name (ARN) of a function.
i-bp1e0u8f10by57wl****
Tagobject []No

The tags that are added to the server group. You can specify up to 10 tags in each call.

KeystringNo

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

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

Test
ValuestringNo

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

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

Test

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

MaxResultsinteger

The maximum number of entries returned.

50
NextTokenstring

The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next page exists.
  • If NextToken is not empty, the value of NextToken can be used in the next request to retrieve a new page of results.
caeba0bbb2be03f8****
RequestIdstring

The request ID.

CEF72CEB-54B6-4AE8-B225-F876FF7BA984
Serversobject []

A list of backend servers.

Descriptionstring

The description of the backend server.

test
Portinteger

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

80
ServerIdstring

The ID of the backend server.

Note If ServerType is set to Fc, ServerId is the ARN of a function.
i-bp1f9kdprbgy9uiu****
ServerIpstring

The IP address in inclusive ENI mode.

192.168.XX.XX
ServerTypestring

The type of the backend server.

Ecs
Statusstring

The status of the backend server. Valid values:

  • Adding
  • Available
  • Configuring
  • Removing
Available
Weightinteger

The weight of the backend server. An ECS instance with a higher weight receives more requests.

100
ServerGroupIdstring

The ID of the server group.

sgp-qy042e1jabmprh****
RemoteIpEnabledboolean

Indicates whether the remote IP address feature is enabled. Valid values:

  • true
  • false
true
TotalCountinteger

The total number of entries returned.

3

Examples

Sample success responses

JSONformat

{
  "MaxResults": 50,
  "NextToken": "caeba0bbb2be03f8****",
  "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
  "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

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

Change history

Change timeSummary of changesOperation
2024-01-17The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Added Error Codes: 403