调用UpdateNatGatewayNatType接口将普通型公网NAT网关升级为增强型公网NAT网关。

使用说明

调用UpdateNatGatewayNatType接口前,请先了解以下内容:

  • UpdateNatGatewayNatType接口属于异步接口,即系统会先返回一个请求ID,但NAT网关的网关类型并未升级完成,系统后台的升级任务仍在进行。您可以调用GetNatGatewayConvertStatus查询NAT网关的升级状态,更多信息,请参见GetNatGatewayConvertStatus
    • 当NAT网关的升级状态处于processing时,表示正在升级中,在该状态下,您只能执行查询操作,不能执行其他操作。
    • 当NAT网关的升级状态处于successful时,表示NAT网关的网关类型升级完成。
    • 当NAT网关的升级状态处于failed时,表示NAT网关的网关类型升级失败。
  • UpdateNatGatewayNatType接口在同一个NAT网关中不支持并发升级NAT网关的网关类型。
  • 增强型NAT网关与普通型NAT网关的计费相同,升级过程和升级后计费方式不会改变。
  • 每个资源升级过程可能会持续5分钟,升级过程中会出现1~2次秒级闪断,业务重连即可恢复。重连机制为自动重连还是手动重连由业务本身决定。
  • 仅支持将普通型NAT网关升级至增强型NAT网关,不支持将增强型NAT网关降级至普通型NAT网关。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
RegionId String cn-qingdao

要升级的普通型公网NAT网关所属的地域ID。

您可以通过调用DescribeRegions接口获取地域ID。

NatGatewayId String ngw-bp1b0lic8uz4r6vf2****

要升级的普通型公网NAT网关实例ID。

VSwitchId String vsw-bp17nszybg8epodke****

升级后增强型公网NAT网关所属的交换机。

说明 如果不设置该参数,系统会随机将增强型公网NAT网关创建在VPC内的任意一台交换机。
NatType String Enhanced

公网NAT网关类型。取值:Enhanced,表示增强型公网NAT网关。

DryRun Boolean false

是否只预检此次请求,取值:

true:发送请求,不会升级公网NAT网关类型。检查项包括AccessKey是否有效、RAM用户的授权情况和是否填写了必需参数。如果检查不通过,则返回对应错误。如果检查通过,会返回错误码DryRunOperation

false(默认值):发送正常请求,通过检查后返回2xx HTTP状态码并直接升级公网NAT网关类型。

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

客户端Token,用于保证请求的幂等性。

从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符。

说明 若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId可能不一样。
Action String UpdateNatGatewayNatType

系统规定参数。取值:UpdateNatGatewayNatType

返回数据

名称 类型 示例值 描述
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

请求ID。

示例

请求示例

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

正常返回示例

XML格式

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

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

JSON格式

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

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

错误码

HttpCode 错误码 错误信息 描述
400 OperationUnsupported.NatConvert The NAT gateway conversion function is not supported. NAT网关类型转换功能未支持。
400 NATGW_NOT_EXIST The specified NAT gateway does not exist. 该 NAT 网关不存在。
400 OperationFailed.VpcNotExist The specified VPC does not exist. 指定的VPC不存在。
400 OperationFailed.VswNotExist The specified VSwitch does not exist. 指定的交换机不存在。
400 OperationFailed.NatTypeNotEnhanced Operation failed because the specified NAT gateway type is not enhanced. 操作失败因为指定的NAT网关类型不是增强型。
400 OperationFailed.NatGwBindWithBandwidthPackage Operation failed because the NAT gateway is bound to bandwidth packages. 操作失败因为NAT网关实例绑定了NAT带宽包。
400 IncorrectStatus.NatGateway The status of NAT gateway is incorrect. NAT网关状态不对。
400 OperationFailed.EipInMiddleStatus Operation failed because the status of EIP associated with the specified NAT gateway is abnormal. 操作失败因为绑定在此NAT网关上的EIP状态异常。
400 OperationFailed.SnatInMiddleStatus Operation failed because the status of the SNAT entry of the specified NAT gateway is abnormal. 操作失败因为指定的NAT网关的SNAT条目状态异常。
400 OperationFailed.DnatInMiddleStatus Operation failed because the status of the DNAT entry associated with the NAT gateway is abnormal. 操作失败因为NAT网关的DNAT规则状态异常。
400 OperationFailed.NatGwRouteInMiddleStatus Operation failed because the status of the route entry associated with the NAT gateway is abnormal. 操作失败因为NAT网关相关的路由条目状态异常。
400 OperationFailed.EnhancedInventoryNotEnough The enhanced NAT gateway inventory is insufficient in the specified zone. 当前可用区增强NAT网关库存不足.
400 OperationFailed.EnhancedUserIsUnAuthorized Operation failed because the user is not authorized to create an enhanced NAT gateway. 操作失败因为用户未授权创建增强型NAT网关。
400 OperationFailed.EnhancedRegion Operation failed because enhanced NAT gateways are not available for sale in the specified region. 操作失败因为当前地域未开启增强型NAT网关售卖。
400 OperationFailed.EnhancedQuotaExceed Operation failed because the maximum number of enhanced NAT gateways in the same VPC is exceeded. 操作失败因为当前VPC下的增强型NAT网关数量超过限制。
400 InvalidBandwidthPackageIdNumber.NotSupported The number of BandwidthPackageIds exceeds the limit. 共享带宽包的数量超过Quota限制。
400 OperationFailed.VswNotBelongToVpc Operation failed because the specified VSwitch is not bound to the same VPC with NAT gateway. 操作失败,因为交换机和NAT网关不属于同一个VPC。
400 OperationUnsupported.VpcAttachedCen Operation failed because the VPC is attached to CEN. 操作失败因为VPC加入了CEN。
400 OperationUnsupported.RouterInterfaceExist Operation failed because the VPC has a router interface. 操作失败因为VPC有路由器接口存在。
400 OperationFailed.VRouterNotExist Operation failed because the VRouter does not exist. 操作失败因为虚拟路由器不存在。
400 OperationFailed.SnatQuotaExceed Operation failed because the maximum number of SNAT entry is exceeded. 操作失败因为SNAT条目数量过多。
400 OperationFailed.DnatQuotaExceed Operation failed because the maximum number of forward entry is exceeded. 操作失败因为DNAT条目数量过多。
400 OperationFailed.VswBindedRouteTable The operation failed because a custom route table that contains subnet routes is associated with the specified VSwitch. 操作失败因为vSwitch绑定了子网路由表。
400 OperationFailed.VswBindedAcl The operation failed because a network ACL is associated with the specified VSwitch. 操作失败因为指定的vSwitch绑定了网络ACL。
400 Forbidden.Convert User does not have permission to operate. 该用户没有权限操作。
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. 指定的RegionId不存在。

访问错误中心查看更多错误码。