Modifies a specified SNAT entry.
Operation description
ModifySnatEntry is an asynchronous operation. After you send a request, the system returns a request ID, but the SNAT entry has not been modified yet. The modification task is still running in the background. You can call DescribeSnatTableEntries to query the status of the SNAT entry:
-
If the SNAT entry is in the Pending state, the SNAT entry is being modified. In this state, you can only perform query operations and cannot perform other operations.
-
If the SNAT entry is in the Available state, the SNAT entry has been modified.
If any SNAT entry in an SNAT table is in the Pending state, you cannot modify SNAT entries in the SNAT table.
The ModifySnatEntry operation does not support concurrent modifications of a specified SNAT entry within the same SNAT entry instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:ModifySnatEntry |
update |
*SnatTable
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the NAT gateway. You can call the DescribeRegions operation to query the region ID. |
cn-hangzhou |
| SnatTableId |
string |
Yes |
The ID of the SNAT table to which the SNAT entry belongs. |
stb-8vbczigrhop8x5u3t**** |
| SnatEntryId |
string |
Yes |
The ID of the SNAT entry that you want to modify. |
snat-bp1vcgcf8tm0plqcg**** |
| SnatIp |
string |
No |
Note
When you specify multiple EIPs to allocate an SNAT IP IPAM pool, service traffic is distributed across the EIPs by using a hash algorithm. Because traffic varies across connections, service traffic may be unevenly distributed across the EIPs. Add all EIPs to the same Internet Shared Bandwidth instance to prevent service interruptions caused by bandwidth throttling on a single EIP.
|
47.98.XX.XX |
| SnatEntryName |
string |
No |
The name of the SNAT entry. The name must be 2 to 128 characters in length and must start with a letter or a Chinese character. It cannot start with |
SnatEntry-1 |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The ClientToken value can contain only ASCII characters. Note
If you do not specify this parameter, the system uses the RequestId of the API request as the ClientToken. The RequestId may differ for each API request. |
02fb3da4-130e-11e9-8e44-001**** |
| EipAffinity |
integer |
No |
Specifies whether to enable EIP affinity. Valid values:
Note
After you enable EIP affinity, if the SNAT entry is associated with multiple EIPs or NAT IP addresses, the same client uses the same EIP or NAT IP address for access. Otherwise, the client randomly selects an EIP or NAT IP address from the associated ones for access. |
1 |
| NetworkInterfaceId |
string |
No |
The ID of the elastic network interfaces (ENIs). Note
The IPv4 addresses of the network interface controller (NIC) are used as the SNAT addresses. |
eni-gw8g131ef2dnbu3k**** |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
|
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| RequestId |
string |
The request ID. |
2315DEB7-5E92-423A-91F7-4C1EC9AD**** |
Examples
Success response
JSON format
{
"RequestId": "2315DEB7-5E92-423A-91F7-4C1EC9AD****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidSnatIp.Malformed | The specified SnatIp is not a valid IP address. | |
| 400 | Forbidden.SourceVSwitchId.Duplicated | The specified SourceCIDRis duplicated. | |
| 400 | Forbidden.IpUsedInForwardTable | The specified SnatIp already used in forward table | |
| 400 | OperationUnsupported.EipForSnatPool | The Eip cannot support snat pool | |
| 400 | InvalidParameter.Name.Malformed | The specified Name is not valid. | |
| 400 | IncorretSnatEntryStatus | The Specified SnatEntry is not stable status, can not operation | |
| 400 | EIP_NOT_IN_GATEWAY | The Eip not in nat gateway | |
| 400 | InvalidParameter.SnatIp | Error public ip must in same bandwidth package. | |
| 400 | QuotaExceeded.SnatIp | Public ip number exceeds quota. | |
| 400 | InvalidSnatEntryId.NotFound | Specified SNAT entry does not exist. | |
| 400 | IncorrectStatus.SnatEntry | The Specified SnatEntry is not stable status, can not operation | The specified SNAT entries are not in a stable state and cannot be operated. |
| 400 | OperationFailed.CanNotUseEipInDnat | Operation failed because the eip can not used by forward entry. | |
| 400 | OperationUnsupported.EipNatGWCheck | Operation unsupported because the relation check of eip and nat gateway is failed. | |
| 400 | ResourceNotFound.SnatEntry | Specified SNAT entry does not exist. | |
| 400 | IncorrectStatus.NatIp | Specified NatIp does not exist. | |
| 400 | OperationFailed.CanNotUseNatIpInDnat | Operation failed because the NatIp can not used by forward entry. | |
| 400 | IncorrectStatus.NATGW | NATGW status is invalid. | The NAT gateway is in an invalid state. |
| 400 | OperationUnsupported.EipInBinding | Create snat entry with eip in associating status is unsupported. | You cannot use an associated EIP when you create an SNAT entry. |
| 400 | OperationUnsupported.EipNatBWPCheck | The EIP is not associated with a NAT service plan. | The EIP is not associated with a NAT service plan. |
| 400 | IllegalParam.NetworkInterfaceId | The param of NetworkInterfaceId is illegal. | Invalid NetworkInterfaceId value. |
| 400 | OperationFailed.SnatIpPoolBwpRules | The operation failed because the IP in Snat entryl was added to multiple NAT bandwidth packets. | The operation failed because the IP in the SNAT rule IP address pool was added to multiple NAT bandwidth packets. |
| 400 | OperationFailed.SnatIpPoolCbwpRules | The operation failed because the SNAT rule IPs are added to multi bandwidth packages. | The operation failed because the SNAT rule IP address pool was added to multiple bandwidth packages. |
| 400 | OperationFailed.SnatIpsTooMany | The maximum number of IP addresses is exceeded in the SNAT pool. | The maximum number of IP addresses is exceeded in the SNAT pool. |
| 400 | OperationFailed.SnatIpsCheck | The operation fails because some IPs address in the SNAT entry are not added to common bandwidth packet. | The operation fails because the IP address in the Snat rule IP address pool is not added to the shared bandwidth packet. |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | |
| 404 | InvalidSnatTableId.NotFound | Specified SNAT table does not exist. | |
| 404 | InvalidSnatEntryId.NotFound | Specified SNAT entry does not exist. | |
| 404 | InvalidSnatIp.NotFound | Specified SnatIp does not found on the NAT Gateway | |
| 404 | ResourceNotFound.NatIp | Specified NatIp does not found on the NAT Gateway |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.