Adds a destination network address translation (DNAT) entry to a Smart Access Gateway (SAG) instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
smartag:AddDnatEntry |
*SmartAccessGateway
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The ID of the region where the SAG instance is deployed. |
cn-hangzhou |
| SagId |
string |
Yes |
The ID of the SAG instance. Note
Only SAG instances used to manage SAG devices support DNAT. |
sag-kdhg******* |
| Type |
string |
No |
The type of the DNAT entry. Valid values:
|
Intranet |
| ExternalIp |
string |
No |
The public IP address. Note
For Internet-type DNAT entries, the current public IP address is automatically recognized. |
10.10.1.xx |
| ExternalPort |
string |
Yes |
The public port. Valid values: 1 to 65535. |
80 |
| InternalIp |
string |
Yes |
The destination private IP address. |
192.168.0.1 |
| IpProtocol |
string |
Yes |
The protocol used in DNAT. Valid values:
|
TCP |
| InternalPort |
string |
Yes |
The destination private port. Valid values: 1 to 65535. |
80 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. |
56BF6C79-C77D-41A0-86DD-A4B156E784EA |
| DnatEntryId |
string |
The ID of the DNAT entry. |
fwd-kxe4fq3xuzczze**** |
Examples
Success response
JSON format
{
"RequestId": "56BF6C79-C77D-41A0-86DD-A4B156E784EA",
"DnatEntryId": "fwd-kxe4fq3xuzczze****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidRegionID | The specified regionId does not exist. | The specified region ID does not exist. |
| 400 | MissingParam | You must specify the parameter. | A required parameter is not set. |
| 400 | IllegalParam | The parameter is invalid. | A parameter is set to an invalid value. |
| 400 | DuplicatedDnatEntry | The specified ExternalIp, IpProtocol, ExternalPort, InternalIp, and InternalPort are duplicated. | The specified public IP address, port, public port, private IP address, and private port overlap. |
| 400 | SmartAccessGatewayNotActivated | The specified Smart Access Gateway has not been activated. | The specified SAG instance is inactive. You must activate the instance first. |
| 400 | SmartAccessGatewayInArrears | The specified Smart Access Gateway has expired. | 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. | The maximum number of dnat rules in an SAG is exceeded. You can open a ticket to increase the quota. |
| 403 | Forbidden | User not authorized to operate on the specified resource. | You do not have permissions to manage the specified resource. |
| 403 | MissingParameter | The input parameter is missing, please check your input. | Missing parameters. Check whether all required parameters are set. |
| 403 | InvalidParameter | The specified parameter is invalid. | Invalid parameters. |
| 403 | InternalError | An internal server error occurred. | An internal server error occurred. |
| 403 | FeatureNotSupport | The current edition of the smart access gateway does not support this feature. | The current version of Smart Access Gateway does not support this feature. |
| 403 | InvalidId.SMARTAG | The specified smart access gateway instance id is invalid. | The SAG instance ID is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.