调用AddDnatEntry给智能接入网关实例添加DNAT条目。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
 - 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
 - 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
 - 对于不支持资源级授权的操作,用
全部资源表示。 
 - 条件关键字:是指云产品自身定义的条件关键字。
 - 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
 
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 | 
|---|---|---|---|---|
| smartag:AddDnatEntry | *SmartAccessGateway acs:smartag:{#regionId}:{#accountId}:smartag/{#SmartAGId} | 
  | 无 | 
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| RegionId | string | 是 | 智能接入网关实例所在的地域 ID。  | cn-hangzhou | 
| SagId | string | 是 | 智能接入网关实例 ID。 说明 
目前只支持硬件版实例。
  | sag-kdhg******* | 
| Type | string | 是 | DNAT 类型,包括以下选项: 
  | Intranet | 
| ExternalIp | string | 否 | 外部的公网 IP 地址。 说明 
DNAT 类型为公网 DNAT 时,公网 DNAT 自动识别当前公网 IP,无需填写。
  | 10.10.1.xx | 
| ExternalPort | string | 是 | 公网端口。 取值范围:1-65535。  | 80 | 
| InternalIp | string | 是 | 目标私网 IP 地址。  | 192.168.0.1 | 
| IpProtocol | string | 是 | 协议类型,包含以下选项: 
  | TCP | 
| InternalPort | string | 是 | 目标私网端口号。 取值范围:1-65535。  | 80 | 
返回参数
示例
正常返回示例
JSON格式
{
  "RequestId": "56BF6C79-C77D-41A0-86DD-A4B156E784EA",
  "DnatEntryId": "fwd-kxe4fq3xuzczze****"
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 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. | 该智能接入网关已经到期停服,请续费。 | 
| 400 | QuotaExceeded.DnatPerSag | The maximum number of dnat rules in an SAG is exceeded. You can open a ticket to increase the quota. | DNAT条目数量超出配额。 | 
| 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。 | 
访问错误中心查看更多错误码。
变更历史
| 变更时间 | 变更内容概要 | 操作 | 
|---|---|---|
| 2023-12-06 | OpenAPI 错误码发生变更 | 查看变更详情 | 
