All Products
Search
Document Center

Virtual Private Cloud:UpdateNatGatewayNatType

Last Updated:Mar 04, 2024

Upgrades a standard NAT gateway to an enhanced NAT gateway.

Operation description

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

  • UpdateNatGatewayNatType is an asynchronous operation. After you send a request to call this operation, the system returns a request ID and the NAT gateway is still being upgraded in the backend. You can call the GetNatGatewayConvertStatus operation to query the upgrade progress of a NAT gateway. For more information, see GetNatGatewayConvertStatus .

    • If the NAT gateway is in the processing state, the NAT gateway is being upgraded. You can only query the status of the NAT gateway but cannot perform other operations.
    • If the NAT gateway is in the successful state, the NAT gateway is upgraded.
    • If the NAT gateway is in the failed state, the system failed to upgrade the NAT gateway.
  • You cannot repeatedly call the UpdateNatGatewayNatType operation for the same VPN gateway within the specified period of time.

  • The billing method and billable items remain the same after the upgrade.

  • It takes about five minutes to upgrade a standard NAT gateway to an enhanced NAT gateway. During the upgrade, transient connection errors may occur once or twice. The service can be recovered by reconnection. 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.

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:UpdateNatGatewayNatTypeWrite
  • NatGateway
    acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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.

cn-qingdao
NatGatewayIdstringYes

The ID of the standard NAT gateway to be upgraded.

ngw-bp1b0lic8uz4r6vf2****
VSwitchIdstringYes

The vSwitch to which the enhanced Internet NAT gateway belongs.

Note If you do not set this parameter, the system generates an Internet NAT gateway in a random vSwitch of a virtual private cloud (VPC).
vsw-bp17nszybg8epodke****
NatTypestringYes

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

Enhanced
DryRunbooleanNo

Specifies whether to only 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 RAM users are granted required permissions, and whether the required parameters are set. If the request fails to pass the precheck, an error code is returned. If the request passes the precheck, the DryRunOperation error code is returned.

false: sends the API request. This is the default value. After the request passes the precheck, a 2XX HTTP status code is returned and the Internet NAT gateway is upgraded.

false
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate a value, and you must make sure that each request has a unique token value. The client token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the value of RequestId as the value of ClientToken. The request ID may be different for each request.
0c593ea1-3bea-11e9-b96b-88e9fe637760

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400OperationUnsupported.NatConvertThe NAT gateway conversion function is not supported.The NAT gateway conversion function is not supported.
400NATGW_NOT_EXISTThe specified NAT gateway does not exist.The specified NAT gateway does not exist.
400OperationFailed.VpcNotExistThe specified VPC does not exist.The specified VPC does not exist.
400OperationFailed.VswNotExistThe specified VSwitch does not exist.The specified VSwitch does not exist.
400OperationFailed.NatTypeNotEnhancedOperation failed because the specified NAT gateway type is not enhanced.Operation failed because the specified NAT gateway type is not enhanced.
400OperationFailed.NatGwBindWithBandwidthPackageOperation failed because the NAT gateway is bound to bandwidth packages.Operation failed because the NAT gateway is bound to bandwidth packages.
400IncorrectStatus.NatGatewayThe status of NAT gateway is incorrect.The status of NAT gateway is incorrect.
400OperationFailed.EipInMiddleStatusOperation failed because the status of EIP associated with the specified NAT gateway is abnormal.Operation failed because the status of EIP associated with the specified NAT gateway is abnormal.
400OperationFailed.SnatInMiddleStatusOperation failed because the status of the SNAT entry of the specified NAT gateway is abnormal.Operation failed because the status of the SNAT entry of the specified NAT gateway is abnormal.
400OperationFailed.DnatInMiddleStatusOperation failed because the status of the DNAT entry associated with the NAT gateway is abnormal.Operation failed because the status of the DNAT entry associated with the NAT gateway is abnormal.
400OperationFailed.NatGwRouteInMiddleStatusOperation failed because the status of the route entry associated with the NAT gateway is abnormal.Operation failed because the status of the route entry associated with the NAT gateway is abnormal.
400OperationFailed.EnhancedInventoryNotEnoughThe enhanced NAT gateway inventory is insufficient in the specified zone.The stock of enhanced NAT gateways is insufficient in the specified zone.
400OperationFailed.EnhancedUserIsUnAuthorizedOperation failed because the user is not authorized to create an enhanced NAT gateway.Operation failed because the user is not authorized to create an enhanced NAT gateway.
400OperationFailed.EnhancedRegionOperation failed because enhanced NAT gateways are not available for sale in the specified region.Operation failed because enhanced NAT gateways are not available for sale in the specified region.
400OperationFailed.EnhancedQuotaExceedOperation failed because the maximum number of enhanced NAT gateways in the same VPC is exceeded.Operation failed because the maximum number of enhanced NAT gateways in the same VPC is exceeded.
400InvalidBandwidthPackageIdNumber.NotSupportedThe number of BandwidthPackageIds exceeds the limit.The number of BandwidthPackageIds exceeds the limit.
400OperationFailed.VswNotBelongToVpcOperation failed because the specified VSwitch is not bound to the same VPC with NAT gateway.The vSwitch and NAT gateway do not belong to the same VPC.
400OperationUnsupported.VpcAttachedCenOperation failed because the VPC is attached to CEN.Operation failed because the VPC is attached to CEN.
400OperationUnsupported.RouterInterfaceExistOperation failed because the VPC has a router interface.The VPC has a router interface.
400OperationFailed.VRouterNotExistOperation failed because the VRouter does not exist.Operation failed because the VRouter does not exist.
400OperationFailed.SnatQuotaExceedOperation failed because the maximum number of SNAT entry is exceeded.Operation failed because the maximum number of SNAT entry is exceeded.
400OperationFailed.DnatQuotaExceedOperation failed because the maximum number of forward entry is exceeded.Operation failed because the maximum number of forward entry is exceeded.
400OperationFailed.VswBindedRouteTableThe operation failed because a custom route table that contains subnet routes is associated with the specified VSwitch.The specified vSwitch is associated with a subnet route table.
400OperationFailed.VswBindedAclThe operation failed because a network ACL is associated with the specified VSwitch.The specified vSwitch is associated with a network ACL.
400Forbidden.ConvertUser does not have permission to operate.-
404InvalidRegionId.NotFoundThe specified RegionId does not exist in our records.The specified region ID does not exist.

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

Change history

Change timeSummary of changesOperation
2023-03-01The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 404