11.Network configuration and management
1. Port mapping list
API address:/v2/instance/listPortMapping
Request method:POST
Request data type:application/json
Response data type:*/*,application/json
Supported version:v1.1.1
API description:
Get the DNAT port forwarding rules of the container
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| instanceUuids | Container uuid | body | true | list | Single or multiple container data entries |
Request example:
POST "/openapi/v2/instance/listPortMapping"
body:
{
"instanceUuids": [
"f4d2fccea3e341dcba0bf0d6ec40455e","ae674f4546c74bf48c00c211334f214a"
]
}
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | |
| message | Return processing message | string | |
| success | Success flag | boolean | |
| result | Returned data object | list | |
| uuid | Container id | string | |
| portMappings | Protocol list | list<object> | |
| mappingId | Mapping id | string | |
| instanceIp | Container ip | string | |
| instancePort | Container source port number | integer | |
| mappings | list<object> | ||
| id | id | string | |
| publicIp | Public IP | string | |
| publicPort | Public port | string | |
| isp | Carrier | string | |
| ispType | Carrier enum | integer | 1:China Mobile 2:China Unicom 4:China Telecom |
| idc | Computer room | string | |
| protocol | Protocol type | string | |
| protocolType | Protocol enum | integer | 1:udp 2:tcp |
| description | Description | string | |
| timestamp | Timestamp | integer(int64) | |
| traceId | Request processing ID | string |
Response example:
{
"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. Public IP paginated list
API address: /v1/network/snat/ip/page/list
Request method:POST
Request data type:application/json
Response data type:*/*,application/json
Supported version:v2.5.0
API description:
List of public network SNAT IPs under the project specified by the current user
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| projectId | Project Id | body | false | string | Defaults to the current user's default project |
| snatIpList | SNAT IP list | body | false | list |
Request example. Replace parameter values in the actual request:
POST "/openapi/v1/network/snat/ip/page/list"
body:
{
"projectId":"7b5a664173f526309e43faf775f09d1d",
"snatIpList":["112.10.12.89"]
}
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | |
| message | Return processing message | string | |
| result | Returned data object | list<object> | |
| nodeName | Node name | string | |
| ipList | SNAT IP list | list<object> | |
| bindNum | Bound quantity | integer | |
| isp | Carrier | string | |
| bindType | Binding type | integer | 1:board card; 2:container |
| snatIp | SNAT IP | string | |
| timestamp | Timestamp | integer(int64) | |
| traceId | Request processing ID | boolean |
Response example: