查询弹性网卡信息

最近更新时间:2018-05-08 15:44:15

1. 接口描述

本接口(DescribeNetworkInterfaces)用于查询弹性网卡信息。
接口请求域名:vpc.api.qcloud.com

2. 输入参数

以下请求参数列表仅列出了接口请求参数,正式调用时需要加上公共请求参数,见公共请求参数页面。其中,此接口的 Action 字段为 DescribeNetworkInterfaces。

参数名称 必选 类型 描述
vpcId String 弹性网卡对应的私有网络ID,例如:vpc-7t9nf3pu
networkInterfaceId String 系统分配的弹性网卡ID,例如:eni-m6dyj72l
eniName String 弹性网卡名称,支持模糊搜索
eniDescription String 弹性网卡描述,支持模糊搜索
instanceId String 云主机实例ID,例如:ins-xx44545f
offset Int 初始行的偏移量,默认为0
limit Int 每页行数,默认为20,最大支持50。
orderField String 按某个字段排序。
支持字段:eniName,createTime,默认按createTime
orderDirection String 升序(asc)或降序(desc),默认:desc

3. 输出参数

参数名称 类型 描述
code Int 错误码。0:成功,其他值:失败
message String 错误信息
data.totalNum Int 弹性网卡总数量
data.data Array 弹性网卡信息数组

data数组:

参数名称 类型 描述
data.n.vpcId String 弹性网卡对应的私有网络ID。例如:vpc-8e0ypm3z
data.n.subnetId String 弹性网卡对应的子网ID。例如:subnet-0ap8nwca
data.n.zoneId Int 弹性网卡对应的子网所在的可用区ID。例如:200001
data.n.eniName String 弹性网卡名称
data.n.eniDescription String 弹性网卡描述
data.n.networkInterfaceId String 弹性网卡ID。例如:eni-m6dyj72l
data.n.primary Bool 是否为主网卡。true:主网卡;false:普通网卡
data.n.macAddress String 弹性网卡mac地址。例如:02:81:60:cb:27:37
data.n.privateIpAddressesSet Array 弹性网卡绑定的 IP 信息
data.n.instanceSet Object 弹性网卡绑定的云主机信息
data.n.groupSet Array 弹性网卡绑定的安全组信息

privateIpAddressesSet信息数组:

参数名称 类型 描述
privateIpAddress String IP地址
primary Bool 是否为主IP,true:是;false:否
description String 备注
wanIp String 公网IP
isWanIpBlocked Bool 外网IP是否被封堵
eipId String 弹性公网IP ID

instanceSet信息:

参数名称 类型 描述
instanceId String 腾讯云主机实例ID,例如:ins-xx44545f
attachTime String 绑定时间,例如:2016-02-15 19:20:54

groupSet信息数组:

参数名称 类型 描述
sgId String 安全组ID,例如:sg-dfg1df54
sgName String 安全组名称
projectId Int 安全组项目ID

4. 错误码表

以下错误码表仅列出了该接口的业务逻辑错误码,更多公共错误码详见VPC错误码

错误码 描述
InvalidVpc.NotFound 无效的VPC,VPC资源不存在。请再次核实您输入的资源信息是否正确,可通过DescribeVpcEx接口查询VPC
InvalidNetworkInterface.NotFound 无效的弹性网卡,弹性网卡资源不存在。请再次核实您输入的资源信息是否正确,可通过DescribeNetworkInterfaces接口查询弹性网卡

5. 示例

输入


https://vpc.api.qcloud.com/v2/index.php?Action=DescribeNetworkInterfaces
&<公共请求参数>
&vpcId=vpc-fyc4pilj

输出

