Modifies a specified Source Network Address Translation (SNAT) entry.

Descriptions

ModifySnatEntry is an asynchronous operation. After you make a request, the ID of the request is returned but the specified SNAT entry is not modified. The system modifies the entry in the background. You can call the DescribeNatGateways operation to query the status of the SNAT entry:

  • Pending: indicates that the system is modifying the SNAT entry. You can only query the status of the SNAT entry, but cannot perform other operations.
  • Available: indicates that the DNAT entry is modified.
Note Pending: indicates that you cannot modify the SNAT entry in the SNAT table.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifySnatEntry

The operation that you want to perform. Set the value to ModifySnatEntry.

RegionId String Yes cn-hangzhou

The ID of the region where the NAT gateway is deployed. You can call the DescribeRegions operation to query the most recent region list.

SnatEntryId String Yes snat-bp1vcgcf8tm0plqcg****

The ID of the SNAT entry that you want to modify.

SnatTableId String Yes stb-8vbczigrhop8x5u3t****

The ID of the SNAT table to which the SNAT entry belongs.

SnatIp String No 47.98.XX.XX

The EIP specified in the SNAT entry. Separate multiple EIPs with commas (,).

Note If you select multiple EIPs to create an SNAT address pool, connections are hashed to these EIPs. Network traffic may not be evenly distributed to the EIPs because the amount of traffic passes through each connection varies. We recommend that you associate these EIPs with the same EIP bandwidth plan to prevent service interruptions due to the bandwidth limit of an individual EIP.
SnatEntryName String No SnatEntry-1

The name of the SNAT entry.

The name must be 2 to 128 characters in length. It must start with a letter or Chinese character but cannot start with http:// or https://.

ClientToken String No 02fb3da4-130e-11e9-8e44-001****

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The ClientToken can contain only ASCII characters. It cannot exceed 64 characters in length.

Response parameters

Parameter Type Example Description
RequestId String 2315DEB7-5E92-423A-91F7-4C1EC9AD97C3

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifySnatEntry
&RegionId=cn-hangzhou
&SnatEntryId=snat-bp1vcgcf8tm0plqcg****
&SnatTableId=stb-8vbczigrhop8x5u3t****
&<Common request parameters>

Sample success responses

XML format

<ModifySnatEntryResponse>
      <RequestId>2315DEB7-5E92-423A-91F7-4C1EC9AD97C3</RequestId>
</ModifySnatEntryResponse>

JSON format

{
  "RequestId": "2315DEB7-5E92-423A-91F7-4C1EC9AD97C3"
}

Error codes

HttpCode Error code Error message Description
400 InvalidSnatIp.Malformed The specified SnatIp is not a valid IP address. The error message returned because the specified public IP address is invalid.
400 Forbidden.SourceVSwitchId.Duplicated The specified SourceCIDRis duplicated. The error message returned because a SNAT entry is already created for the specified vSwitch.
400 Forbidden.IpUsedInForwardTable The specified SnatIp already used in forward table The error message returned because the specified public IP address is already used by a DNAT entry. Select another public IP address or delete the DNAT rule that uses the specified public IP address.
400 InvalidParameter.Name.Malformed The specified Name is not valid. The error message returned because the specified name is invalid.
400 InvalidSnatEntryId.NotFound Specified SNAT entry does not exist. The error message returned because the specified SNAT entry does not exist. Check whether the SNAT entry is valid.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The error message returned because the specified region ID does not exist.
404 InvalidSnatTableId.NotFound Specified SNAT table does not exist. The error message returned because the specified SNAT table does not exist. Check whether the ID of the SNAT table is valid.
404 InvalidSnatIp.NotFound Specified SnatIp does not found on the NAT Gateway The error message returned because the specified public IP address is not found on the NAT gateway.

For a list of error codes, visit the API Error Center.