获取实例网卡信息
更新时间:2026-06-22
该接口用于获取实例网卡信息,包括主网卡和弹性网卡。
API Explorer
去调试
您可以在 API Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,API Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1GET /v{version}/eni/{instanceId} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号 |
| instanceId | String | 是 | URL参数 | 网卡挂载的虚机ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| enis | List<EniInfo> | 网卡信息列表 |
请求示例
Plain Text
1GET /v2/eni/i-ofsX9WtN HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "enis": [
9 {
10 "eniId": "eni-531s8c7f45rs",
11 "name": "test",
12 "vpcId": "vpc-vv3xw6d9970b",
13 "subnetId": "sbn-2escuever5fi",
14 "zoneName": "cn-bj-a",
15 "description": "",
16 "createdTime": "2022-10-20T06:31:42Z",
17 "macAddress": "fa:f6:00:14:05:1e",
18 "status": "inuse",
19 "securityGroupIds": [
20 "g-6uwn49bxhbvj"
21 ],
22 "privateIpSet": [
23 {
24 "primary": true,
25 "privateIpAddress": "192.168.48.8"
26 }
27 ]
28 },
29 {
30 "eniId": "eni-wwi3mdqp6f5j",
31 "name": "eth0",
32 "vpcId": "vpc-vv3xw6d9970b",
33 "subnetId": "sbn-2escuever5fi",
34 "zoneName": "cn-bj-a",
35 "description": "",
36 "createdTime": "2023-03-21T02:09:03Z",
37 "macAddress": "fa:f6:00:01:83:03",
38 "status": "inuse",
39 "securityGroupIds": [
40 "g-6uwn49bxhbvj"
41 ],
42 "privateIpSet": [
43 {
44 "primary": true,
45 "privateIpAddress": "192.168.48.5"
46 },
47 {
48 "primary": false,
49 "privateIpAddress": "192.168.48.3"
50 }
51 ]
52 }
53 ]
54}
评价此篇文章
