Batch query for route target groups
Operation description
Lists the route target groups.
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:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis 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 |
|---|---|---|---|---|
| vpc:ListRouteTargetGroups | list | *RouteTargetGroup acs:vpc:{#regionId}:{#accountId}:routetargetgroup/* |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| VpcId | string | No | The ID of the VPC to which the route target group belongs. | vpc-xxxx |
| RouteTargetGroupIds | array | No | List of route target group instance IDs. Up to 50 instance IDs can be queried at a time. | |
| string | No | Route target group instance ID. | rtg-xxxx | |
| MemberId | string | No | Route target group member instance ID. Filters the route target groups that contain the specified member instance ID. | ep-xxxx |
| MaxResults | integer | No | Page size, with a range of 1 to 50. Default value: 50. | 50 |
| NextToken | string | No | Token for the next query. Value: If it is the first query or there is no next query, this field does not need to be filled. If there is a next query, the value should be the NextToken returned from the previous API call. | FFmyTO70tTpLG6I3FmYAXGKPd**** |
| RegionId | string | Yes | The region ID of the VPC to which the route target group belongs. You can obtain the region ID by calling the DescribeRegions interface. | cn-hangzhou |
| ResourceGroupId | string | No | Resource group ID. For more information about resource groups, see What is a Resource Group? | rg-acfmxazdjdhd**** |
| ClientToken | string | No | Client token used to ensure idempotence of the request. Generate a unique parameter value from your client to ensure uniqueness across different requests. ClientToken only supports ASCII characters. Note: If you do not specify this, the system will automatically use the RequestId of the API request as the ClientToken identifier. The RequestId is different for each API request. | 123e4567-e89b-12d3-a456-426655440000 |
| Tag | array<object> | No | List of tags. | |
| object | No | Resource tag. | ||
| Key | string | No | Resource tag key. Up to 20 tag keys are supported. If you need to pass this value, you cannot input an empty string. A tag key can have up to 128 characters and cannot start with | FinanceJoshua |
| Value | string | No | Resource tag value. Up to 20 tag values are supported. If you need to pass this value, you can input an empty string. A tag value can have up to 128 characters and cannot start with | FinanceJoshua |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6",
"NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
"TotalCount": 1,
"RouteTargetGroups": [
{
"Status": "Available",
"RouteTargetGroupDescription": "myRouteTargetGroupDescription",
"RouteTargetMemberList": [
{
"MemberId": "ep-xxxx",
"EnableStatus": "Enable",
"MemberType": "GatewayLoadBalancerEndpoint",
"HealthCheckStatus": "Normal",
"Weight": 100
}
],
"VpcId": "vpc-uf60y8uzhsvbhmuh3l654",
"RouteTargetGroupId": "rtg-xxxx",
"ConfigMode": "Active-Standby",
"RegionId": "cn-hangzhou",
"Tags": [
{
"Value": 8,
"Key": "image/upload/cbbec42e0be33abb27babefcbe0397f0"
}
],
"RouteTargetGroupName": "myRouteTargetGroupName",
"ResourceGroupId": "rg-acfm3swh6ta56ri",
"CreateTime": "2025-12-30T06:40:50Z"
}
],
"MaxResults": 50
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | IllegalParam.NextToken | The specified NextToken is invalid. | The specified NextToken is invalid. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2026-01-04 | Add Operation | View Change Details |
