All Products
Search
Document Center

Cloud Enterprise Network:ListGrantVSwitchEnis

Last Updated:Mar 25, 2024

Queries the elastic network interfaces (ENIs) that can be used as multicast sources or members in a specified virtual private cloud (VPC).

Operation description

Before you call ListGrantVSwitchEnis, make sure that the VPC is attached to a Cloud Enterprise Network (CEN) instance. For more information, see CreateTransitRouterVpcAttachment .

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:ListGrantVSwitchEnisRead
  • CenInstance
    acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CenIdstringYes

The ID of the CEN instance to which the VPC is attached.

cen-a7syd349kne38g****
VpcIdstringYes

The ID of the VPC.

vpc-p0w9alkte4w2htrqe****
VSwitchIdstringYes

The ID of a vSwitch in the VPC. You can specify only one vSwitch in each call.

vsw-p0w9s2ig1jnwgrbzl****
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

AAAAAdDWBF2****
MaxResultslongNo

The number of entries to return on each page. Valid values: 10 to 500.

Default value:

  • If you do not specify a value, the default value is 20.
  • If this parameter is set to a value greater than 500, the default value is 500.
20
NetworkInterfaceIdarrayNo

The ID of ENI N. Valid values of N: 1 to 100.

stringNo

The ID of the ENI.

eni-wz9a2sgsskvw69v2****
NetworkInterfaceNamestringNo

The name of the ENI.

test-eni-name
PrimaryIpAddressstringNo

The primary private IPv4 address of the ENI.

192.168.XX.XX

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

DBFE1736-2F33-5309-9954-875B11E9519D
TotalCountstring

The total number of entries returned.

Note If MaxResults and NextToken are sued to query results by page, ignore this parameter.
6
GrantVSwitchEnisobject []

The information about the ENI.

VpcIdstring

The VPC ID.

vpc-p0w9alkte4w2htrqe****
VSwitchIdstring

The vSwitch ID.

vsw-p0w9s2ig1jnwgrbzl****
NetworkInterfaceIdstring

The ENI ID.

eni-p0w172vv82kxzb49****
Descriptionstring

The ENI description.

created by CBN
TransitRouterFlagboolean

Indicates whether the ENI is created by a transit router. Valid values:

  • true
  • false

ENIs that are created by transit routers cannot be used as multicast sources or members.

false
NetworkInterfaceNamestring

The ENI name.

my-eni-name
PrimaryIpAddressstring

The primary private IPv4 address of the ENI.

192.168.XX.XX
NextTokenstring

The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results.

AAAAAdDWBF2****
MaxResultslong

The total number of entries returned.

20

Examples

Sample success responses

JSONformat

{
  "RequestId": "DBFE1736-2F33-5309-9954-875B11E9519D",
  "TotalCount": "6",
  "GrantVSwitchEnis": [
    {
      "VpcId": "vpc-p0w9alkte4w2htrqe****",
      "VSwitchId": "vsw-p0w9s2ig1jnwgrbzl****",
      "NetworkInterfaceId": "eni-p0w172vv82kxzb49****",
      "Description": "created by CBN",
      "TransitRouterFlag": false,
      "NetworkInterfaceName": "my-eni-name",
      "PrimaryIpAddress": "192.168.XX.XX"
    }
  ],
  "NextToken": "AAAAAdDWBF2****",
  "MaxResults": 20
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidCenId.NotFoundThe specified CenId is not found.The error message returned because the specified CEN instance ID does not exist.
400InvalidVpcId.NotFoundThe specified VpcId is not found.The error message returned because the specified VPC ID (VpcId) is invalid.
400InvalidOperation.MulticastDomainAssociationNotExistOperation is invalid because multicast association domain association not exist.The error message returned because this operation is not supported when the specified multicast domain is not associated with the specified resource.
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
2023-08-03The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: NextToken
    Added Input Parameters: MaxResults
    Added Input Parameters: NetworkInterfaceId
    Added Input Parameters: NetworkInterfaceName
    Added Input Parameters: PrimaryIpAddress
Output ParametersThe response structure of the API has changed.