All Products
Search
Document Center

ENS:DescribeNetworkInterfaces

Last Updated:Mar 12, 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

There is currently no authorization information disclosed in the API.

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.

NetworkInterfaceSetsobject []

Details about the ENIs.

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
PrivateIpSetsobject []

Details about the private IP address.

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 changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
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 changedsee changesets
Change itemChange content
API Deprecation DescriptionThe API operation is not deprecated..
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: NetworkInterfaceId
    Added Input Parameters: NetworkId
    Added Input Parameters: SecurityGroupId
    Added Input Parameters: Type
    Added Input Parameters: NetworkInterfaceName
    Added Input Parameters: Status
Output ParametersThe response structure of the API has changed.