Queries servers in a specified server group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListServerGroupServers

The operation that you want to perform. Set the value to ListServerGroupServers.

NextToken String No FFmyTO70tTpLG6I3FmYAXG****

The start position of the query. If this parameter is left empty, the query starts from the beginning.

MaxResults Integer No 50

The maximum number of data records that you want to query. The parameter is optional. Valid values: 1 to 100. Default value: 20.

ServerGroupId String Yes rg-atstuj3rtop****

The ID of the server group.

ServerIds Array of String No i-bp1e0u8f10by57wl****

The ID of the server.

Response parameters

Parameter Type Example Description
MaxResults Integer 50

The maximum number of data records returned.

NextToken String caeba0bbb2be03f8****

The position where the query stopped. If the response does not contain this parameter, all data is queried.

RequestId String CEF72CEB-54B6-4AE8-B225-F876FF7BA984

The ID of the request.

Servers Array of BackendServer

The servers.

Description String test

The description of the server.

Port Integer 80

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

ServerId String ecs-bp67acfmxazb4p****

The ID of the ECS instance, ENI instance or ECI instance.

ServerIp String 192.168.1.1

The IP address of the ENI instance when it is in the inclusive ENI mode.

ServerType String Ecs

The type of the server. Valid values:

  • Ecs: The server is an ECS instance. This is the default value.
  • Eni: The server is an ENI instance.
  • Eci: The server is an ECI instance.
Status String Available

The status of the server.

  • Adding: The server is being added.
  • Available: The server is available.
  • Configuring: The server is being configured.
  • Removing: The server is being removed.
Weight Integer 100

The weight of the server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server.

TotalCount Integer 1000

The total number of entries returned.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListServerGroupServers
&NextToken=FFmyTO70tTpLG6I3FmYAXG****
&MaxResults=50
&ServerGroupId=rg-atstuj3rtop****
&ServerIds=["i-bp1e0u8f10by57wl****"]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListServerGroupServersResponse>
    <MaxResults>50</MaxResults>
    <NextToken>caeba0bbb2be03f8****</NextToken>
    <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
    <Servers>
        <Description>test</Description>
        <Port>80</Port>
        <ServerId>ecs-bp67acfmxazb4p****</ServerId>
        <ServerIp>192.168.1.1</ServerIp>
        <ServerType>Ecs</ServerType>
        <Status>Available</Status>
        <Weight>100</Weight>
    </Servers>
    <TotalCount>1000</TotalCount>
</ListServerGroupServersResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "MaxResults" : 50,
  "NextToken" : "caeba0bbb2be03f8****",
  "RequestId" : "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
  "Servers" : [ {
    "Description" : "test",
    "Port" : 80,
    "ServerId" : "ecs-bp67acfmxazb4p****",
    "ServerIp" : "192.168.1.1",
    "ServerType" : "Ecs",
    "Status" : "Available",
    "Weight" : 100
  } ],
  "TotalCount" : 1000
}

Error codes

HttpCode Error code Error message Description
404 ResourceNotFound.ServerGroup The specified resource %s is not found. The error message returned because the specified resource %s does not exist.

For a list of error codes, visit the API Error Center.