All Products
Search
Document Center

Virtual Private Cloud:ModifySnatEntry

Last Updated:Aug 29, 2024

Modifies an SNAT entry.

Operation description

ModifySnatEntry is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the DescribeSnatTableEntries operation to query the status of the task.

  • 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 SNAT entry is modified.
Note If an SNAT entry is in the Pending state, it indicates that you cannot modify the SNAT entry.

You cannot repeatedly call the ModifySnatEntry operation to modify an SNAT entry within a specific period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:ModifySnatEntryupdate
  • SnatTable
    acs:vpc:{#regionId}:{#accountId}:snattable/{#SnatTableId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the NAT gateway.

You can call the DescribeRegions operation to obtain the region ID.

cn-hangzhou
SnatTableIdstringYes

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

stb-8vbczigrhop8x5u3t****
SnatEntryIdstringYes

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

snat-bp1vcgcf8tm0plqcg****
SnatIpstringNo
  • The elastic IP addresses (EIPs) specified in the SNAT entry when you modify an SNAT entry of an Internet NAT gateway. Separate EIPs with commas (,).

    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.

  • When you modify an SNAT entry of a VPC NAT gateway, this parameter specifies the NAT IP address in the SNAT entry.

47.98.XX.XX
SnatEntryNamestringNo

The name of the SNAT entry.

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

SnatEntry-1
ClientTokenstringNo

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 client token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
02fb3da4-130e-11e9-8e44-001****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

2315DEB7-5E92-423A-91F7-4C1EC9AD97C3

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidSnatIp.MalformedThe specified SnatIp is not a valid IP address.The specified EIP is invalid.
400Forbidden.SourceVSwitchId.DuplicatedThe specified SourceCIDRis duplicated.An SNAT entry is already created for the specified vSwitch.
400Forbidden.IpUsedInForwardTableThe specified SnatIp already used in forward tableThe specified EIP is already used by a DNAT entry. Select another EIP or delete the DNAT rule that uses the specified EIP.
400OperationUnsupported.EipForSnatPoolThe Eip cannot support snat pool-
400InvalidParameter.Name.MalformedThe specified Name is not valid.The specified name format is invalid. Enter the name in the valid format.
400IncorretSnatEntryStatusThe Specified SnatEntry is not stable status, can not operation-
400OperationFailed.SnatIpsCheck%s-
400OperationFailed.SnatIpPoolCbwpRules%s-
400EIP_NOT_IN_GATEWAYThe Eip not in nat gateway-
400InvalidParameter.SnatIpError public ip must in same bandwidth package.-
400QuotaExceeded.SnatIpPublic ip number exceeds quota.-
400InvalidSnatEntryId.NotFoundSpecified SNAT entry does not exist.The specified SNAT entry does not exist. Check whether the SNAT entry is valid.
400OperationFailed.SnatIpPoolBwpRules%s-
400IncorrectStatus.SnatEntryThe Specified SnatEntry is not stable status, can not operationThe specified SNAT entries are not in a stable state and cannot be operated.
400OperationFailed.SnatIpsTooMany%s-
400OperationFailed.CanNotUseEipInDnatOperation failed because the eip can not used by forward entry.-
400OperationUnsupported.EipNatGWCheckOperation unsupported because the relation check of eip and nat gateway is failed.-
400ResourceNotFound.SnatEntrySpecified SNAT entry does not exist.The specified SNAT entry does not exist.
400IncorrectStatus.NatIpSpecified NatIp does not exist.-
400OperationFailed.CanNotUseNatIpInDnatOperation failed because the NatIp can not used by forward entry.-
400IncorrectStatus.NATGWNATGW status is invalid.The NAT gateway is in an invalid state.
404InvalidRegionId.NotFoundThe specified RegionId does not exist in our records.The specified region ID does not exist.
404InvalidSnatTableId.NotFoundSpecified SNAT table does not exist.The specified SNAT table does not exist.
404InvalidSnatIp.NotFoundSpecified SnatIp does not found on the NAT GatewayThe public IP address does not exist in the NAT gateway.
404ResourceNotFound.NatIpSpecified NatIp does not found on the NAT Gateway-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-08-09The Error code has changed. The request parameters of the API has changedView Change Details
2024-05-06The Error code has changed. The request parameters of the API has changedView Change Details
2024-01-18API Description Update. The Error code has changedView Change Details
2023-03-01The Error code has changedView Change Details