Queries the details of one or more Elastic Network Interface (ENI) resources.
Operation description
Operation description
The DescribeNetworkInterfaces operation supports pagination by specifying the MaxResults or NextToken parameter. Usage notes:
-
When paged query the first page, you only need to specify
MaxResultsto limit the number of entries to return. TheNextTokenvalue in the response can be used as the token to query the next page. -
When paged query subsequent pages, set the
NextTokenparameter to theNextTokenvalue returned from the previous request, and specifyMaxResultsto limit the number of entries to return.
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 the DescribeRegions operation 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 Elastic Network Interface (ENI). Valid values of N: 1 to 20. |
TestKey |
| Value |
string |
No |
The tag value of the Elastic Network Interface (ENI). Valid values of N: 1 to 20. If you use a single tag to filter resources, the number of resources that match the tag cannot exceed 1,000. If you use multiple tags to filter resources, the number of resources that are attached with multiple tags cannot exceed 1,000. If the number of resources exceeds 1,000, call the ListTagResources operation to query the resources. |
TestValue |
| ResourceGroupId |
string |
No |
The resource group ID. When you use this parameter to filter resources, the number of resources cannot exceed 1,000. Note
Filtering by the default resource group is not supported. |
rg-bp67acfmxazb4p**** |
| VSwitchId |
string |
No |
The vSwitch ID of the Elastic Network Interface (ENI). |
vsw-bp16usj2p27htro3**** |
| VpcId |
string |
No |
The VPC ID of the Elastic Network Interface (ENI). |
vpc-bp1j7w3gc1cexjqd**** |
| PrimaryIpAddress |
string |
No |
The primary private network IPv4 address of the Elastic Network Interface (ENI). |
192.168.**.** |
| SecurityGroupId |
string |
No |
The security group ID of the secondary ENI.
|
sg-bp144yr32sx6ndw**** |
| NetworkInterfaceName |
string |
No |
The name of the Elastic Network Interface (ENI). The name must be 2 to 128 characters in length, and can contain characters in the letter categorization of Unicode (including English, Chinese, and digits). It can also contain colons (:), underscores (_), periods (.), and hyphens (-). |
test-eni-name |
| Type |
string |
No |
The Elastic Network Interface (ENI) type. Valid values:
Default value: empty, which indicates that Elastic Network Interfaces (ENIs) of all types are queried. |
Secondary |
| InstanceId |
string |
No |
The instance ID to which the Elastic Network Interface (ENI) is currently attached. |
i-bp1e2l6djkndyuli**** |
| ServiceManaged |
boolean |
No |
Specifies whether the Elastic Network Interface (ENI) is used by an Alibaba Cloud service or a Virtual Network Operator (VNO). |
true |
| Status |
string |
No |
The status of the Elastic Network Interface (ENI). Valid values:
Default value: empty, which indicates that Elastic Network Interfaces (ENIs) in all states are queried. |
Available |
PageNumber
deprecated
|
integer |
No |
Note
[Deprecated] We recommend that you use the |
1 |
PageSize
deprecated
|
integer |
No |
Note
[Deprecated] We recommend that you use the |
100 |
| NextToken |
string |
No |
The pagination token. Set the value to the For more information about how to configure the pagination parameters, see the "Operation description" section. |
AAAAAdDWBF2**** |
| MaxResults |
integer |
No |
The maximum number of entries per page for a paging query. Valid values: 10 to 500. Default value:
|
50 |
| PrivateIpAddress |
array |
No |
The secondary private IP IPv4 address of the Elastic Network Interface (ENI). Valid values of N: 1 to 100. |
192.168.**.** |
|
string |
No |
The secondary private IP IPv4 address of the Elastic Network Interface (ENI). Valid values of N: 1 to 100. |
192.168.**.** |
|
| NetworkInterfaceId |
array |
No |
The Elastic Network Interface (ENI) ID. Valid values of N: 1 to 100. |
eni-bp125p95hhdhn3ot**** |
|
string |
No |
The Elastic Network Interface (ENI) ID. Valid values of N: 1 to 100. |
eni-bp125p95hhdhn3ot**** |
|
| Ipv6Address |
array |
No |
The IPv6 address of the Elastic Network Interface (ENI). N indicates that multiple IPv6 addresses can be configured. Valid values of N: 1 to 100. |
2408:4321:180:1701:94c7:bc38:3bfa:**** |
|
string |
No |
The IPv6 address of the Elastic Network Interface (ENI). N indicates that multiple IPv6 addresses can be configured. 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 by the current call. |
AAAAAdDWBF2**** |
| PageSize |
integer |
The paging query parameter. Note
This parameter will soon be deprecated. We recommend that you use the |
1 |
| PageNumber |
integer |
The paging query parameter. Note
This parameter will soon be deprecated. We recommend that you use the |
1 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| TotalCount |
integer |
The total number of Elastic Network Interface (ENI) resources returned. Note
When you use the |
2 |
| NetworkInterfaceSets |
object |
||
| NetworkInterfaceSet |
array<object> |
The collection of Elastic Network Interface (ENI) information. |
|
|
array<object> |
|||
| CreationTime |
string |
The creation time. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format in accordance with the ISO 8601 standard in UTC. |
2019-12-25T12:31:31Z |
| VpcId |
string |
The VPC ID of the Elastic Network Interface (ENI). |
vpc-bp1j7w3gc1cexjqd**** |
| Type |
string |
The Elastic Network Interface (ENI) type. Valid values:
|
Secondary |
| Status |
string |
The status of the Elastic Network Interface (ENI). Valid values:
|
Available |
| NetworkInterfaceTrafficMode |
string |
The communication mode of the Elastic Network Interface (ENI). Valid values:
Note
The HighPerformance value is supported only by the c7re RDMA-enhanced instance family, and currently this value can only be set in Zone K of the China (Beijing) region. |
Standard |
| NetworkInterfaceName |
string |
The name of the Elastic Network Interface (ENI). |
my-eni-name |
| MacAddress |
string |
The MAC address of the Elastic Network Interface (ENI). |
00:16:3e:12:**:** |
| QueuePairNumber |
integer |
Note
This parameter is in invitational preview and is not available for public use. |
0 |
| NetworkInterfaceId |
string |
The Elastic Network Interface (ENI) ID. |
eni-bp125p95hhdhn3ot**** |
| ServiceID |
integer |
The VNO ID of the Elastic Network Interface (ENI). |
12345678910 |
| InstanceId |
string |
The instance ID to which the Elastic Network Interface (ENI) is attached. Note
The instance ID is not returned for an Elastic Network Interface (ENI) that is managed and controlled by other Alibaba Cloud services. |
i-bp1e2l6djkndyuli**** |
| OwnerId |
string |
The ID of the Alibaba Cloud account to which the Elastic Network Interface (ENI) belongs. |
123456**** |
| ServiceManaged |
boolean |
Specifies whether the Elastic Network Interface (ENI) is used by 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 Elastic Network Interface (ENI). |
172.17.**.** |
| QueueNumber |
integer |
The number of queues for the Elastic Network Interface (ENI).
|
8 |
| PrivateIpSets |
object |
||
| PrivateIpSet |
array<object> |
The PrivateIpSet collection. |
|
|
array<object> |
|||
| PrivateIpAddress |
string |
The private IP address of the instance. |
172.17.**.** |
| Primary |
boolean |
Specifies whether the private IP address is the primary private IP address. Valid values:
|
true |
| AssociatedPublicIp |
object |
The Elastic IP Address (EIP) associated with the Elastic Network Interface (ENI). |
|
| PublicIpAddress |
string |
The EIP. |
116.62.**.** |
| AllocationId |
string |
Note
This parameter is in invitational preview and is not available for public use. |
null |
| PrivateDnsName |
string |
The private domain name of the instance. Note
A private domain name in a fixed format is returned only when the |
DnsTestName |
| Ipv6Sets |
object |
||
| Ipv6Set |
array<object> |
The collection of IPv6 addresses allocated to the Elastic Network Interface (ENI). |
|
|
object |
|||
| Ipv6Address |
string |
The IPv6 address allocated to the Elastic Network Interface (ENI). |
2408:4321:180:1701:94c7:bc38:3bfa:**** |
| Primary |
boolean |
||
| Ipv4PrefixSets |
object |
||
| Ipv4PrefixSet |
array<object> |
The collection of IPv4 prefixes allocated to the Elastic Network Interface (ENI). |
|
|
object |
|||
| Ipv4Prefix |
string |
The IPv4 prefix allocated to the Elastic Network Interface (ENI). |
192.168.**.0/28 |
| Ipv6PrefixSets |
object |
||
| Ipv6PrefixSet |
array<object> |
The collection of IPv6 prefixes allocated to the Elastic Network Interface (ENI). |
|
|
object |
|||
| Ipv6Prefix |
string |
The IPv6 prefix allocated to the Elastic Network Interface (ENI). |
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 collection of security groups to which the ENI belongs. |
|
|
string |
The security group ID. |
sg-bp18kz60mefsicfg**** |
|
| AssociatedPublicIp |
object |
The Elastic IP Address (EIP) associated with the secondary private IP address of the Elastic Network Interface (ENI). |
|
| PublicIpAddress |
string |
The EIP. |
116.62.**.** |
| AllocationId |
string |
Note
This parameter is in invitational preview and is not available for public use. |
null |
| Attachment |
object |
Note
This parameter is in invitational preview and is not available for public use. |
|
| DeviceIndex |
integer |
Note
This parameter is in invitational preview and is not available for public use. |
0 |
| InstanceId |
string |
Note
This parameter is in invitational preview and is not available for public use. |
null |
| TrunkNetworkInterfaceId |
string |
Note
This parameter is in invitational preview and is not available for public use. |
null |
| NetworkCardIndex |
integer |
The index of the physical network card to which the ENI is attached.
|
0 |
| DeleteOnRelease |
boolean |
Specifies whether to retain the ENI when the instance is released. Valid values:
|
true |
| SourceDestCheck |
boolean |
Specifies whether to enable source/destination checking. We recommend that you enable this feature to improve network security. Valid values:
Default value: false. Note
Before using this parameter, carefully 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 | This operation is not allowed due to the current status of the cloud service. |
| 400 | InvalidOperation.InvalidEniState | %s | The current status of the ENI does not support this operation. |
| 400 | InvalidOperation.DetachPrimaryEniNotAllowed | %s | You cannot detach the primary ENI from an instance. |
| 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 maximum number of instances in the security group has been reached. |
| 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 | This operation is not allowed for the current network interface type. |
| 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.