Queries the details of one or more Elastic Network Interfaces (ENIs).
Operation description
Operation description
The DescribeNetworkInterfaces operation supports pagination by specifying the MaxResults or NextToken parameter. Usage notes:
-
When paged query the first page, set only
MaxResultsto limit the number of entries returned. TheNextTokenvalue in the response is used as the credential to query subsequent pages. -
When paged query subsequent pages, set
NextTokento theNextTokenvalue obtained from the previous response, and setMaxResultsto limit the number of entries returned.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeNetworkInterfaces |
get |
NetworkInterface
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| Tag |
array<object> |
No |
The tags. |
|
|
object |
No |
|||
| Key |
string |
No |
The tag key of the network interface controller (NIC). Valid values of N: 1 to 20. |
TestKey |
| Value |
string |
No |
The tag value of the network interface controller (NIC). Valid values of N: 1 to 20. If you use a single tag to filter resources, the resource count with the specified tag cannot exceed 1,000. If you use multiple tags to filter resources, the resource count of resources that are attached to all specified tags cannot exceed 1,000. If the resource count exceeds 1,000, call the ListTagResources operation to query the resources. |
TestValue |
| ResourceGroupId |
string |
No |
The resource group ID. If you use this parameter to filter resources, the resource count cannot exceed 1,000. Note
Filtering by the default resource group is not supported. |
rg-bp67acfmxazb4p**** |
| VSwitchId |
string |
No |
The vSwitch ID of the network interface controller (NIC). |
vsw-bp16usj2p27htro3**** |
| VpcId |
string |
No |
The virtual private cloud (VPC) ID of the network interface controller (NIC). |
vpc-bp1j7w3gc1cexjqd**** |
| PrimaryIpAddress |
string |
No |
The primary private IP address of the network interface controller (NIC). |
192.168.**.** |
| SecurityGroupId |
string |
No |
The security group ID of the secondary ENI.
|
sg-bp144yr32sx6ndw**** |
| NetworkInterfaceName |
string |
No |
The name of the network interface controller (NIC). The name must be 2 to 128 characters in length and can contain characters from the Unicode letter categorization (which includes English letters, Chinese characters, and digits). The name can contain colons (:), underscores (_), periods (.), or hyphens (-). |
test-eni-name |
| Type |
string |
No |
The type of the Elastic Network Interface (ENI). Valid values:
Default value: null, which indicates that all types are queried. |
Secondary |
| InstanceId |
string |
No |
The instance ID of the instance to which the network interface controller (NIC) is attached. |
i-bp1e2l6djkndyuli**** |
| ServiceManaged |
boolean |
No |
Indicates whether the user of the network interface controller (NIC) is an Alibaba Cloud service or a Virtual Network Operator (VNO). |
true |
| Status |
string |
No |
The status of the network interface controller (NIC). Valid values:
Default value: null, which indicates that all statuses are queried. |
Available |
PageNumber
deprecated
|
integer |
No |
Note
This parameter is deprecated. Use the MaxResults and NextToken parameters for pagination. |
1 |
PageSize
deprecated
|
integer |
No |
Note
This parameter is deprecated. Use the MaxResults and NextToken parameters for pagination. |
100 |
| NextToken |
string |
No |
The pagination token. Set this parameter to the For information about how to view the returned data, refer to the operation description above. |
AAAAAdDWBF2**** |
| MaxResults |
integer |
No |
The maximum number of entries per page for paging. Valid values: 10 to 500. Default value:
|
50 |
| PrivateIpAddress |
array |
No |
The secondary private IP address of the network interface controller (NIC). Valid values of N: 1 to 100. |
192.168.**.** |
|
string |
No |
The secondary private IP address of the network interface controller (NIC). Valid values of N: 1 to 100. |
192.168.**.** |
|
| NetworkInterfaceId |
array |
No |
The network interface controller (NIC) ID. Valid values of N: 1 to 100. |
eni-bp125p95hhdhn3ot**** |
|
string |
No |
The network interface controller (NIC) ID. Valid values of N: 1 to 100. |
eni-bp125p95hhdhn3ot**** |
|
| Ipv6Address |
array |
No |
The IPv6 address of the network interface controller (NIC). N indicates that you can specify multiple IPv6 addresses. Valid values of N: 1 to 100. |
2408:4321:180:1701:94c7:bc38:3bfa:**** |
|
string |
No |
The IPv6 address of the network interface controller (NIC). N indicates that you can specify multiple IPv6 addresses. Valid values of N: 1 to 100. |
2408:4321:180:1701:94c7:bc38:3bfa:**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| NextToken |
string |
The pagination token returned in this call. |
AAAAAdDWBF2**** |
| PageSize |
integer |
The paging parameter. Note
This parameter is being deprecated. Use NextToken and MaxResults for paging. |
1 |
| PageNumber |
integer |
The paging parameter. Note
This parameter is being deprecated. Use NextToken and MaxResults for paging. |
1 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| TotalCount |
integer |
The total number of Elastic Network Interfaces (ENIs) returned. Note
When you use the |
2 |
| NetworkInterfaceSets |
object |
||
| NetworkInterfaceSet |
array<object> |
The collection of network interface controller (NIC) information. |
|
|
array<object> |
|||
| CreationTime |
string |
The creation time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC+0. |
2019-12-25T12:31:31Z |
| VpcId |
string |
The virtual private cloud (VPC) ID of the network interface controller (NIC). |
vpc-bp1j7w3gc1cexjqd**** |
| Type |
string |
The type of the Elastic Network Interface (ENI). Valid values:
|
Secondary |
| Status |
string |
The status of the network interface controller (NIC). Valid values:
|
Available |
| NetworkInterfaceTrafficMode |
string |
The communication mode of the network interface controller (NIC). Valid values:
Note
The HighPerformance value is supported only by the c7re RDMA enhanced instance family. Currently, this value can be specified only in Zone K of the China (Beijing) region. |
Standard |
| NetworkInterfaceName |
string |
The name of the network interface controller (NIC). |
my-eni-name |
| MacAddress |
string |
The MAC address of the network interface controller (NIC). |
00:16:3e:12:**:** |
| QueuePairNumber |
integer |
Note
This parameter is in invitational preview and is not publicly available. |
0 |
| NetworkInterfaceId |
string |
The network interface controller (NIC) ID. |
eni-bp125p95hhdhn3ot**** |
| ServiceID |
integer |
The ID of the Virtual Network Operator (VNO) to which the network interface controller (NIC) belongs. |
12345678910 |
| InstanceId |
string |
The ID of the instance to which the network interface controller (NIC) is attached. Note
Network interface controllers (NICs) that are managed and controlled by other Alibaba Cloud services do not return an instance ID. |
i-bp1e2l6djkndyuli**** |
| OwnerId |
string |
The ID of the account that owns the network interface controller (NIC). |
123456**** |
| ServiceManaged |
boolean |
Indicates whether the user of the network interface controller (NIC) is an Alibaba Cloud service or a Virtual Network Operator (VNO). |
true |
| VSwitchId |
string |
The vSwitch ID of the VPC. |
vsw-bp16usj2p27htro3**** |
| Description |
string |
The description. |
DescriptionTest |
| ResourceGroupId |
string |
The resource group ID. |
rg-2ze88m67qx5z**** |
| ZoneId |
string |
The zone ID. |
cn-hangzhou-e |
| PrivateIpAddress |
string |
The private IP address of the network interface controller (NIC). |
172.17.**.** |
| QueueNumber |
integer |
The number of queues for the Elastic Network Interface (ENI).
|
8 |
| PrivateIpSets |
object |
||
| PrivateIpSet |
array<object> |
The collection of PrivateIpSet objects. |
|
|
array<object> |
|||
| PrivateIpAddress |
string |
The private IP address of the instance. |
172.17.**.** |
| Primary |
boolean |
Indicates whether the IP address is the primary private IP address. Valid values:
|
true |
| AssociatedPublicIp |
object |
The Elastic IP Address (EIP) associated with the network interface controller (NIC). |
|
| PublicIpAddress |
string |
The EIP address. |
116.62.**.** |
| AllocationId |
string |
Note
This parameter is in invitational preview and is not publicly available. |
null |
| PrivateDnsName |
string |
The private domain name of the instance. Note
This value is returned only when the hostname type |
DnsTestName |
| Ipv6Sets |
object |
||
| Ipv6Set |
array<object> |
The IPv6 addresses allocated to the network interface controller (NIC). |
|
|
object |
|||
| Ipv6Address |
string |
The IPv6 address allocated to the network interface controller (NIC). |
2408:4321:180:1701:94c7:bc38:3bfa:**** |
| Primary |
boolean |
||
| Ipv4PrefixSets |
object |
||
| Ipv4PrefixSet |
array<object> |
The IPv4 prefixes allocated to the network interface controller (NIC). |
|
|
object |
|||
| Ipv4Prefix |
string |
The IPv4 prefix allocated to the network interface controller (NIC). |
192.168.**.0/28 |
| Ipv6PrefixSets |
object |
||
| Ipv6PrefixSet |
array<object> |
The IPv6 prefixes allocated to the network interface controller (NIC). |
|
|
object |
|||
| Ipv6Prefix |
string |
The IPv6 prefix allocated to the network interface controller (NIC). |
2001:db8:1234:1a00:****::/80 |
| Tags |
object |
||
| Tag |
array<object> |
The tags. |
|
|
object |
|||
| TagValue |
string |
The tag value. |
TestValue |
| TagKey |
string |
The tag key. |
TestKey |
| SecurityGroupIds |
object |
||
| SecurityGroupId |
array |
The security groups to which the ENI belongs. |
|
|
string |
The security group ID. |
sg-bp18kz60mefsicfg**** |
|
| AssociatedPublicIp |
object |
The EIP associated with the secondary private IP address of the network interface controller (NIC). |
|
| PublicIpAddress |
string |
The EIP address. |
116.62.**.** |
| AllocationId |
string |
Note
This parameter is in invitational preview and is not publicly available. |
null |
| Attachment |
object |
Note
This parameter is in invitational preview and is not publicly available. |
|
| DeviceIndex |
integer |
Note
This parameter is in invitational preview and is not publicly available. |
0 |
| InstanceId |
string |
Note
This parameter is in invitational preview and is not publicly available. |
null |
| TrunkNetworkInterfaceId |
string |
Note
This parameter is in invitational preview and is not publicly available. |
null |
| NetworkCardIndex |
integer |
The index of the network card to which the ENI is attached.
|
0 |
| DeleteOnRelease |
boolean |
Indicates whether the ENI is retained when the associated instance is released. Valid values:
|
true |
| SourceDestCheck |
boolean |
Indicates whether source/destination checking is enabled. We recommend that you enable this feature to improve network security. Valid values:
Default value: false. Note
Before using this parameter, read Source/destination checking. |
false |
Examples
Success response
JSON format
{
"NextToken": "AAAAAdDWBF2****",
"PageSize": 1,
"PageNumber": 1,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"TotalCount": 2,
"NetworkInterfaceSets": {
"NetworkInterfaceSet": [
{
"CreationTime": "2019-12-25T12:31:31Z",
"VpcId": "vpc-bp1j7w3gc1cexjqd****",
"Type": "Secondary",
"Status": "Available",
"NetworkInterfaceTrafficMode": "Standard",
"NetworkInterfaceName": "my-eni-name",
"MacAddress": "00:16:3e:12:**:**",
"QueuePairNumber": 0,
"NetworkInterfaceId": "eni-bp125p95hhdhn3ot****",
"ServiceID": 12345678910,
"InstanceId": "i-bp1e2l6djkndyuli****",
"OwnerId": "123456****",
"ServiceManaged": true,
"VSwitchId": "vsw-bp16usj2p27htro3****",
"Description": "DescriptionTest",
"ResourceGroupId": "rg-2ze88m67qx5z****",
"ZoneId": "cn-hangzhou-e",
"PrivateIpAddress": "172.17.**.**",
"QueueNumber": 8,
"PrivateIpSets": {
"PrivateIpSet": [
{
"PrivateIpAddress": "172.17.**.**",
"Primary": true,
"AssociatedPublicIp": {
"PublicIpAddress": "116.62.**.**",
"AllocationId": "null"
},
"PrivateDnsName": "DnsTestName"
}
]
},
"Ipv6Sets": {
"Ipv6Set": [
{
"Ipv6Address": "2408:4321:180:1701:94c7:bc38:3bfa:****",
"Primary": false
}
]
},
"Ipv4PrefixSets": {
"Ipv4PrefixSet": [
{
"Ipv4Prefix": "192.168.**.0/28"
}
]
},
"Ipv6PrefixSets": {
"Ipv6PrefixSet": [
{
"Ipv6Prefix": "2001:db8:1234:1a00:****::/80"
}
]
},
"Tags": {
"Tag": [
{
"TagValue": "TestValue",
"TagKey": "TestKey"
}
]
},
"SecurityGroupIds": {
"SecurityGroupId": [
"sg-bp18kz60mefsicfg****"
]
},
"AssociatedPublicIp": {
"PublicIpAddress": "116.62.**.**",
"AllocationId": "null"
},
"Attachment": {
"DeviceIndex": 0,
"InstanceId": "null",
"TrunkNetworkInterfaceId": "null",
"NetworkCardIndex": 0
},
"DeleteOnRelease": true,
"SourceDestCheck": false
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParameter | %s | A parameter is not specified. |
| 400 | UnsupportedParameter | %s | The parameter is not supported. |
| 400 | InvalidParameter | %s | The specified parameter is invalid. |
| 400 | InvalidInstanceID.Malformed | %s | The specified InstanceId parameter is invalid. |
| 400 | InvalidOperation.InvalidEcsState | %s | The current status of the instance does not support this operation. |
| 400 | InvalidOperation.InvalidEniState | %s | The current status of the ENI does not allow modifying the ENI attributes. |
| 400 | InvalidOperation.DetachPrimaryEniNotAllowed | %s | Detaching the primary ENI from an instance is not allowed. |
| 400 | Forbidden.RegionId | %s | The service is unavailable in the current region. |
| 400 | InvalidRegionId.MalFormed | The specified parameter RegionId is not valid. | The specified RegionId parameter is invalid. |
| 403 | InvalidUserType.NotSupported | %s | Your account does not support this operation. |
| 403 | Abs.InvalidAccount.NotFound | %s | Your Alibaba Cloud account does not exist or your AccessKey pair has expired. |
| 403 | Forbidden.NotSupportRAM | %s | RAM users are not authorized to perform this operation. |
| 403 | Forbidden.SubUser | %s | You are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization. |
| 403 | InvalidParameter | %s | |
| 403 | MaxEniCountExceeded | %s | The maximum number of ENIs that can be managed has been reached. |
| 403 | EniPerInstanceLimitExceeded | %s | The maximum number of ENIs that can be attached to the specified instance has been reached. |
| 403 | InvalidOperation.AvailabilityZoneMismatch | %s | The operation is invalid. |
| 403 | InvalidOperation.VpcMismatch | %s | The operation is invalid. Check whether the VPC in the operation corresponds to other parameters. |
| 403 | SecurityGroupInstanceLimitExceed | %s | The number of instances in the security group has reached the maximum limit. |
| 403 | InvalidSecurityGroupId.NotVpc | %s | The specified SecurityGroupId parameter is invalid and the network type of the security group is not VPC. |
| 403 | InvalidOperation.InvalidEniType | %s | The current type of the Elastic Network Interface (ENI) does not support this operation. |
| 403 | InvalidVpc.Empty | %s | No vSwitches exist in the specified VPC. For more information, see the return value of the %s placeholder in the error message. |
| 403 | Forbidden.RegionId | %s | |
| 403 | InvalidOperation.InvalidEniPageNumber | %s | |
| 403 | InvalidVpc.Indeterminacy | %s | |
| 404 | InvalidEcsId.NotFound | %s | The specified instance ID does not exist. |
| 404 | InvalidEniId.NotFound | %s | |
| 404 | InvalidVSwitchId.NotFound | %s | The specified vSwitch does not exist. |
| 404 | InvalidSecurityGroupId.NotFound | %s | The specified security group ID does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.