调用CreateForwardEntry添加DNAT条目。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ens:CreateForwardEntry |
create |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| NatGatewayId |
string |
是 |
NAT 网关的 ID。 |
nat-5t7nh1cfm6kxiszlttr38**** |
| ExternalIp |
string |
是 |
提供公网访问的弹性公网 IP 地址。 该 EIP 不得被同一 NAT 网关的 SNAT 规则占用;可通过 DescribeNatGateways 返回的 IpLists.UsingStatus 确认其为 Idle 状态。 |
121.XXX.XXX.28 |
| ExternalPort |
string |
是 |
需要进行端口转发的外部端口或端口段。
|
22 |
| InternalIp |
string |
是 |
通过 DNAT 条目进行公网通信的实例的私网 IP 地址。 |
10.0.XXX.XXX |
| InternalPort |
string |
是 |
进行端口转发的内部端口或端口段。
|
22 |
| ForwardEntryName |
string |
否 |
DNAT 规则的名称。长度为 2~128 个字符,不能以 |
test0 |
| IpProtocol |
string |
否 |
协议类型,取值:
枚举值:
|
Any |
| HealthCheckPort |
integer |
否 |
DNAT 的探测端口,需要在内网端口范围内。默认值为空。 |
80 |
| StandbyExternalIp |
string |
否 |
提供公网访问的备用弹性公网 IP 地址,需要选择绑定在 NAT 上的备用弹性 IP。DNAT 创建成功后,备用公网 IP 会生效。 |
101.XXX.XXX.4 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
请求 ID。 |
EF6D6FA4-DACA-5822-A981-81006271D263 |
| ForwardEntryId |
string |
DNAT 条目的 ID。 |
fwd-5tc07cw14metghn3siv4a**** |
示例
正常返回示例
JSON格式
{
"RequestId": "EF6D6FA4-DACA-5822-A981-81006271D263",
"ForwardEntryId": "fwd-5tc07cw14metghn3siv4a****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | Invalid%s | The specified parameter %s is invalid. | |
| 400 | Missing%s | You must specify the parameter %s. | |
| 400 | InvalidParameter.NatNotFound | The specified Nat is not found. | 指定的参数Nat不存在。 |
| 400 | InvalidParameter.ExternalIp | The specified externalIp is not found. | |
| 400 | Forbidden.ExternalIpUsedInSnat | Forbidden.ExternalIpUsedInSnat | |
| 400 | InvalidParameter.InternalIpNotFound | The input parameter internalIp that is not found. | |
| 400 | Forbidden.ExternalPort.Duplicated | The specified ExternalPort is duplicated. | 该外部端口已配置了DNAT规则,请您不要重复设置。 |
| 400 | ForwardEntryLimitExceed | The limit of forward entry in the nat reaches. | |
| 400 | InvalidParameter.HealthCheckPort | HealthCheckPort is not in the range of InternalPort | |
| 400 | IncorrectInstanceStatus | The current status of the instance does not support this operation. | 当前实例状态不支持此操作。 |
| 400 | SystemBusy | System is busy, please try again later. | 当前系统繁忙,请稍后重试。 |
| 400 | InvalidParameter.InternalIp | The specified parameter internalIp is invalid. | 参数内部IP不正确。 |
| 400 | InvalidPort.Malformed | The specified port is not a valid port. | 指定的端口不正确 |
| 400 | ens.interface.error | Failed to call API. | 接口调用发生异常。 |
| 400 | NoPermission | Permission denied. | |
| 400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。