接口功能介绍
创建DNAT规则
接口约束
需要先创建私网NAT
接口是否审批
否
URI
POST /v4/privatenat/create-dnat
Content-Type
application/json
路径参数
无
Query参数
无
请求头header参数
无
请求体body参数
请求体body参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
regionID | 是 | String | 区域id | 79fa97e3-c48b-xxxx-9f46-6a13d8163678 | |
natGatewayID | 是 | String | 私网NAT的ID | natgw-aldjlfsfd | |
externalIP | 是 | String | 中转IP | 192.168.1.1 | |
externalPort | 是 | Integer | 对外的端口(1-65535) | 1011 | |
internalPort | 是 | Integer | 对应的内部端口(1-65535) | 7299 | |
internalIP | 否 | String | 对应的内部IP(和portID二选一) | 10.0.11.89 | |
portID | 否 | String | 对应的网卡ID(和internalIP二选一) | 7299 | |
protocol | 是 | String | 协议: tcp, udp | tcp | |
description | 否 | String | 支持拉丁字母、中文、数字, 特殊字符:!@#$%^&\*()\_\-+= <>?:\"{}\|,.\/;'[\]·@#¥%……&\*() ——\-+={} | 《》?:“”【】、;‘',。、,不能以 http: / https: 开头,长度 0 - 128 | 这是一个描述 |
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|
响应参数
响应参数 | 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
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 | Object | object |
响应参数 | 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
---|
表 returnObj | 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
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 | ||
dnatID | String | DNAT规则的ID。 | dgwr-xxxx |
表 returnObj | 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
---|
枚举参数
无
请求头header示例
无
请求url示例
POST /v4/privatenat/create-dnat
请求体body示例
{
"natGatewayID":"natgw-1o5sdqb7i2",
"regionID":"81f7728662dd11ec810800155d307d5b",
"externalIP":"192.168.1.2",
"externalPort":7299,
"internalIP":"10.0.1.22",
"protocol":"tcp",
"description":"This is a description"
}
响应示例
{
"statusCode":800,
"errorCode":"SUCCESS",
"message":"success",
"description":"成功",
"returnObj":{
"dnatID":"natgwdr-xxxxx"
}
}
状态码
状态码 | 描述 |
---|---|
200 | 表示请求成功 |
状态码 | 描述 |
---|
错误码
请参考 错误码说明。