Queries the details of one or more elastic network interfaces (ENIs).
Description
The DescribeNetworkInterfaces
operation supports paged queries. During a paged query, when you call the DescribeNetworkInterfaces operation to retrieve the first page of results, set MaxResults
to limit the maximum number of entries to return in the call. The return value of NextToken
is a pagination token, which can be used in the next call to retrieve a new page of results. When you call the DescribeNetworkInterfaces operation to retrieve a new page of results, set NextToken
to the NextToken
value returned in the previous call and set MaxResults
to limit the maximum number of entries to return in this call.
MaxResults
or NextToken
, the system uses the preceding paged query method to return results. If you specify neither of MaxResults and NextToken, the system returns paginated results based on the PageNumber
and PageSize
parameters. Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeNetworkInterfaces | The operation that you want to perform. Set the value to DescribeNetworkInterfaces. |
RegionId | String | Yes | cn-hangzhou | The region ID of the ENI. You can call the DescribeRegions operation to query the most recent region list. |
Tag.N.Key | String | No | TestKey | The key of tag N of the ENI. Valid values of N: 1 to 20. |
Tag.N.Value | String | No | TestValue | The value of tag N of the ENI. Valid values of N: 1 to 20. If a single tag is specified to query ENIs, up to 1,000 ENIs that have this tag added can be displayed in the response. If multiple tags are specified to query ENIs, up to 1,000 ENIs that have all these tags added can be displayed in the response. To query more than 1,000 ENIs that have specified tags added, call the ListTagResources operation. |
ResourceGroupId | String | No | rg-bp67acfmxazb4p**** | The ID of the resource group. If this parameter is specified to query ENIs, up to 1,000 ENIs that belong to the specified resource group can be displayed in the response. Note ENIs in the default resource group are displayed in the response regardless of how this parameter is set. |
VSwitchId | String | No | vsw-bp16usj2p27htro3**** | The ID of the vSwitch to which the ENI is connected. |
VpcId | String | No | vpc-bp1j7w3gc1cexjqd**** | The ID of the virtual private cloud (VPC) to which the ENI belongs. |
PrimaryIpAddress | String | No | 192.168.**.** | The primary private IPv4 address of the ENI. |
SecurityGroupId | String | No | sg-bp144yr32sx6ndw**** | The ID of the security group to which the secondary ENI belongs.
|
NetworkInterfaceName | String | No | test-eni-name | The name of the ENI. |
Type | String | No | Secondary | The type of the ENI. Valid values:
This parameter is empty by default, which indicates that both primary and secondary ENIs are queried. |
InstanceId | String | No | i-bp1e2l6djkndyuli**** | The ID of the instance to which the ENI is attached. |
ServiceManaged | Boolean | No | true | Specifies whether the user of the ENI is an Alibaba Cloud service or a distributor. |
Status | String | No | Available | The state of the ENI. Valid values:
This parameter is empty by default, which indicates that ENIs in all states are queried. |
PageNumber | Integer | No | 1 | The number of the page to return. Page start from page 1. Default value: 1. Note This parameter will be removed in the future. We recommend that you use the NextToken and MaxResults parameters for a paged query. |
PageSize | Integer | No | 100 | The number of entries to return on each page. Maximum value: 1,000. Default value: 10. Note This parameter will be removed in the future. We recommend that you use the NextToken and MaxResults parameters for a paged query. |
NextToken | String | No | AAAAAdDWBF2**** | The query token. Set the value to the For more information about how to check the responses returned by this operation, see the preceding "Description" section. |
MaxResults | Integer | No | 50 | The maximum number of entries to return on each page. Valid values: 10 to 500. Default value:
|
PrivateIpAddress.N | String | No | 192.168.**.** | Secondary private IPv4 address N of the ENI. Valid values of N: 1 to 100. |
NetworkInterfaceId.N | String | No | eni-bp125p95hhdhn3ot**** | The ID of ENI N. Valid values of N: 1 to 100. |
Ipv6Address.N | String | No | 2408:4321:180:1701:94c7:bc38:3bfa:**** | IPv6 address N of the ENI. Valid values of N: 1 to 100. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
NextToken | String | AAAAAdDWBF2**** | The query token returned in this call. |
PageSize | Integer | 1 | The number of entries returned per page. Note This parameter will be removed in the future. We recommend that you use the NextToken and MaxResults parameters for a paged query. |
PageNumber | Integer | 1 | The page number of the returned page. Note This parameter will be removed in the future. We recommend that you use the NextToken and MaxResults parameters for a paged query. |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | The ID of the request. |
TotalCount | Integer | 2 | The total number of ENIs returned. Note If you specify the MaxResults and NextToken parameters to perform a paged query, the value of the TotalCount response parameter is invalid. |
NetworkInterfaceSets | Array of NetworkInterfaceSet | Details about the ENIs. | |
NetworkInterfaceSet | |||
CreationTime | String | 2019-12-25T12:31:31Z | The time when the ENI was created. |
VpcId | String | vpc-bp1j7w3gc1cexjqd**** | The ID of the VPC to which the ENI belongs. |
Type | String | Secondary | The type of the ENI. |
Status | String | Available | The state of the ENI. |
NetworkInterfaceTrafficMode | String | Standard | The communication mode of the ENI. Valid values:
|
NetworkInterfaceName | String | my-eni-name | The name of the ENI. |
MacAddress | String | 00:16:3e:12:**:** | The media access control (MAC) address of the ENI. |
QueuePairNumber | Integer | 0 | Note This parameter is in invitational preview and unavailable for general users. |
NetworkInterfaceId | String | eni-bp125p95hhdhn3ot**** | The ID of the ENI. |
ServiceID | Long | 12345678910 | The ID of the distributor to which the ENI belongs. |
InstanceId | String | i-bp1e2l6djkndyuli**** | The ID of the instance to which the ENI is attached. Note If the ENI that is managed and controlled by other Alibaba Cloud services, no instance ID is returned. |
OwnerId | String | 123456**** | The ID of the account to which the ENI belongs. |
ServiceManaged | Boolean | true | Indicates whether the user of the ENI is an Alibaba Cloud service or a distributor. |
VSwitchId | String | vsw-bp16usj2p27htro3**** | The ID of the vSwitch. |
Description | String | DescriptionTest | The description of the ENI. |
ResourceGroupId | String | rg-2ze88m67qx5z**** | The ID of the resource group to which the ENI belongs. |
ZoneId | String | cn-hangzhou-e | The zone ID of the ENI. |
PrivateIpAddress | String | 172.17.**.** | The private IP address of the ENI. |
QueueNumber | Integer | 8 | The number of queues supported by the ENI.
|
PrivateIpSets | Array of PrivateIpSet | Details about the private IP addresses. | |
PrivateIpSet | |||
PrivateIpAddress | String | 172.17.**.** | The private IP address of the instance to which the ENI is attached. |
Primary | Boolean | true | Indicates whether the IP address is the primary private IP address. Valid values:
|
AssociatedPublicIp | Object | Details about the elastic IP address (EIP) associated with the ENI. | |
PublicIpAddress | String | 116.62.**.** | The EIP. |
AllocationId | String | null | Note This parameter is in invitational preview and unavailable for general users. |
Ipv6Sets | Array of Ipv6Set | The IPv6 addresses assigned to the ENI. | |
Ipv6Set | |||
Ipv6Address | String | 2408:4321:180:1701:94c7:bc38:3bfa:**** | The IPv6 address assigned to the ENI. |
Ipv4PrefixSets | Array of Ipv4PrefixSet | Note This parameter is in invitational preview and unavailable for general users. | |
Ipv4PrefixSet | |||
Ipv4Prefix | String | hide | Note This parameter is in invitational preview and unavailable for general users. |
Ipv6PrefixSets | Array of Ipv6PrefixSet | Note This parameter is in invitational preview and unavailable for general users. | |
Ipv6PrefixSet | |||
Ipv6Prefix | String | hide | Note This parameter is in invitational preview and unavailable for general users. |
Tags | Array of Tag | The tags of the ENI. | |
Tag | |||
TagValue | String | TestValue | The tag value of the ENI. |
TagKey | String | TestKey | The tag key of the ENI. |
SecurityGroupIds | Array of String | sg-bp18kz60mefsicfg**** | The IDs of the security groups to which the ENI belongs. |
AssociatedPublicIp | Object | The EIP associated with the secondary private IP address of the ENI. | |
PublicIpAddress | String | 116.62.**.** | The EIP. |
AllocationId | String | null | Note This parameter is in invitational preview and unavailable for general users. |
Attachment | Object | Note This parameter is in invitational preview and unavailable for general users. | |
DeviceIndex | Integer | 0 | Note This parameter is in invitational preview and unavailable for general users. |
InstanceId | String | null | Note This parameter is in invitational preview and unavailable for general users. |
TrunkNetworkInterfaceId | String | null | Note This parameter is in invitational preview and unavailable for general users. |
NetworkCardIndex | Integer | 0 | The index of the physical network interface controller (NIC).
|
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=DescribeNetworkInterfaces
&RegionId=cn-hangzhou
&PrivateIpAddress.1=192.168.**.**
&PrivateIpAddress.2=192.168.**.**
&NextToken=AAAAAdDWBF2****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeNetworkInterfacesResponse>
<TotalCount>2</TotalCount>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
<PageSize>1</PageSize>
<NextToken>AAAAAdDWBF2****</NextToken>
<PageNumber>1</PageNumber>
<NetworkInterfaceSets>
<NetworkInterfaceSet>
<Status>Available</Status>
<NetworkInterfaceTrafficMode>Standard</NetworkInterfaceTrafficMode>
<ServiceManaged>false</ServiceManaged>
<PrivateIpAddress>172.17.**.**</PrivateIpAddress>
<ZoneId>cn-hangzhou-e</ZoneId>
<ResourceGroupId>rg-aek2boynwys****</ResourceGroupId>
<InstanceId>i-wz91t9p4j9xsw2pn****</InstanceId>
<VSwitchId>vsw-bp16usj2p27htro3****</VSwitchId>
<NetworkInterfaceId>eni-bp125p95hhdhn3ot****</NetworkInterfaceId>
<MacAddress>00:16:3e:12:**:**</MacAddress>
<SecurityGroupIds>
<SecurityGroupId>sg-bp18kz60mefsicfg****</SecurityGroupId>
</SecurityGroupIds>
<Type>Secondary</Type>
<Ipv6Sets>
<Ipv6Set>
<Ipv6Address>2408:4321:180:1701:94c7:bc38:3bfa:****</Ipv6Address>
</Ipv6Set>
</Ipv6Sets>
<VpcId>vpc-bp1j7w3gc1cexjqd****</VpcId>
<OwnerId>123456****</OwnerId>
<NetworkInterfaceName>my-eni-name</NetworkInterfaceName>
<AssociatedPublicIp/>
<CreationTime>2019-12-25T12:31:31Z</CreationTime>
<Tags>
<Tag>
<TagKey>TestKey</TagKey>
<TagValue>TestValue</TagValue>
</Tag>
</Tags>
<PrivateIpSets>
<PrivateIpSet>
<PrivateIpAddress>172.17.**.**</PrivateIpAddress>
<AssociatedPublicIp/>
<Primary>true</Primary>
</PrivateIpSet>
</PrivateIpSets>
</NetworkInterfaceSet>
</NetworkInterfaceSets>
</DescribeNetworkInterfacesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalCount" : 2,
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageSize" : 1,
"NextToken" : "AAAAAdDWBF2****",
"PageNumber" : 1,
"NetworkInterfaceSets" : {
"NetworkInterfaceSet" : [ {
"Status" : "Available",
"NetworkInterfaceTrafficMode" : "Standard",
"ServiceManaged" : false,
"PrivateIpAddress" : "172.17.**.**",
"ZoneId" : "cn-hangzhou-e",
"ResourceGroupId" : "rg-aek2boynwys****",
"InstanceId" : "i-wz91t9p4j9xsw2pn****",
"VSwitchId" : "vsw-bp16usj2p27htro3****",
"NetworkInterfaceId" : "eni-bp125p95hhdhn3ot****",
"MacAddress" : "00:16:3e:12:**:**",
"SecurityGroupIds" : {
"SecurityGroupId" : [ "sg-bp18kz60mefsicfg****" ]
},
"Type" : "Secondary",
"Ipv6Sets" : {
"Ipv6Set" : [ {
"Ipv6Address" : "2408:4321:180:1701:94c7:bc38:3bfa:****"
} ]
},
"VpcId" : "vpc-bp1j7w3gc1cexjqd****",
"OwnerId" : "123456****",
"NetworkInterfaceName" : "my-eni-name",
"AssociatedPublicIp" : { },
"CreationTime" : "2019-12-25T12:31:31Z",
"Tags" : {
"Tag" : [ {
"TagKey" : "TestKey",
"TagValue" : "TestValue"
} ]
},
"PrivateIpSets" : {
"PrivateIpSet" : [ {
"PrivateIpAddress" : "172.17.**.**",
"AssociatedPublicIp" : { },
"Primary" : true
} ]
}
} ]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | MissingParameter | %s | The error message returned because a required parameter is not specified. |
400 | UnsupportedParameter | %s | The error message returned because a specified parameter is not supported. |
400 | InvalidParameter | %s | The error message returned because a specified parameter is invalid. |
400 | InvalidInstanceID.Malformed | %s | The error message returned because the specified InstanceId parameter is invalid. |
400 | InvalidOperation.InvalidEcsState | %s | The error message returned because the operation is not supported while the instance is in the current state. |
400 | InvalidOperation.InvalidEniState | %s | The error message returned because the operation is not supported while the ENI is in the current state. |
400 | InvalidOperation.DetachPrimaryEniNotAllowed | %s | The error message returned because the primary ENI cannot be detached from the instance. |
400 | Forbidden.RegionId | %s | The error message returned because the service is unavailable in the current region. |
400 | InvalidRegionId.MalFormed | The specified parameter RegionId is not valid. | The error message returned because the specified RegionId parameter is invalid. |
403 | InvalidUserType.NotSupported | %s | The error message returned because your account does not support the operation. |
403 | Abs.InvalidAccount.NotFound | %s | The error message returned because your Alibaba Cloud account does not exist or because your AccessKey pair has expired. |
403 | Forbidden.NotSupportRAM | %s | The error message returned because Resource Access Management (RAM) users are not authorized to perform this operation. |
403 | Forbidden.SubUser | %s | The error message returned because you are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization. |
403 | MaxEniCountExceeded | %s | The error message returned because the maximum number of ENIs that can be managed has been reached. |
403 | EniPerInstanceLimitExceeded | %s | The error message returned because the maximum number of ENIs that can be attached to the specified instance has been reached. |
403 | InvalidOperation.AvailabilityZoneMismatch | %s | The error message returned because the operation is invalid. |
403 | InvalidOperation.VpcMismatch | %s | The error message returned because the operation is invalid. Check whether the VPC in the operation corresponds to other parameters. |
403 | SecurityGroupInstanceLimitExceed | %s | The error message returned because the maximum number of instances in the security group has been reached. |
403 | InvalidSecurityGroupId.NotVpc | %s | The error message returned because the specified SecurityGroupId parameter is invalid and the network type of the security group is not VPC. |
403 | InvalidOperation.InvalidEniType | %s | The error message returned because the operation is not supported while the ENI is of the current type. |
403 | InvalidVpc.Empty | %s | The error message returned because no vSwitches exist in the specified VPC. For more information, see the return value of the %s placeholder in the error message. |
404 | InvalidEcsId.NotFound | %s | The error message returned because the specified instance ID does not exist. |
404 | InvalidEniId.NotFound | %s | The error message returned because the specified ENI ID does not exist. |
404 | InvalidVSwitchId.NotFound | %s | The error message returned because the specified vSwitch does not exist. |
404 | InvalidSecurityGroupId.NotFound | %s | The error message returned because the specified security group ID does not exist. |
For a list of error codes, see Service error codes.