Queries the server group list of a Network Load Balancer (NLB) load balancing instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
nlb:ListServerGroups |
get |
ServerGroup
ServerGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ServerGroupIds |
array |
No |
The server group IDs. You can query up to 20 server group IDs at a time. |
|
|
string |
No |
The server group IDs. You can query up to 20 server group IDs at a time. |
sgp-atstuj3rtoptyui**** |
|
| ServerGroupNames |
array |
No |
The server group names. You can query up to 20 server group names at a time. |
|
|
string |
No |
The server group names. You can query up to 20 server group names at a time. |
NLB_ServerGroup |
|
| ResourceGroupId |
string |
No |
The ID of the resource group to which the server group belongs. |
rg-atstuj3rtop**** |
| ServerGroupType |
string |
No |
The type of the server group. Valid values:
|
Instance |
| VpcId |
string |
No |
The ID of the VPC to which the server group belongs. |
vpc-bp15zckdt37pq72zv**** |
| Tag |
array<object> |
No |
The tags. |
|
|
object |
No |
The tags. |
||
| 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 |
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 |
Test |
| NextToken |
string |
No |
The pagination token that is used in the next request to retrieve a new page of results. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| MaxResults |
integer |
No |
The number of entries per page. Valid values: 1 to 100. Default value: 20. |
20 |
| RegionId |
string |
No |
The region ID of the Network Load Balancer (NLB) load balancing instance. You can invoke the DescribeRegions operation to query the region ID. |
cn-hangzhou |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response for querying server groups. |
||
| RequestId |
string |
The request ID. |
54B28E3D-DF70-471B-AA93-08E683A1B45 |
| ServerGroups |
array<object> |
The list of backend server groups. |
|
|
array<object> |
The list of backend server groups. |
||
| RegionId |
string |
The region ID of the Network Load Balancer (NLB) load balancing instance. |
cn-hangzhou |
| ServerGroupId |
string |
The server group ID. |
sgp-atstuj3rtoptyui**** |
| ServerGroupName |
string |
The server group name. |
NLB_ServerGroup |
| ServerGroupType |
string |
The type of the server group. Valid values:
|
Instance |
| AddressIPVersion |
string |
The protocol version. Valid values:
|
ipv4 |
| VpcId |
string |
The ID of the VPC to which the server group belongs. |
vpc-bp15zckdt37pq72zv**** |
| Scheduler |
string |
The scheduling algorithm. Valid values:
|
Wrr |
| Protocol |
string |
The backend forwarding protocol. Valid values: TCP and UDP. |
TCP |
| HealthCheck |
object |
The health check configuration. |
|
| HealthCheckEnabled |
boolean |
Indicates whether the health check feature is enabled. Valid values:
|
false |
| HealthCheckType |
string |
The protocol that is used for health checks. Valid values:
|
TCP |
| HealthCheckConnectPort |
integer |
The backend port that is used for health checks. Valid values: 0 to 65535. A value of 0 indicates that the port on a backend server is used for health checks. |
200 |
| HealthyThreshold |
integer |
The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status changes from fail to success. Valid values: 2 to 10. |
2 |
| UnhealthyThreshold |
integer |
The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status changes from success to fail. Valid values: 2 to 10. |
3 |
| HealthCheckConnectTimeout |
integer |
The maximum timeout period of a health check response. Unit: seconds. Default value: 5. Valid values: 1 to 300 |
200 |
| HealthCheckInterval |
integer |
The interval at which health checks are performed. Unit: seconds. Default value: 5.
|
10 |
| HealthCheckDomain |
string |
The domain name that you want to use for health checks. Valid values:
Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
$SERVER_IP |
| HealthCheckUrl |
string |
The path to which health check probes are sent. Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
/test/index.html |
| HealthCheckHttpCode |
array |
The HTTP status codes returned for health checks. Multiple HTTP status codes are separated by commas (,). Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
|
|
string |
The HTTP status codes returned for health checks. Multiple HTTP status codes are separated by commas (,). Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
http_2xx |
|
| HttpCheckMethod |
string |
The HTTP method that is used for health checks. Valid values: GET and HEAD. Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
GET |
| HealthCheckReq |
string |
The request string of UDP health checks. The string must be 1 to 512 characters in length, and can contain letters and digits. |
hello |
| HealthCheckExp |
string |
The response string of UDP health checks. The string must be 1 to 512 characters in length, and can contain letters and digits. |
ok |
| HealthCheckHttpVersion |
string |
The version of the HTTP protocol. Valid values: HTTP1.0 and HTTP1.1. Note
This parameter takes effect only if you set HealthCheckType to HTTP. |
HTTP1.0 |
| ConnectionDrainEnabled |
boolean |
Indicates whether connection draining is enabled. Valid values:
|
false |
| ConnectionDrainTimeout |
integer |
The connection draining timeout period. Unit: seconds. Valid values: 10 to 900. |
200 |
| PreserveClientIpEnabled |
boolean |
Indicates whether client IP preservation is enabled. Valid values:
Note
When AddressIPVersion is set to ipv4, the default value is true. When AddressIPVersion is set to ipv6, the value can only be false. This will be changed to true after the underlying infrastructure supports it. |
true |
| AnyPortEnabled |
boolean |
Indicates whether all-port forwarding is enabled. Valid values:
|
false |
| ResourceGroupId |
string |
The ID of the resource group to which the server group belongs. |
rg-atstuj3rtop**** |
| ServerGroupStatus |
string |
The server group status. Valid values:
|
Available |
| AliUid |
integer |
The user UID. |
165820696622**** |
| Tags |
array<object> |
The tags. |
|
|
object |
The tags. |
||
| Key |
string |
The tag key. At most 10 tag keys are returned. The tag key can be up to 64 characters in length, and cannot contain |
Test |
| Value |
string |
The tag value. At most 10 tag values are returned. The tag value can be up to 128 characters in length, and cannot contain |
Test |
| RelatedLoadBalancerIds |
array |
The list of Network Load Balancer (NLB) load balancing instances. |
|
|
string |
The list of Network Load Balancer (NLB) load balancing instances. |
nlb-83ckzc8d4xlp8o**** |
|
| ServerCount |
integer |
The number of backend servers. |
2 |
| IpVersionAffinityMode |
string |
The traffic scheduling policy in dual-stack mode:
Note
This parameter takes effect only when AddressIPVersion is set to DualStack. |
Affinity |
| TotalCount |
integer |
The total number of entries returned. |
1 |
| NextToken |
string |
The pagination token that is used in the next request to retrieve a new page of results. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| MaxResults |
integer |
The number of entries per page. Valid values: 1 to 100. |
20 |
Examples
Success response
JSON format
{
"RequestId": "54B28E3D-DF70-471B-AA93-08E683A1B45",
"ServerGroups": [
{
"RegionId": "cn-hangzhou",
"ServerGroupId": "sgp-atstuj3rtoptyui****",
"ServerGroupName": "NLB_ServerGroup",
"ServerGroupType": "Instance",
"AddressIPVersion": "ipv4",
"VpcId": "vpc-bp15zckdt37pq72zv****",
"Scheduler": "Wrr",
"Protocol": "TCP",
"HealthCheck": {
"HealthCheckEnabled": false,
"HealthCheckType": "TCP",
"HealthCheckConnectPort": 200,
"HealthyThreshold": 2,
"UnhealthyThreshold": 3,
"HealthCheckConnectTimeout": 200,
"HealthCheckInterval": 10,
"HealthCheckDomain": "$SERVER_IP",
"HealthCheckUrl": "/test/index.html",
"HealthCheckHttpCode": [
"http_2xx"
],
"HttpCheckMethod": "GET",
"HealthCheckReq": "hello",
"HealthCheckExp": "ok",
"HealthCheckHttpVersion": "HTTP1.0"
},
"ConnectionDrainEnabled": false,
"ConnectionDrainTimeout": 200,
"PreserveClientIpEnabled": true,
"AnyPortEnabled": false,
"ResourceGroupId": "rg-atstuj3rtop****",
"ServerGroupStatus": "Available",
"AliUid": 0,
"Tags": [
{
"Key": "Test",
"Value": "Test"
}
],
"RelatedLoadBalancerIds": [
"nlb-83ckzc8d4xlp8o****"
],
"ServerCount": 2,
"IpVersionAffinityMode": "Affinity"
}
],
"TotalCount": 1,
"NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
"MaxResults": 20
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | SystemBusy | System is busy, please try again later. | |
| 403 | Forbidden.%s | Authentication is failed for %s. | |
| 403 | Forbidden.NoPermission | Authentication is failed for NoPermission. | Authentication is failed for NoPermission. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.