调用AddDnatEntry给智能接入网关实例添加DNAT条目。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | AddDnatEntry |
系统规定参数。取值:AddDnatEntry。 |
RegionId | String | 是 | cn-hangzhou |
智能接入网关实例所在的地域ID。 |
SagId | String | 是 | sag-kdhg******* |
智能接入网关实例ID。 说明 目前只支持硬件版实例。
|
Type | String | 是 | Intranet |
DNAT类型,包括以下选项:
|
ExternalIp | String | 否 | 10.10.1.xx |
外部的公网IP地址。 说明 DNAT类型为公网DNAT时,公网DNAT自动识别当前公网IP,无需填写。
|
ExternalPort | String | 是 | 80 |
公网端口。 取值范围:1-65535。 |
InternalIp | String | 是 | 192.168.0.1 |
目标私网IP地址。 |
IpProtocol | String | 是 | TCP |
协议类型,包含以下选项:
|
InternalPort | String | 是 | 80 |
目标私网端口号。 取值范围:1-65535。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 56BF6C79-C77D-41A0-86DD-A4B156E784EA |
请求ID。 |
DnatEntryId | String | fwd-kxe4fq3xuzczze**** |
DNAT实例ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=AddDnatEntry
&RegionId=cn-hangzhou
&SagId=sag-kdhg*******
&Type=Intranet
&ExternalIp=10.10.1.xx
&ExternalPort=80
&InternalIp=192.168.0.1
&IpProtocol=TCP
&InternalPort=80
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<AddDnatEntryResponse>
<DnatEntryId>fwd-kxe4fq3xuzczze****</DnatEntryId>
<RequestId>56BF6C79-C77D-41A0-86DD-A4B156E784EA</RequestId>
</AddDnatEntryResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "56BF6C79-C77D-41A0-86DD-A4B156E784EA",
"DnatEntryId" : "fwd-kxe4fq3xuzczze****"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidRegionID | The specified regionId does not exist. | 指定的RegionId不存在。 |
400 | MissingParam | You must specify the parameter. | 缺少必填参数。 |
400 | IllegalParam | The parameter is invalid. | 参数非法。 |
400 | DuplicatedDnatEntry | The specified ExternalIp, IpProtocol, ExternalPort, InternalIp, and InternalPort are duplicated. | 指定的外部ip、ip协议、外部端口、内部ip、内部端口冲突。 |
400 | SmartAccessGatewayNotActivated | The specified Smart Access Gateway has not been activated. | 该智能接入网关尚未激活,请先激活该实例。 |
400 | SmartAccessGatewayInArrears | The specified Smart Access Gateway has expired. | 该智能接入网关已经到期停服,请续费。 |
403 | Forbidden | User not authorized to operate on the specified resource. | 用户没有操作此资源的权限。 |
403 | MissingParameter | The input parameter is missing, please check your input. | 输入参数缺失,请检查您的输入。 |
403 | InvalidParameter | The specified parameter is invalid. | 非法参数。 |
403 | InternalError | An internal server error occurred. | 内部服务错误。 |
403 | FeatureNotSupport | The current edition of the smart access gateway does not support this feature. | 智能接入网关当前版本不支持该功能特性。 |
403 | InvalidId.SMARTAG | The specified smart access gateway instance id is invalid. | 无效的智能接入网关实例ID。 |
访问错误中心查看更多错误码。