调用ModifyNatGatewayAttribute接口修改NAT网关的名称和描述。

使用说明

本接口查询的NAT网关包括公网NAT网关和VPC NAT网关,文中出现的“NAT网关”不做具体的区分。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String ModifyNatGatewayAttribute

系统规定参数。取值:ModifyNatGatewayAttribute

RegionId String cn-hangzhou

要修改的NAT网关所在的地域ID。

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

NatGatewayId String ngw-2ze0dcn4mq31qx2jc****

要修改的NAT网关的ID。

Name String nat123

要修改的NAT网关名称。

长度为1~128个字符,必须以字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。但不能以http://https://开头。

Description String Description

要修改的NAT网关描述信息。

长度为1~256个字符,必须以字母或中文开头,但不能以http://https://开头。

IcmpReplyEnabled Boolean false

是否开启ICMP不代回功能。取值:

  • false(默认值):不开启。
  • true:开启。
EipBindMode String NAT

修改NAT网关的EIP绑定模式。取值:可以为空,非空时只允许为NAT,表示绑定模式为EIP普通模式。

说明
  • 只支持将MULTI_BINDED模式修改为NAT模式,不支持将NAT模式修改为MULTI_BINDED模式。
  • 在EIP绑定模式切换过程中网络连接会出现秒级别闪断(闪断时间随着EIP数量增加而变长,目前最多支持绑定5个EIP的NAT网关进行配置变更),请您尽量在业务低峰期执行切换操作。
  • EIP绑定模式变更为NAT后,公网NAT网关将兼容IPv4网关,但绑定一个公网EIP时将占用NAT网关所在交换机的一个私网IP,请确保NAT网关所在交换机内私网IP地址充足,如果NAT网关所在的交换机没有可用的空闲私网地址时,将无法绑定新的EIP。

返回数据

名称 类型 示例值 描述
RequestId String AB5F62CF-2B60-4458-A756-42C9DFE108D1

请求ID。

示例

请求示例

http(s)://[Endpoint]/?Action=ModifyNatGatewayAttribute
&RegionId=cn-hangzhou
&NatGatewayId=ngw-2ze0dcn4mq31qx2jc****
&Name=nat123
&Description=Description
&IcmpReplyEnabled=false
&EipBindMode=NAT
&公共请求参数

正常返回示例

XML格式

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

<ModifyNatGatewayAttributeResponse>
    <RequestId>AB5F62CF-2B60-4458-A756-42C9DFE108D1</RequestId>
</ModifyNatGatewayAttributeResponse>

JSON格式

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

{
  "RequestId" : "AB5F62CF-2B60-4458-A756-42C9DFE108D1"
}

错误码

HttpCode 错误码 错误信息 描述
400 UnsupportedFeature.PrivateLinkMode The feature of %s is not supported. 暂不支持反向访问特性。
400 IncorrectStatus.NATGW NATGW status is invalid. NAT网关的状态不正确。
400 ExclusiveParam.%sAnd%s The param of %s and %s are mutually exclusive. 参数 %s 和 %s 相互排斥。
400 IncorrectStatus.NatGateway The status of natgateway is incorrect. NAT网关的状态不正确。
400 DependencyViolation.PrivateLinkMode The specified resource of %s depends on %s, so the operation cannot be completed. %s 资源依赖于 %s,因此本操作不能完成。
400 UnsupportedFeature.IcmpReplyEnabled The feature of IcmpReplyEnabled is not supported. Icmp 代答使能功能修改不支持。
400 InvalidParams.NotNull The parameter must not be null, name or description or icmpReplyEnabled 名称、描述以及icmp代答使能参数不能同时为空。
400 InvalidParameter.Name.Malformed The specified Name is not valid. 该名称不合法,请您按照正确的格式书写名称。
400 InvalidParameter.Description.Malformed The specified Description is not valid. 该描述不合法。
400 UnsupportedFeature.IndirectConvertForVpcNat The VPC NAT gateway is not support to change EIP bond type. VPC NAT网关不支持修改EIP的绑定类型。
400 UnsupportedFeature.NormalNatModifyEipBindMode The normal NAT gateway is not support to change EIP bond type. 普通型NAT网关不支持修改EIP绑定类型。
400 OperationDenied.EipBondTypeIsAlreadyNAT The EIP bond type is already NAT type. EIP绑定类型已经是NAT类型。
400 UnsupportedFeature.IndirectConvertForFwNat The security protection enabled NAT gateway is not support change EIP bond type. 开启防护功能的公网NAT不支持修改EIP绑定类型。
400 QuotaExceeded.EipNumForModifyEipBondType The quota of %s is exceeded, binded: %s, quota: %s. 修改EIP绑定类型时允许的EIP个数超限
400 ResourceNotEnough.SwitchAvailableIps The available private Ip number is not enough in your subnet. 子网中可用的私网IP不足。
400 UnsupportedFeature.VpcNatSecurityProtectionEnabled The VPC NAT gateway is not supported to enable security protection. VPC NAT网关不支持开启安全防护。
400 OperationDenied.NatGatewayStatusInvalid The NAT gateway status is invalid. NAT网关的状态无效。
400 OperationDenied.EipStatusInvalid The NAT gateway has EIP in invalid status. NAT网关绑定的EIP状态无效。
400 OperationDenied.SnatEntryStatusInvalid The NAT gateway has SNAT entry in invalid status. NAT网关配置的SNAT条目状态无效。
400 OperationDenied.DnatEntryStatusInvalid The NAT gateway has DNAT entry in invalid status. NAT网关配置的DNAT状态无效。
400 UnsupportedFeature.MutilBindedTypeNatEnableFw The NAT with Mutil-Binded Eip bind type is not support enable firewall. 以Mutil-Binded方式绑定EIP的NAT不允许开启防火墙。
403 Forbidden.ModifyEipBondType Authentication is failed for modify EIP bond type. 不允许修改EIP绑定类型。
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. 指定的RegionId不存在。
404 InvalidNatGatewayId.NotFound The specified NatGatewayId does not exist in our records. 指定的 NatGatewayId 不存在,请您检查填写的 NatGatewayId 是否正确。

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