Queries the server groups of a Network Load Balancer (NLB) instance.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
nlb:ListServerGroups | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ServerGroupIds | array | No | The server group ID. You can specify up to 20 server group IDs in each call. | |
ServerGroupId | string | No | The server group ID. You can specify up to 20 server group IDs in each call. | sgp-atstuj3rtoptyui**** |
ServerGroupNames | array | No | The names of the server groups to be queried. You can specify up to 20 names in each call. | |
ServerGroupName | string | No | The names of the server groups to be queried. You can specify up to 20 names in each call. | 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 server group. Valid values:
| Instance |
VpcId | string | No | The ID of the virtual private cloud (VPC) to which the server group belongs. | vpc-bp15zckdt37pq72zv**** |
Tag | array<object> | No | The tags. | |
object | No | The tags. | ||
Key | string | No | The key of the tag. You can specify up to 10 tag keys. The tag key can be up to 64 characters in length, and cannot contain | Test |
Value | string | No | The value of the tag. You can specify up to 10 tag values. The tag value can be up to 128 characters in length, and cannot contain | 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 NLB instance. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
Response parameters
Examples
Sample success responses
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": 200,
"HealthCheckDomain": "$SERVER_IP",
"HealthCheckUrl": "/test/index.html",
"HealthCheckHttpCode": [
"http_2xx"
],
"HttpCheckMethod": "GET",
"HealthCheckReq": "hello",
"HealthCheckExp": "ok"
},
"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
}
],
"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. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-06-25 | The Error code has changed. The response structure of the API has changed | View Change Details |
2023-09-27 | The Error code has changed. The response structure of the API has changed | View Change Details |
2023-09-26 | The Error code has changed | View Change Details |
2023-09-18 | The Error code has changed. The response structure of the API has changed | View Change Details |
2023-08-22 | The Error code has changed | View Change Details |