All Products
Search
Document Center

Virtual Private Cloud:ModifyNatGatewaySpec

Last Updated:Aug 29, 2024

Upgrades a subscription Internet NAT gateway.

Operation description

  • You cannot call this operation to downgrade a subscription Internet NAT gateway. You can downgrade a subscription 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 query the NAT gateway but cannot perform other operations.

    • If an Internet NAT gateway is in the Available state, the Internet NAT gateway is upgraded.
  • You cannot repeatedly call the ModifyNatGatewaySpec operation to resize a pay-by-specification NAT gateway.

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.

SizeMaximum number of connectionsNumber of new connections per second
Small10,0001,000
Medium50,0005,000
Large200,00010,000

Debugging

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

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region where the Internet NAT gateway is deployed.

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

cn-hangzhou
NatGatewayIdstringYes

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

ngw-bp1uewa15k4iy5770****
SpecstringYes

The size of the Internet NAT gateway. Valid values:

  • Small: small
  • Middle: medium
  • Large: large
Middle
AutoPaybooleanNo

Specifies whether to automatically complete the payment.

  • true: enables automatic payment. Payments are automatically completed.
  • false (default): disables automatic payment. If you select this option, you must go to the Order Center to complete the payment after an order is generated.
false
ClientTokenstringNo

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

123e4567-e89b-12d3-a456-426655****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

DBD4E4A2-786E-4BD2-8EB6-107FFC2B5B7D

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400NATGW_MODIFY_SPEC_SAMEThe specified Spec is same with now.The specified gateway size is the same as the current one.
400InvalidParameter.Spec.ValueNotSupportedThe specified Spec is not valid.The specification is invalid.
400OperationFailed.SyncOrderToSubSyncOrderToSub error.The operation failed.
400OperationFailed.QueryPriceQuery price failed when create order.Failed to query the price when creating the order.
404InvalidRegionId.NotFoundThe specified RegionId does not exist in our records.The specified region ID does not exist.
404InvalidNatGatewayId.NotFoundThe specified NatGatewayId does not exist in our records.The value of the NatGatewayId parameter is invalid.
404IncorrectStatus.NatGateway%s-
404OperationUnsupported.PayByLcuNatModifySpecThe spec of payByLcu nat is unsupported to modify.Pay-as-you-go NAT gateways cannot be resized.
404Forbidden.ModifySpecToSpecialSpecYou are not authorized to modify nat spec to special spec.-
404Forbidden.ModifySpecToSpecialSpecForNormalNatNormal NAT is not allowed to change to special spec, only enhanced nat allowed.-
500OperationFailed.NoAvailableResourceThe Zone have no available resource.No resources are available in the region.

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

Change history

Change timeSummary of changesOperation
2023-03-01The Error code has changedView Change Details
2022-07-22The Error code has changedView Change Details