Queries the Switches in a virtual private cloud (VPC) that belongs to another Alibaba Cloud account and is attached to a Cloud Enterprise Network (CEN) instance.
Usage notes
Before you call the ListGrantVSwitchesToCen operation, make sure that the following requirements are met:
- The permissions on the VPC are granted to the CEN instance. For more information, see GrantInstanceToCen.
- The VPC is attached to the CEN instance.
- For more information about how to connect an Enterprise Edition transit router to a VPC, see CreateTransitRouterVpcAttachment.
- For more information about how to connect a Basic Edition transit router to a VPC, see AttachCenChildInstance.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | ListGrantVSwitchesToCen |
The operation that you want to perform. Set the value to ListGrantVSwitchesToCen. |
| RegionId | String | Yes | cn-hangzhou |
The region ID of the VPC. You can call the DescribeChildInstanceRegions operation to query the most recent region list. |
| CenId | String | Yes | cen-44m0p68spvlrqq**** |
The ID of the CEN instance. |
| VpcId | String | Yes | vpc-bp12ge2tq5gzdc915**** |
The ID of the VPC. |
| PageNumber | Integer | No | 1 |
The page number of the page to return. Default value: 1. |
| PageSize | Integer | No | 10 |
The number of entries to return on each page. Valid values: 1 to 50. Default value: 10. |
| ZoneId | String | No | cn-hangzhou-h |
The ID of the zone.
You can call the DescribeZones operation to query the most recent zone list. |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| PageSize | Integer | 10 |
The number of entries returned per page. |
| RequestId | String | A9288C78-881A-5D30-A8A9-68E05EE0A086 |
The ID of the request. |
| PageNumber | Integer | 1 |
The page number of the returned page. |
| TotalCount | Integer | 2 |
The total number of entries returned. |
| VSwitches | Array of VSwitch |
The list of vSwitches. |
|
| VpcId | String | vpc-bp12ge2tq5gzdc915**** |
The ID of the VPC to which the vSwitch belongs. |
| ZoneId | String | cn-hangzhou-h |
The ID of the zone to which the vSwitch belongs. |
| VSwitchId | String | vsw-bp1194lh263wx1gsk**** |
The ID of the vSwitch. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListGrantVSwitchesToCen
&RegionId=cn-hangzhou
&CenId=cen-44m0p68spvlrqq****
&VpcId=vpc-bp12ge2tq5gzdc915****
&PageNumber=1
&PageSize=10
&Common request parameters
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListGrantVSwitchesToCenResponse>
<TotalCount>2</TotalCount>
<PageSize>10</PageSize>
<RequestId>A9288C78-881A-5D30-A8A9-68E05EE0A086</RequestId>
<PageNumber>1</PageNumber>
<VSwitches>
<VpcId>vpc-bp12ge2tq5gzdc915****</VpcId>
<ZoneId>cn-hangzhou-h</ZoneId>
<VSwitchId>vsw-bp1194lh263wx1gsk****</VSwitchId>
</VSwitches>
<VSwitches>
<VpcId>vpc-bp12ge2tq5gzdc915****</VpcId>
<ZoneId>cn-hangzhou-i</ZoneId>
<VSwitchId>vsw-bp1607g2jc48qanlk****</VSwitchId>
</VSwitches>
</ListGrantVSwitchesToCenResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalCount" : 2,
"PageSize" : 10,
"RequestId" : "A9288C78-881A-5D30-A8A9-68E05EE0A086",
"PageNumber" : 1,
"VSwitches" : [ {
"VpcId" : "vpc-bp12ge2tq5gzdc915****",
"ZoneId" : "cn-hangzhou-h",
"VSwitchId" : "vsw-bp1194lh263wx1gsk****"
}, {
"VpcId" : "vpc-bp12ge2tq5gzdc915****",
"ZoneId" : "cn-hangzhou-i",
"VSwitchId" : "vsw-bp1607g2jc48qanlk****"
} ]
}
Error codes
For a list of error codes, visit the Error Center.