DescribeNetworkInterfaces

Last updated: 2020-04-07 08:16:41

PDF

1. API Description

Domain name for API request: vpc.tencentcloudapi.com.

This API (DescribeNetworkInterfaces) is used to query the ENI list.

A maximum of 100 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: vpc.ap-shanghai-fsi.tencentcloudapi.com

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: DescribeNetworkInterfaces.
Version Yes String Common parameter. The value used for this API: 2017-03-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
NetworkInterfaceIds.N No Array of String Queries the ID of the ENI instance, such as eni-pxir56ns. Each request can have a maximum of 100 instances. NetworkInterfaceIds and Filters cannot be specified at the same time.
Filters.N No Array of Filter Filter condition. NetworkInterfaceIds and Filters cannot be specified at the same time.
  • vpc-id - String - (Filter condition) VPC instance ID, such as vpc-f49l6u0z.
  • subnet-id - String - (Filter condition) Subnet instance ID, such as subnet-f49l6u0z.
  • network-interface-id - String - (Filter condition) ENI instance ID, such as eni-5k56k7k7.
  • attachment.instance-id - String - (Filter condition) CVM instance ID, such as ins-3nqpdn3i.
  • groups.security-group-id - String - (Filter condition) Instance ID of the security group, such as sg-f9ekbxeq.
  • network-interface-name - String - (Filter condition) ENI instance name.
  • network-interface-description - String - (Filter condition) ENI instance description.
  • address-ip - String - (Filter condition) Private IPv4 address.
  • Offset No Integer Offset. The default value is 0.
    Limit No Integer Number of values to be returned. The default value is 20. Maximum is 100.

    3. Output Parameters

    Parameter Name Type Description
    NetworkInterfaceSet Array of NetworkInterface List of instance details.
    TotalCount Integer The number of instances meeting the filter condition.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Query the list of elastic NICs

    Input Example

    https://vpc.tencentcloudapi.com/?Action=DescribeNetworkInterfaces
    &Version=2017-03-12
    &<common request parameters>

    Output Example

    {
      "Response": {
        "NetworkInterfaceSet": [
          {
            "VpcId": "vpc-mrzkofih",
            "SubnetId": "subnet-nao8lfro",
            "NetworkInterfaceId": "eni-f1xjkw1b",
            "NetworkInterfaceName": "royhyangtest-main",
            "NetworkInterfaceDescription": "",
            "GroupSet": [
              "sg-c2r7lnxh",
              "sg-f9ekbxeq"
            ],
            "Primary": false,
            "MacAddress": "20: 90: 6F: F3: 3D: BD",
            "State": "AVAILABLE",
            "CreatedTime": "2017-11-16 19:56:00",
            "PrivateIpAddressSet": [
              {
                "Description": "",
                "Primary": true,
                "PrivateIpAddress": "192.168.0.13",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.0.15",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.0.17",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.0.24",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              }
            ],
            "Attachment": {},
            "Zone": "ap-guangzhou-2"
          }
        ],
        "TotalCount": 1,
        "RequestId": "5cf1a813-d4f8-4e0c-8f90-c155a84a3ea1"
      }
    }

    Example2 Query the list of network cards bound to a label

    Query with tag-key.

    Input Example

    https://vpc.tencentcloudapi.com/?Action=DescribeNetworkInterfaces
    &Version=2017-03-12
    &Filters.0.Name=tag-key
    &Filters.0.Values.0=Version
    &<common request parameters>

    Output Example

    {
      "Response": {
        "NetworkInterfaceSet": [
          {
            "VpcId": "vpc-709l0i0x",
            "SubnetId": "subnet-qymfizh2",
            "NetworkInterfaceId": "eni-p17uqigx",
            "NetworkInterfaceName": "return",
            "NetworkInterfaceDescription": "",
            "GroupSet": [
              "sg-hcd8t9xj"
            ],
            "Primary": false,
            "MacAddress": "20:90:6F:FC:9F:69",
            "State": "AVAILABLE",
            "CreatedTime": "2018-04-18 21:46:56",
            "PrivateIpAddressSet": [
              {
                "Description": "12312",
                "Primary": true,
                "PrivateIpAddress": "192.168.3.10",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.3.104",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "13123",
                "Primary": false,
                "PrivateIpAddress": "192.168.3.18",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.3.223",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.3.86",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              }
            ],
            "Attachment": null,
            "Zone": "ap-guangzhou-2",
            "Ipv6AddressSet": [],
            "TagSet": [
              {
                "Key": "Version",
                "Value": "DEV"
              }
            ]
          },
          {
            "VpcId": "vpc-709l0i0x",
            "SubnetId": "subnet-1hv4zz90",
            "NetworkInterfaceId": "eni-ag4nxorp",
            "NetworkInterfaceName": "return",
            "NetworkInterfaceDescription": "",
            "GroupSet": [],
            "Primary": false,
            "MacAddress": "20:90:6F:26:00:4C",
            "State": "AVAILABLE",
            "CreatedTime": "2018-04-18 21:47:46",
            "PrivateIpAddressSet": [
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.1.14",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": true,
                "PrivateIpAddress": "192.168.1.23",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.1.234",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.1.24",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.1.3",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.1.4",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              }
            ],
            "Attachment": null,
            "Zone": "ap-guangzhou-3",
            "Ipv6AddressSet": [],
            "TagSet": [
              {
                "Key": "Version",
                "Value": "TEST"
              }
            ]
          }
        ],
        "TotalCount": 2,
        "RequestId": "0c10340b-2551-4414-a8c7-8d90dc24ddd0"
      }
    }

    Example3 Query the list of network cards bound to a label

    Query with tag: tag-key.

    Input Example

    https://vpc.tencentcloudapi.com/?Action=DescribeNetworkInterfaces
    &Version=2017-03-12
    &Filters.0.Name=tag:Version
    &Filters.0.Values.0=TEST
    &<common request parameters>

    Output Example

    {
      "Response": {
        "NetworkInterfaceSet": [
          {
            "VpcId": "vpc-709l0i0x",
            "SubnetId": "subnet-qymfizh2",
            "NetworkInterfaceId": "eni-p17uqigx",
            "NetworkInterfaceName": "return bug-12",
            "NetworkInterfaceDescription": "",
            "GroupSet": [
              "sg-hcd8t9xj"
            ],
            "Primary": false,
            "MacAddress": "20:90:6F:FC:9F:69",
            "State": "AVAILABLE",
            "CreatedTime": "2018-04-18 21:46:56",
            "PrivateIpAddressSet": [
              {
                "Description": "12312",
                "Primary": true,
                "PrivateIpAddress": "192.168.3.10",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.3.104",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "13123",
                "Primary": false,
                "PrivateIpAddress": "192.168.3.18",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.3.223",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              },
              {
                "Description": "",
                "Primary": false,
                "PrivateIpAddress": "192.168.3.86",
                "AddressId": "",
                "PublicIpAddress": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              }
            ],
            "Attachment": null,
            "Zone": "ap-guangzhou-2",
            "Ipv6AddressSet": [
              {
                "Description": "",
                "Primary": false,
                "Address": "2402:4e00:1000:7400:0:9028:a2c9:85b2",
                "AddressId": "",
                "IsWanIpBlocked": false,
                "State": "AVAILABLE"
              }
            ],
            "TagSet": [
              {
                "Key": "Version",
                "Value": "TEST"
              },
              {
                "Key": "Compony",
                "Value": "Compony-A"
              }
            ]
          }
        ],
        "TotalCount": 1,
        "RequestId": "0c10340b-2551-4414-a8c7-8d90dc24ddd0"
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InvalidParameter.Coexist The parameters cannot be specified at the same time.
    InvalidParameterValue.Malformed Invalid input parameter format.
    ResourceNotFound The resource does not exist.