调用ListServerGroupServers接口查询网络型负载均衡服务器组中的服务器列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListServerGroupServers |
系统规定参数。取值:ListServerGroupServers。 |
ServerGroupId | String | 否 | sgp-atstuj3rtoptyui**** |
服务器组ID。 |
ServerIds.N | String | 否 | ecs-bp67acfmxazb4p**** |
服务器ID列表。单次调用最多支持展示40个服务器。 |
ServerIps.N | String | 否 | 192.168.6.3 |
服务器IP列表。单次调用最多支持展示40个服务器。 |
NextToken | String | 否 | FFmyTO70tTpLG6I3FmYAXGKPd**** |
是否拥有下一次查询的令牌(Token)。取值:
|
MaxResults | Integer | 否 | 20 |
分批次查询时每次显示的条目数。取值范围:1~100,默认值为20。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 54B48E3D-DF70-471B-AA93-08E683A1B45 |
请求ID。 |
Servers | Array of Server |
服务器列表。 |
|
ServerId | String | ecs-bp67acfmxazb4p**** |
后端服务器ID。 |
ServerType | String | Ecs |
后端服务器类型,取值:
|
ServerIp | String | 192.168.2.1 |
后端服务器IP地址。 |
Port | Integer | 80 |
后端服务器使用的端口。取值范围:1~65535。 |
Weight | Integer | 100 |
后端服务器的权重。 |
ServerGroupId | String | sgp-atstuj3rtoptyui**** |
服务器组ID。 |
Description | String | ECS |
后端服务器描述。 |
ZoneId | String | cn-hangzhou-a |
服务器对应的可用区ID。 |
Status | String | Available |
后端服务器的添加状态。取值:
|
TotalCount | Integer | 10 |
列表条目数。 |
NextToken | String | FFmyTO70tTpLG6I3FmYAXGKPd**** |
是否拥有下一次查询的令牌(Token)。取值:
|
MaxResults | Integer | 20 |
分批次查询时每次显示的条目数。 |
示例
请求示例
http(s)://[Endpoint]/?Action=ListServerGroupServers
&ServerGroupId=sgp-atstuj3rtoptyui****
&ServerIds=["ecs-bp67acfmxazb4p****"]
&ServerIps=["192.168.6.3"]
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=20
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<ListServerGroupServersResponse>
<RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
<Servers>
<ServerId>ecs-bp67acfmxazb4p****</ServerId>
<ServerType>Ecs</ServerType>
<ServerIp>192.168.2.1</ServerIp>
<Port>80</Port>
<Weight>100</Weight>
<ServerGroupId>sgp-atstuj3rtoptyui****</ServerGroupId>
<Description>ECS</Description>
<ZoneId>cn-hangzhou-a</ZoneId>
<Status>Available</Status>
</Servers>
<TotalCount>10</TotalCount>
<NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
<MaxResults>20</MaxResults>
</ListServerGroupServersResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"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
}
错误码
访问错误中心查看更多错误码。