Upgrades a subscription Internet NAT gateway.


  • You cannot call this operation to downgrade an Internet NAT gateway. You can downgrade an Internet NAT gateway only in the console.
  • When you call this operation to upgrade a subscription Internet NAT gateway, an order is generated. After you complete the payment in the order center, the Internet NAT gateway is upgraded.

ModifyNatGatewaySpec is an asynchronous operation. After you make a request, the ID of the request is returned but the Internet NAT gateway is not upgraded. The system upgrades the NAT gateway in the background. You can call the DescribeNatGateways operation to query the status of an Internet NAT gateway:

  • If an Internet NAT gateway is in the Modifying state, the NAT gateway is being upgraded. In this case, you can only perform query operations.
  • If an Internet NAT gateway is in the Available state, the Internet NAT gateway is upgraded.

Internet NAT gateways are available in different sizes. The size of an Internet NAT gateway determines the SNAT performance, which includes the maximum number of connections and the number of new connections per second. However, the size of a NAT gateway does not affect the data throughput. The following table describes the correlations between different sizes of Internet NAT gateways and SNAT performance metrics.


Maximum connection

Number of new connections per second











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

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyNatGatewaySpec

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

NatGatewayId String Yes ngw-bp1uewa15k4iy5770****

The ID of the Internet NAT gateway that you want to upgrade.

RegionId String Yes cn-hangzhou

The region ID of the Internet NAT gateway.

You can call the DescribeRegions operation to query the most recent region list.

Spec String Yes Middle

The size of the Internet NAT gateway. Valid values:

  • Small: small
  • Middle: medium
  • Large: large
AutoPay Boolean No false

Specifies whether to enable automatic payment. Valid values:

  • true: enables automatic payment. Payments are automatically made.
  • false: disables automatic payment. If you select this option, you must go to the Order Center to complete the payment after an order is generated.
ClientToken String No 123e4567-e89b-12d3-a456-426655****

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. ClientToken can contain only ASCII characters. It cannot exceed 64 characters in length.

Response parameters

Parameter Type Example Description
RequestId String DBD4E4A2-786E-4BD2-8EB6-107FFC2B5B7D

The ID of the request.


Sample requests

&<Common request parameters>

Sample success responses

XML format


JSON format

    "RequestId": "DBD4E4A2-786E-4BD2-8EB6-107FFC2B5B7D"

Error codes

HttpCode Error code Error message Description
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 InvalidNatGatewayId.NotFound The specified NatGatewayId does not exist in our records. The error message returned because the specified NAT gateway ID does not exist. Check whether the NAT gateway ID is valid.
400 NATGW_MODIFY_SPEC_SAME The specified Spec is same with now. The error message returned because the specified gateway size is the same as the current one.
400 InvalidParameter.Spec.ValueNotSupported The specified Spec is not valid. The error message returned because the specified gateway size is invalid.

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