All Products
Search
Document Center

Cloud Enterprise Network:ListGrantVSwitchesToCen

Last Updated:Oct 22, 2024

Queries the vSwitches in a virtual private cloud (VPC) that belongs to another Alibaba Cloud account and is attached to a Cloud Enterprise Network (CEN) instance.

Operation description

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.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
cen:ListGrantVSwitchesToCenget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the VPC.

You can call the DescribeChildInstanceRegions operation to query the most recent region list.

cn-hangzhou
CenIdstringYes

The CEN instance ID.

cen-44m0p68spvlrqq****
VpcIdstringYes

The VPC ID.

vpc-bp12ge2tq5gzdc915****
PageNumberintegerNo

The page number of the page to return. Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page. Valid values: 1 to 50. Default value: 10.

10
ZoneIdstringNo

The ID of the zone.

  • If you specify a zone ID, the system queries the information about the vSwitches in the specified zone.
  • If you do not specify a zone ID, the system queries the information about the vSwitches in all zones.

You can call the DescribeZones operation to query the most recent zone list.

cn-hangzhou-h
EnabledIpv6booleanNo

Specifies whether to enable IPv6. true: enables IPv6. false: disables IPv6. If you do not specify a value, vSwitches are not filtered based on this attribute.

true

Response parameters

ParameterTypeDescriptionExample
object
PageSizeinteger

The number of entries returned per page.

10
RequestIdstring

The ID of the request.

A9288C78-881A-5D30-A8A9-68E05EE0A086
PageNumberinteger

The page number of the returned page.

1
TotalCountinteger

The total number of entries returned.

2
VSwitchesarray<object>

The list of vSwitches.

VSwitchobject
VpcIdstring

The ID of the VPC to which the vSwitch belongs.

vpc-bp12ge2tq5gzdc915****
ZoneIdstring

The ID of the zone to which the vSwitch belongs.

cn-hangzhou-h
VSwitchIdstring

The ID of the vSwitch.

vsw-bp1194lh263wx1gsk****
VSwitchNamestring

The name of the vSwitch.

nametest

Examples

Sample success responses

JSONformat

{
  "PageSize": 10,
  "RequestId": "A9288C78-881A-5D30-A8A9-68E05EE0A086",
  "PageNumber": 1,
  "TotalCount": 2,
  "VSwitches": [
    {
      "VpcId": "vpc-bp12ge2tq5gzdc915****",
      "ZoneId": "cn-hangzhou-h",
      "VSwitchId": "vsw-bp1194lh263wx1gsk****",
      "VSwitchName": "nametest"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterInvalid parameter.The error message returned because the parameter is set to an invalid value.
400UnauthorizedThe AccessKeyId is unauthorized.The error message returned because you do not have the permissions to perform this operation.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-09-10The request parameters of the API has changedView Change Details
2023-07-07The internal configuration of the API is changed, but the call is not affectedView Change Details