All Products
Search
Document Center

ENS:DescribeNetworkInterfaces

Last Updated:Jul 26, 2024

Queries Elastic Network Interfaces (ENIs).

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
ens:DescribeNetworkInterfaceslist
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NetworkInterfaceIdstringNo

The ID of the ENI.

eni-58z57orgmt6d1****
InstanceIdstringNo

The ID of the instance.

i-5t7z99n32gplriv
NetworkIdstringNo

The ID of the network.

n-2zeuphj08tt7q3brd****
VSwitchIdstringNo

The ID of the vSwitch.

vsw-12345
EnsRegionIdstringNo

The region ID of the instance.

cn-tianjin-cmcc
SecurityGroupIdstringNo

The ID of the security group to which the secondary ENI belongs. To query the details of secondary ENIs based on the ID of a security group, specify this parameter.

sg-5p1fg655nh68xyz9i***
PrimaryIpAddressstringNo

The primary IP address of the ENI.

***
TypestringNo

The type of the ENI. Valid values:

  • Primary
  • Secondary

This parameter is empty by default, which indicates that both primary and secondary ENIs are queried.

Secondary
NetworkInterfaceNamestringNo

The name of the ENI.

test-01
StatusstringNo

The status of the ENI. Valid values:

  • Available: The ENI is available.
  • Attaching: The ENI is being attached to an instance.
  • InUse: The ENI is attached to an instance.
  • Detaching: The ENI is being detached from an instance.
  • Deleting: The ENI is being deleted.

This parameter is empty by default, which indicates that ENIs in all states are queried.

Available
PageNumberstringNo

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

1
PageSizestringNo

The number of entries to return on each page. Maximum value: 100. Default value: 10.

50

Response parameters

ParameterTypeDescriptionExample
object

Details about the ENIs.

NetworkInterfaceSetsarray<object>

Details about the ENIs.

object
CreationTimestring

The time when the ENI was created. Specify the time in the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format. The time is displayed in UTC.

2022-02-22T03:53:25Z
EnsRegionIdstring

The ID of the edge node.

id-jakarta-1
InstanceIdstring

The ID of the instance to which the ENI is bound.

i-5siavnr3
MacAddressstring

The MAC address of the ENI.

00:16:3e:08:60:0a
NetworkInterfaceIdstring

The ID of the ENI.

eni-uf686a5
PrimaryIpstring

The private IP address of the server.

12.23.3.4
PrimaryIpTypestring

The primary private IP address. Valid values:

  • Public: public IP address.
  • Private: internal IP address.
private
Statusstring

The status of the ENI. Valid values:

  • Available: The ENI is available.
  • Attaching: The ENI is being attached to an instance.
  • InUse: The ENI is attached to an instance.
  • Detaching: The ENI is being detached from an instance.
  • Deleting: The ENI is being deleted.
In_use
NetworkIdstring

The ID of the network.

n-5w0qd03adw****
VSwitchIdstring

The ID of the vSwitch.

vsw-5rqswx1trlsj9
PrivateIpSetsarray<object>

Details about the private IP address.

object
PrivateIpAddressstring

The private IP address.

192.168.0.130
Primaryboolean

Specifies whether the private IP address is the primary private IP address. Valid values:

  • true
  • false
true
NetworkInterfaceNamestring

The ENI name.

primaryTest
Descriptionstring

The description of ENI.

test-description
SecurityGroupIdsarray

The ID of the security group.

string

The ID of the security group.

sg-5p1bozeiw711a1***
Typestring

The type of the ENI. Valid values:

  • Primary
  • Secondary
Primary
PageNumberinteger

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

1
PageSizeinteger

The number of entries returned per page. Maximum value: 50. Default value: 10.

50
TotalCountinteger

The total number of entries in the list.

49
RequestIdstring

The request ID.

708AF9CE-FF92-5DF9-93F8-B7754AB1061A

Examples

Sample success responses

JSONformat

{
  "NetworkInterfaceSets": {
    "NetworkInterfaceSet": [
      {
        "CreationTime": "2022-02-22T03:53:25Z",
        "EnsRegionId": "id-jakarta-1",
        "InstanceId": "i-5siavnr3",
        "MacAddress": "00:16:3e:08:60:0a",
        "NetworkInterfaceId": "eni-uf686a5",
        "PrimaryIp": "12.23.3.4",
        "PrimaryIpType": "private",
        "Status": "In_use",
        "NetworkId": "n-5w0qd03adw****",
        "VSwitchId": "vsw-5rqswx1trlsj9",
        "PrivateIpSets": {
          "PrivateIpSet": [
            {
              "PrivateIpAddress": "192.168.0.130",
              "Primary": true
            }
          ]
        },
        "NetworkInterfaceName": "primaryTest",
        "Description": "test-description",
        "SecurityGroupIds": {
          "SecurityGroup": [
            "sg-5p1bozeiw711a1***"
          ]
        },
        "Type": "Primary"
      }
    ]
  },
  "PageNumber": 1,
  "PageSize": 50,
  "TotalCount": 49,
  "RequestId": "708AF9CE-FF92-5DF9-93F8-B7754AB1061A"
}

Error codes

HTTP status codeError codeError message
400ens.interface.errorAn error occurred while calling the API.
400Missing%sYou must specify the parameter %s.
400Invalid%sThe specified parameter %s is invalid.
400NoPermissionPermission denied.
400InvalidParameter.%sThe specified field %s invalid. Please check it again.

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

Change history

Change timeSummary of changesOperation
2023-10-19The Error code has changedView Change Details
2023-09-21The API operation is not deprecated.. The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details