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

Description

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 upgrading 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. Other operations are not supported.
    • 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.
  • Standard NAT gateways and enhanced NAT gateways use the same billing method and billable items.
  • It takes about 5 minutes to upgrade a standard NAT gateway to an enhanced NAT gateway. During the upgrade process, transient connections may occur once or twice.
  • 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 a sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateNatGatewayNatType

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

NatGatewayId String Yes ngw-bp1b0lic8uz4r6vf2****

The ID of the standard NAT gateway to be upgraded.

NatType String Yes Enhanced

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

RegionId String Yes cn-qingdao

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

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

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).
DryRun Boolean No false

Specifies whether to precheck this request. Valid values:

true: prechecks the request without upgrading the Internet NAT gateway. The system checks whether your AccessKey pair is valid, whether the Resource Access Management (RAM) user is authorized, and whether required parameters are set. If the request fails the precheck, the corresponding 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. ClientToken can contain only ASCII characters. It cannot exceed 64 characters in length.

Response parameters

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

The ID of the request.

Examples

Sample requests

http(s)://vpc.aliyuncs.com/?Action=UpdateNatGatewayNatType
&NatGatewayId=ngw-bp1b0lic8uz4r6vf2****
&NatType=Enhanced
&RegionId=cn-qingdao
&VSwitchId=vsw-bp17nszybg8epodke****
&<Common request parameters>

Sample success responses

XML format

<UpdateNatGatewayNatTypeResponse>    
      <RequestId>7C01CA72-73FD-4056-B16A-42E392D47625</RequestId>
</UpdateNatGatewayNatTypeResponse>

JSON format

{
    "RequestId": "7C01CA72-73FD-4056-B16A-42E392D47625"
}

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.
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 is not an 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 state 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 state 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 state 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 state 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 state 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 stock of 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 specified vSwitch and NAT gateway are not deployed in the same VPC.
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.

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