接口功能介绍
弹性网卡列表
接口约束
无
URI
GET /v4/ports/list
请求参数
Query 参数
参数 | 参数类型 | 是否必填 | 说明 | 示例 |
---|---|---|---|---|
regionID | String | 是 | 区域id | 81f7728662dd11ec810800155d307d5b |
vpcID | String | 否 | 所属vpc id | vpc-r5i4zghgvq |
deviceID | String | 否 | 关联设备id | b96afb7b971660db375d0963ad10c192 |
subnetID | String | 否 | 所属子网id | subnet-r5i4zghgvq |
pageNumber | Integer | 否 | 列表的页码,默认值为 1。 | 1 |
pageNo | Integer | 否 | 列表的页码,默认值为 1, 推荐使用该字段, pageNumber 后续会废弃 | 1 |
pageSize | Integer | 否 | 分页查询时每页的行数,最大值为 50,默认值为 10。 | 10 |
响应参数
参数 | 参数类型 | 说明 | 示例 |
---|---|---|---|
statusCode | Integer | 返回状态码(800为成功,900为失败) | 800 |
message | String | statusCode为900时的错误信息; statusCode为800时为success, 英文 | success |
description | String | statusCode为900时的错误信息; statusCode为800时为成功, 中文 | 成功 |
errorCode | String | statusCode为900时为业务细分错误码,三段式:product.module.code; statusCode为800时为SUCCESS | SUCCESS |
returnObj | Array of Objects | 接口业务数据 | |
totalCount | Integer | 列表条目数 | 20 |
currentCount | Integer | 分页查询时每页的行数。 | 4 |
totalPage | Integer | 总页数 | 5 |
表 returnObj
参数 | 参数类型 | 说明 | 示例 |
---|---|---|---|
networkInterfaceName | String | 虚拟网名称 | |
networkInterfaceID | String | 虚拟网id | port-r5i4zghgvq |
vpcID | String | 所属vpc | |
subnetID | String | 所属子网id | |
role | int | 网卡类型: 0 主网卡, 1 弹性网卡 | |
macAddress | String | mac地址 | |
primaryPrivateIp | String | 主ip | |
ipv6Addresses | Array of String | ipv6地址 | |
instanceID | String | 关联的设备id | |
instanceType | String | 设备类型 VM(云主机), BM(裸金属), LB(弹性负载均衡), CBM(标准裸金属) | |
description | String | 描述 | |
securityGroupIds | Array of String | 安全组ID列表 | |
secondaryPrivateIps | Array of String | 辅助私网IP | |
adminStatus | String | 是否启用DOWN, UP |
请求示例
GET /v4/ports/list?regionID=81f7728662dd11ec810800155d307d5b
响应示例
{
"statusCode": 800,
"errorCode": "SUCCESS",
"message": "success",
"description": "成功",
"returnObj": [
{
"networkInterfaceName": "",
"networkInterfaceID": "port-umzcwv275t",
"vpcID": "vpc-3piveayzqx",
"subnetID": "subnet-a9cd8hl57m",
"role": 0,
"macAddress": "fa:16:3e:9c:61:b4",
"primaryPrivateIp": "192.168.0.18",
"ipv6Addresses": null,
"instanceID": "88ec0004-42b9-8f81-eef4-b7638502d171",
"instanceType": "VM",
"instanceOwnerID": "aded1887a59ff0b48452079136a198b4",
"description": "",
"securityGroupIds": [
"sg-8hikg37xjs"
],
"secondaryPrivateIps": null,
"adminStatus": "UP",
"associatedEip": null
},
{
"networkInterfaceName": "",
"networkInterfaceID": "port-c4tf0pgpb5",
"vpcID": "vpc-3piveayzqx",
"subnetID": "subnet-a9cd8hl57m",
"role": 0,
"macAddress": "fa:16:3e:e2:ac:01",
"primaryPrivateIp": "192.168.0.15",
"ipv6Addresses": null,
"instanceID": "c29eb68e-ef86-2906-8f21-62248e2342e4",
"instanceType": "VM",
"instanceOwnerID": "aded1887a59ff0b48452079136a198b4",
"description": "",
"securityGroupIds": [
"sg-8hikg37xjs"
],
"secondaryPrivateIps": null,
"adminStatus": "UP",
"associatedEip": null
},
{
"networkInterfaceName": "",
"networkInterfaceID": "port-7kf2e47fpz",
"vpcID": "vpc-e5qjxcu83p",
"subnetID": "subnet-sauz9lhc0a",
"role": 0,
"macAddress": "fa:16:3e:53:5b:56",
"primaryPrivateIp": "192.168.0.3",
"ipv6Addresses": null,
"instanceID": "9da1944e-25fe-7013-da52-1d93a6a47397",
"instanceType": "VM",
"instanceOwnerID": "aded1887a59ff0b48452079136a198b4",
"description": "",
"securityGroupIds": [
"sg-wwstegvagl"
],
"secondaryPrivateIps": null,
"adminStatus": "UP",
"associatedEip": null
},
{
"networkInterfaceName": "",
"networkInterfaceID": "port-91wh8vp28d",
"vpcID": "vpc-e5qjxcu83p",
"subnetID": "subnet-sauz9lhc0a",
"role": 0,
"macAddress": "fa:16:3e:98:5e:00",
"primaryPrivateIp": "192.168.0.4",
"ipv6Addresses": null,
"instanceID": "3d4b0a15-aee6-6012-8be1-3df906007de8",
"instanceType": "VM",
"instanceOwnerID": "aded1887a59ff0b48452079136a198b4",
"description": "",
"securityGroupIds": [
"sg-wwstegvagl"
],
"secondaryPrivateIps": null,
"adminStatus": "UP",
"associatedEip": null
},
{
"networkInterfaceName": "test-for-me",
"networkInterfaceID": "port-mm5w2zjc5t",
"vpcID": "vpc-pzoqybez6p",
"subnetID": "subnet-rul6n6t45u",
"role": 1,
"macAddress": "fa:16:3e:08:43:d1",
"primaryPrivateIp": "192.168.0.3",
"ipv6Addresses": [
"100:1:1d9:3e00:da17:8766:c014:1152"
],
"instanceID": "",
"instanceType": "",
"instanceOwnerID": "",
"description": "",
"securityGroupIds": [
"sg-kwioydbept"
],
"secondaryPrivateIps": null,
"adminStatus": "UP",
"associatedEip": null
},
{
"networkInterfaceName": "",
"networkInterfaceID": "port-23apfuff4u",
"vpcID": "vpc-3piveayzqx",
"subnetID": "subnet-a9cd8hl57m",
"role": 0,
"macAddress": "fa:16:3e:3e:26:b2",
"primaryPrivateIp": "192.168.0.8",
"ipv6Addresses": null,
"instanceID": "7c08aca0-0066-054e-b6cf-4dd477767b53",
"instanceType": "VM",
"instanceOwnerID": "aded1887a59ff0b48452079136a198b4",
"description": "",
"securityGroupIds": [
"sg-8hikg37xjs"
],
"secondaryPrivateIps": null,
"adminStatus": "UP",
"associatedEip": null
},
{
"networkInterfaceName": "",
"networkInterfaceID": "port-tre7d8j0cx",
"vpcID": "vpc-3piveayzqx",
"subnetID": "subnet-a9cd8hl57m",
"role": 0,
"macAddress": "fa:16:3e:75:91:73",
"primaryPrivateIp": "192.168.0.7",
"ipv6Addresses": null,
"instanceID": "69774dc5-0ec4-fd16-f16f-f9ef7a762f0c",
"instanceType": "VM",
"instanceOwnerID": "aded1887a59ff0b48452079136a198b4",
"description": "",
"securityGroupIds": [
"sg-8hikg37xjs"
],
"secondaryPrivateIps": null,
"adminStatus": "UP",
"associatedEip": null
},
{
"networkInterfaceName": "",
"networkInterfaceID": "port-ygciqxxj3k",
"vpcID": "vpc-ngb9w4fqml",
"subnetID": "subnet-ardyaj8cbb",
"role": 0,
"macAddress": "fa:16:3e:8d:4f:db",
"primaryPrivateIp": "192.168.0.4",
"ipv6Addresses": [
"100:1:159:f300:1c82:b4ea:c0f8:7174"
],
"instanceID": "a706ffaf-1442-878f-5cda-c31c0b0e5830",
"instanceType": "VM",
"instanceOwnerID": "aded1887a59ff0b48452079136a198b4",
"description": "",
"securityGroupIds": [
"sg-w72uw0491p"
],
"secondaryPrivateIps": [
"192.168.0.6"
],
"adminStatus": "UP",
"associatedEip": {
"id": "eip-y0trx531pt",
"name": "eip-faa74992"
}
},
{
"networkInterfaceName": "opentvapi-2222",
"networkInterfaceID": "port-k0gjc6pjwv",
"vpcID": "vpc-zygdbgyrt5",
"subnetID": "subnet-smfk53f9do",
"role": 1,
"macAddress": "fa:16:3e:13:75:97",
"primaryPrivateIp": "192.168.0.6",
"ipv6Addresses": null,
"instanceID": "",
"instanceType": "",
"instanceOwnerID": "",
"description": "",
"securityGroupIds": [
"sg-nxv63ffbri"
],
"secondaryPrivateIps": null,
"adminStatus": "UP",
"associatedEip": null
},
{
"networkInterfaceName": "openapi-port2",
"networkInterfaceID": "port-rxcngadc2e",
"vpcID": "vpc-zygdbgyrt5",
"subnetID": "subnet-smfk53f9do",
"role": 1,
"macAddress": "fa:16:3e:73:14:34",
"primaryPrivateIp": "192.168.0.5",
"ipv6Addresses": null,
"instanceID": "",
"instanceType": "",
"instanceOwnerID": "",
"description": "",
"securityGroupIds": [
"sg-nxv63ffbri"
],
"secondaryPrivateIps": null,
"adminStatus": "UP",
"associatedEip": null
}
],
"currentCount": 10,
"totalCount": 12,
"totalPage": 2
}
状态码
状态码 | 描述 |
---|---|
200 | 表示请求成功。 |
错误码
请参考 错误码说明。