Upgrades a standard Internet NAT gateway to an enhanced Internet NAT gateway.

Usage notes

Before you call this operation, take note of the following limits:

  • UpdateNatGatewayNatType is an asynchronous operation. After you make a request, the ID of the request is returned but the NAT gateway is not upgraded. The system upgrades the NAT gateway in the background. You can call the GetNatGatewayConvertStatus operation to query the upgrade progress of a NAT gateway. For more information, see GetNatGatewayConvertStatus.
    • If a NAT gateway is in the processing state, it indicates that the NAT gateway is being upgraded. You can only query the state of the NAT gateway but cannot perform other operations.
    • If a NAT gateway is in the successful state, it indicates that the NAT gateway is upgraded.
    • If a NAT gateway is in the failed state, it indicates that the system failed to upgrade the NAT gateway.
  • You cannot repeatedly call the UpdateNatGatewayNatType operation to upgrade a NAT gateway within the specified period of time.
  • The billing method and billable items remain the same after the upgrade.
  • It takes about 5 minutes to upgrade a standard NAT gateway to an enhanced NAT gateway. During the upgrade, transient connections may occur once or twice. You can determine whether to enable automatic reconnection or use manual reconnection based on your business requirements.
  • You can only upgrade standard NAT gateways to enhanced NAT gateways. You are not allowed to downgrade enhanced NAT gateways to standard NAT gateways.

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
RegionId String Yes cn-qingdao

The ID of the region where the NAT gateway that you want to upgrade is deployed.

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

NatGatewayId String Yes ngw-bp1b0lic8uz4r6vf2****

The ID of the standard NAT gateway to be upgraded.

VSwitchId String Yes vsw-bp17nszybg8epodke****

The vSwitch to which the enhanced Internet NAT gateway belongs.

Note If you do not set this parameter, the system creates an Internet NAT gateway in a random vSwitch of a virtual private cloud (VPC).
NatType String Yes Enhanced

The type of Internet NAT gateway. Set the value to Enhanced, which specifies an enhanced Internet NAT gateway.

DryRun Boolean No false

Specifies whether only to precheck this request. Valid values:

true: prechecks the request but does not upgrade the Internet NAT gateway. The system checks your AccessKey pair, the Resource Access Management (RAM) user permissions, and the required parameters. If the request fails the precheck, an error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.

false (default): If the request passes the precheck, a 2XX HTTP status code is returned and the standard NAT gateway is upgraded.

ClientToken String No 0c593ea1-3bea-11e9-b96b-88e9fe637760

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

Note If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId for each API request may be different.
Action String Yes UpdateNatGatewayNatType

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

Response parameters

Parameter Type Example Description
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=cn-qingdao
&NatGatewayId=ngw-bp1b0lic8uz4r6vf2****
&VSwitchId=vsw-bp17nszybg8epodke****
&NatType=Enhanced
&DryRun=false
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe637760
&Action=UpdateNatGatewayNatType
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateNatGatewayNatTypeResponse>
    <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
</UpdateNatGatewayNatTypeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}

Error codes

HttpCode Error code Error message Description
400 OperationUnsupported.NatConvert The NAT gateway conversion function is not supported. The error message returned because the NAT gateway upgrade feature is not supported.
400 NATGW_NOT_EXIST The specified NAT gateway does not exist. The error message returned because the specified NAT gateway does not exist.
400 OperationFailed.VpcNotExist The specified VPC does not exist. The error message returned because the specified VPC does not exist.
400 OperationFailed.VswNotExist The specified VSwitch does not exist. The error message returned because the specified vSwitch does not exist.
400 OperationFailed.NatTypeNotEnhanced Operation failed because the specified NAT gateway type is not enhanced. The error message returned because the specified gateway type is not enhanced NAT gateway.
400 OperationFailed.NatGwBindWithBandwidthPackage Operation failed because the NAT gateway is bound to bandwidth packages. The error message returned because one or more NAT service plans are associated with the NAT gateway.
400 IncorrectStatus.NatGateway The status of NAT gateway is incorrect. The error message returned because the status of the NAT gateway is invalid.
400 OperationFailed.EipInMiddleStatus Operation failed because the status of EIP associated with the specified NAT gateway is abnormal. The error message returned because the status of the elastic IP address (EIP) that is associated with the specified NAT gateway is abnormal.
400 OperationFailed.SnatInMiddleStatus Operation failed because the status of the SNAT entry of the specified NAT gateway is abnormal. The error message returned because the status of the Source Network Address Translation (SNAT) entry for the NAT gateway is abnormal.
400 OperationFailed.DnatInMiddleStatus Operation failed because the status of the DNAT entry associated with the NAT gateway is abnormal. The error message returned because the status of the Destination Network Address Translation (DNAT) entry for the NAT gateway is abnormal.
400 OperationFailed.NatGwRouteInMiddleStatus Operation failed because the status of the route entry associated with the NAT gateway is abnormal. The error message returned because the status of the route entry that is associated with the NAT gateway is abnormal.
400 OperationFailed.EnhancedInventoryNotEnough The enhanced NAT gateway inventory is insufficient in the specified zone. The error message returned because the quota on enhanced NAT gateways is insufficient in the specified zone.
400 OperationFailed.EnhancedUserIsUnAuthorized Operation failed because the user is not authorized to create an enhanced NAT gateway. The error message returned because you do not have the permissions to create enhanced NAT gateways.
400 OperationFailed.EnhancedRegion Operation failed because enhanced NAT gateways are not available for sale in the specified region. The error message returned because enhanced NAT gateways are not available for sale in the specified region.
400 OperationFailed.EnhancedQuotaExceed Operation failed because the maximum number of enhanced NAT gateways in the same VPC is exceeded. The error message returned because the number of enhanced NAT gateways in the specified VPC has reached the upper limit.
400 InvalidBandwidthPackageIdNumber.NotSupported The number of BandwidthPackageIds exceeds the limit. The error message returned because the number of EIP bandwidth plans has reached the upper limit.
400 OperationFailed.VswNotBelongToVpc Operation failed because the specified VSwitch is not bound to the same VPC with NAT gateway. The error message returned because the vSwitch and NAT gateway do not belong to the same VPC and the operation failed.
400 OperationUnsupported.VpcAttachedCen Operation failed because the VPC is attached to CEN. The error message returned because the VPC is attached to a Cloud Enterprise Network (CEN) instance.
400 OperationUnsupported.RouterInterfaceExist Operation failed because the VPC has a router interface. The error message returned because the VPC has a router interface.
400 OperationFailed.VRouterNotExist Operation failed because the VRouter does not exist. The error message returned because the vRouter does not exist.
400 OperationFailed.SnatQuotaExceed Operation failed because the maximum number of SNAT entry is exceeded. The error message returned because the number of SNAT entries has reached the upper limit.
400 OperationFailed.DnatQuotaExceed Operation failed because the maximum number of forward entry is exceeded. The error message returned because the number of DNAT entries has reached the upper limit.
400 OperationFailed.VswBindedRouteTable The operation failed because a custom route table that contains subnet routes is associated with the specified VSwitch. The error message returned because the specified vSwitch is associated with a subnet route table.
400 OperationFailed.VswBindedAcl The operation failed because a network ACL is associated with the specified VSwitch. The error message returned because the specified vSwitch is associated with a network ACL.
400 Forbidden.Convert User does not have permission to operate. The error message returned because you are not authorized to perform the operation.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The error message returned because the specified region ID does not exist.

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