Adds a destination network address translation (DNAT) entry to a Smart Access Gateway (SAG) instance.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
smartag:AddDnatEntry | Write |
|
| 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 | Yes | The type of the DNAT entry. Valid values:
| Intranet |
ExternalIp | string | No | The public IP address. Note
If the DNAT entry is used to forward packets transmitted over the Internet, the DNAT entry automatically recognizes the current public IP address.
| 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 parameters
Examples
Sample success responses
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. |
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. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||
---|---|---|---|---|---|---|---|---|
2023-12-06 | The Error code has changed | see changesets | ||||||
|