{
    "code": 0,
        "message": "",
        "codeDesc": "Success",
        "data": {
            "totalNum": 3,
            "data": [
            {
                "vpcId": "vpc-fyc4pilk",
                "vpcName": "test",
                "subnetId": "subnet-pq7ptksb",
                "zoneId": 100002,
                "eniName": "大",
                "eniDescription": "",
                "networkInterfaceId": "eni-d6m4m0iy",
                "primary": false,
                "macAddress": "20:90:6F:59:8D:79",
                "createTime": "2017-08-31 11:33:59",
                "flowLogsSet": [],
                "privateIpAddressesSet": [
                {
                    "privateIpAddress": "10.53.54.19",
                    "primary": true,
                    "wanIp": "119.29.158.39",
                    "description": "asdfasdfasdf",
                    "isWanIpBlocked": false,
                    "eipId": "eip-07vqn979"
                }
                ],
                    "instanceSet": {
                        "instanceId": "ins-7s7zjjcz",
                        "attachTime": "2017-12-12 11:55:07"
                    },
                    "groupSet": [
                    {
                        "sgId": "sg-lb62wxwb",
                        "sgName": "asdfsadf",
                        "projectId": 1079263
                    },
                    {
                        "sgId": "sg-ikmc8kcy",
                        "sgName": "全drop",
                        "projectId": 0
                    }
                    ]
            },
            {
                "vpcId": "vpc-fyc4pilk",
                "vpcName": "test",
                "subnetId": "subnet-pq7ptksb",
                "zoneId": 100002,
                "eniName": "手动",
                "eniDescription": "",
                "networkInterfaceId": "eni-ay1ac9c7",
                "primary": false,
                "macAddress": "20:90:6F:94:86:77",
                "createTime": "2017-07-28 20:09:34",
                "flowLogsSet": [],
                "privateIpAddressesSet": [
                {
                    "privateIpAddress": "10.53.54.230",
                    "primary": true,
                    "wanIp": "",
                    "description": "",
                    "isWanIpBlocked": false,
                    "eipId": ""
                },
                {
                    "privateIpAddress": "10.53.54.231",
                    "primary": false,
                    "wanIp": "",
                    "description": "",
                    "isWanIpBlocked": false,
                    "eipId": ""
                }
                ],
                    "instanceSet": {
                        "instanceId": "",
                        "attachTime": ""
                    },
                    "groupSet": [
                    {
                        "sgId": "sg-lb62wxw9",
                        "sgName": "asdfsadf",
                        "projectId": 1079263
                    },
                    {
                        "sgId": "sg-37tmkdiz",
                        "sgName": "Windows 放通3389端口-20170928143645736",
                        "projectId": 0
                    }
                    ]
            },
            {
                "vpcId": "vpc-fyc4pilk",
                "vpcName": "test",
                "subnetId": "subnet-pq7ptksb",
                "zoneId": 100002,
                "eniName": "新建弹性网卡手动",
                "eniDescription": "",
                "networkInterfaceId": "eni-a7hx9qae",
                "primary": false,
                "macAddress": "20:90:6F:31:88:B4",
                "createTime": "2017-07-28 17:39:39",
                "flowLogsSet": [],
                "privateIpAddressesSet": [
                {
                    "privateIpAddress": "10.53.54.200",
                    "primary": true,
                    "wanIp": "",
                    "description": "",
                    "isWanIpBlocked": false,
                    "eipId": ""
                }
                ],
                    "instanceSet": {
                        "instanceId": "",
                        "attachTime": ""
                    },
                    "groupSet": [
                    {
                        "sgId": "sg-lb62wxwe",
                        "sgName": "asdfsadf",
                        "projectId": 1079263
                    },
                    {
                        "sgId": "sg-5y2tai6e",
                        "sgName": "createPolicy_repair_test",
                        "projectId": 0
                    },
                    {
                        "sgId": "sg-q7bvssoa",
                        "sgName": "del usg test",
                        "projectId": 0
                    },
                    {
                        "sgId": "sg-0cgr10ie",
                        "sgName": "bilibili no icmp",
                        "projectId": 0
                    },
                    {
                        "sgId": "sg-ei2rr0qf",
                        "sgName": "广州",
                        "projectId": 0
                    },
                    {
                        "sgId": "sg-oodf2fc6",
                        "sgName": "offset",
                        "projectId": 0
                    }
                ]
            }
        }
}