11.网络配置与管理
1. 端口映射列表
接口地址:/v2/instance/listPortMapping
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*,application/json
支持版本:v1.1.1
接口描述:
获取容器的DNAT端口转发规则
请求参数:
| 参数名称 | 参数说明 | 位置 | 是否必须 | 数据类型 | 描述 |
|---|---|---|---|---|---|
| instanceUuids | 容器 uuid | body | true | list | 单条或多条容器数据 |
请求示例:
POST "/openapi/v2/instance/listPortMapping"
body:
{
"instanceUuids": [
"f4d2fccea3e341dcba0bf0d6ec40455e","ae674f4546c74bf48c00c211334f214a"
]
}
响应参数:
| 参数名称 | 参数说明 | 类型 | 描述 |
|---|---|---|---|
| code | 返回代码 | integer(int32) | |
| message | 返回处理消息 | string | |
| success | 成功标志 | boolean | |
| result | 返回数据对象 | list | |
| uuid | 容器id | string | |
| portMappings | 协议列表 | list<object> | |
| mappingId | 映射id | string | |
| instanceIp | 容器ip | string | |
| instancePort | 容器源端口号 | integer | |
| mappings | list<object> | ||
| id | id | string | |
| publicIp | 公网ip | string | |
| publicPort | 公网端口 | string | |
| isp | 运营商 | string | |
| ispType | 运营商枚举 | integer | 1:移动 2:联通 4:电信 |
| idc | 机房 | string | |
| protocol | 协议类型 | string | |
| protocolType | 协议枚举 | integer | 1:udp 2:tcp |
| description | 描述 | string | |
| timestamp | 时间戳 | integer(int64) | |
| traceId | 请求处理ID | string |
响应示例:
{
"message": "操作成功!",
"code": 200,
"result": [
{
"uuid": "qishuo-jinhua-1-pt96wiqiundzlbwl",
"portMappings": [
{
"mappingId": "fcd4181eb64d449aa1794701b473fb35",
"instanceIp": "10.1.102.21",
"instancePort": 10101,
"protocol": "udp",
"protocolType": 1,
"description": "Firewall-config",
"mappings": [
{
"id": "f59164f66f0e4cba8ea0a49b502a12e0",
"publicIp": "61.153.100.190",
"publicPort": 40398,
"isp": "电信",
"ispType": 4,
"idc": "广州机房"
},
{
"id": "a6909bbbb02a4c0180b193115a1ccb6d",
"publicIp": "123.156.66.187",
"publicPort": 40398,
"isp": "联通",
"ispType": 2,
"idc": "广州机房"
},
{
"id": "17d7b9a9a76f4297bc49f0f386f0bbb9",
"publicIp": "117.147.181.162",
"publicPort": 40398,
"isp": "移动",
"ispType": 1,
"idc": "广州机房"
}
]
}
]
}
],
"timestamp": 1752145988534,
"traceId": "C20250710191308534805"
}
2. 公网IP分页列表
接口地址: /v1/network/snat/ip/page/list
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*,application/json
支持版本:v2.5.0
接口描述:
当前用户指定项目下的公网SNAT IP列表
请求参数:
| 参数名称 | 参数说明 | 位置 | 是否必须 | 数据类型 | 描述 |
|---|---|---|---|---|---|
| projectId | 项目Id | body | false | string | 默认当前用户的默认项目 |
| snatIpList | SNAT IP列表 | body | false | list |
请求示例,实际请求请替换参数值:
POST "/openapi/v1/network/snat/ip/page/list"
body:
{
"projectId":"7b5a664173f526309e43faf775f09d1d",
"snatIpList":["112.10.12.89"]
}
响应参数:
| 参数名称 | 参数说明 | 类型 | 描述 |
|---|---|---|---|
| code | 返回代码 | integer(int32) | |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | list<object> | |
| nodeName | 节点名称 | string | |
| ipList | SNAT IP列表 | list<object> | |
| bindNum | 绑定数量 | integer | |
| isp | 运营商 | string | |
| bindType | 绑定类型 | integer | 1:板卡;2:容器 |
| snatIp | SNAT IP | string | |
| timestamp | 时间戳 | integer(int64) | |
| traceId | 请求处理ID | boolean |
响应示例: