All Products
Search
Document Center

Server Load Balancer:ListServerGroupServers

Last Updated:Oct 12, 2024

Queries servers in a server group of a Network Load Balancer (NLB) instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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
nlb:ListServerGroupServersget
  • ServerGroup
    acs:nlb:{#regionId}:{#AccountId}:serverGroup/{#ServerGroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ServerGroupIdstringNo

The ID of the server group.

sgp-atstuj3rtoptyui****
ServerIdsarrayNo

The server IDs. You can specify at most 40 servers in each call.

ServerIdstringNo

The server IDs. You can specify at most 40 servers in each call.

ecs-bp67acfmxazb4p****
ServerIpsarrayNo

A list of server IP addresses. You can specify at most 40 servers in each call.

stringNo

A list of server IP addresses. You can specify at most 40 servers in each call.

192.168.6.3
NextTokenstringNo

The token that is used for the next query. Valid values:

  • If this is your first query or no next query is to be sent, ignore this parameter.
  • If a next query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultsintegerNo

The number of entries to return on each page. Valid values: 1 to 100. Default value: 20.

20
RegionIdstringNo

The region ID of the NLB instance.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

The operation to query servers.

RequestIdstring

The ID of the request.

54B48E3D-DF70-471B-AA93-08E683A1B45
Serversarray<object>

The backend servers.

Serverobject
ServerIdstring

The ID of the server group.

ecs-bp67acfmxazb4p****
ServerTypestring

The type of backend server. Valid values:

  • Ecs: Elastic Compute Service (ECS) instance
  • Eni: elastic network interface (ENI)
  • Eci: elastic container instance
  • Ip: IP address
Ecs
ServerIpstring

The IP address of the backend server.

192.168.2.1
Portinteger

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

80
Weightinteger

The weight of the backend server.

100
ServerGroupIdstring

The ID of the server group.

sgp-atstuj3rtoptyui****
Descriptionstring

The description of the backend server.

ECS
ZoneIdstring

The zone ID of the server.

cn-hangzhou-a
Statusstring

The status of the backend server. Valid values:

  • Adding
  • Available
  • Configuring
  • Removing
Available
TotalCountinteger

The number of entries returned.

10
NextTokenstring

The token that is used for the next query. Valid values:

  • If this is your first query or no next query is to be sent, ignore this parameter.
  • If a next query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultsinteger

The number of entries returned per page.

20

Examples

Sample success responses

JSONformat

{
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
  "Servers": [
    {
      "ServerId": "ecs-bp67acfmxazb4p****",
      "ServerType": "Ecs",
      "ServerIp": "192.168.2.1",
      "Port": 80,
      "Weight": 100,
      "ServerGroupId": "sgp-atstuj3rtoptyui****",
      "Description": "ECS",
      "ZoneId": "cn-hangzhou-a",
      "Status": "Available"
    }
  ],
  "TotalCount": 10,
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "MaxResults": 20
}

Error codes

HTTP status codeError codeError messageDescription
400SystemBusySystem is busy, please try again later.-
403Forbidden.NoPermissionAuthentication is failed for NoPermission.Authentication is failed for NoPermission.
404ResourceNotFound.serverGroupThe specified resource of serverGroup is not found.The specified resource of serverGroup is not found. Please check the input parameters.

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

Change history

Change timeSummary of changesOperation
2023-10-09The Error code has changedView Change Details
2023-09-13The Error code has changedView Change Details
2023-09-11The Error code has changed. The request parameters of the API has changedView Change Details
2023-09-05The Error code has changedView Change Details
2023-08-22The Error code has changedView Change Details