全部產品
Search
文件中心

NAT Gateway:ModifyNatGatewayAttribute - 修改NAT Gateway的屬性

更新時間:Apr 27, 2026

調用ModifyNatGatewayAttribute介面修改NAT Gateway的屬性。

介面說明

本介面查詢的 NAT Gateway包括公網 NAT Gateway和 VPC NAT Gateway,文中出現的“NAT Gateway”不做具體的區分。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

要修改的 NAT Gateway所在的地區 ID。

您可以通過調用 DescribeRegions 介面擷取地區 ID。

cn-hangzhou

NatGatewayId

string

要修改的 NAT Gateway的 ID。

ngw-2ze0dcn4mq31qx2jc****

Name

string

要修改的 NAT Gateway名稱。

名稱長度為 1~128 個字元,不能以http://https://開頭。

nat123

Description

string

要修改的 NAT Gateway描述資訊。

描述長度為 1~128 個字元,不能以http://https://開頭。

Description

IcmpReplyEnabled

boolean

是否開啟 ICMP 代回。取值:

  • true(預設值):開啟。

  • false:不開啟。

true

EipBindMode

string

修改 NAT Gateway的 EIP 繫結模式。取值:可以為空白,非空時只允許為 NAT,表示繫結模式為 EIP 普通模式。

說明
  • 只支援將MULTI_BINDED模式修改為 NAT 模式,不支援將 NAT 模式修改為MULTI_BINDED模式。關於MULTI_BINDED模式的具體資訊,請參見 CreateNatGateway

  • 在 EIP 繫結模式切換過程中網路連接會出現秒層級閃斷(閃斷時間隨著 EIP 數量增加而變長,目前最多支援綁定 5 個 EIP 的 NAT Gateway進行配置變更),請您盡量在業務低峰期執行切換操作。

  • EIP 繫結模式變更為 NAT 後,公網 NAT Gateway將相容 IPv4 網關,但綁定一個公網 EIP 時將佔用 NAT Gateway所在交換器的一個私網 IP,請確保 NAT Gateway所在交換器內私網 IP 位址充足,如果 NAT Gateway所在的交換器沒有可用的空閑私網地址時,將無法綁定新的 EIP。

NAT

EnableSessionLog

boolean

是否開啟會話日誌,取值:

  • true:已開啟會話日誌。

  • false:已關閉會話日誌。

true

LogDelivery

object

會話日誌配置資訊。

LogDeliveryType

string

會話日誌寫入類型。取值:sls,阿里雲Log Service SLS。

sls

LogDestination

string

會話日誌寫入地址。取值:acs:log:${regionName}:${projectOwnerAliUid}:project/${projectName}/logstore/${logstoreName}

acs:log:cn-hangzhou:0000:project/nat_session_log_project/logstore/session_log_test

返回參數

名稱

類型

描述

樣本值

object

請求 ID。

RequestId

string

請求 ID。

AB5F62CF-2B60-4458-A756-42C9DFE108D1

樣本

正常返回樣本

JSON格式

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

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 UnsupportedFeature.PrivateLinkMode The feature of %s is not supported. 暫不支援反向訪問特性。
400 IncorrectStatus.NATGW NATGW status is invalid. NAT Gateway的狀態不正確。
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 Gateway的狀態不正確。
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 Gateway不支援修改EIP的綁定類型。
400 UnsupportedFeature.NormalNatModifyEipBindMode The normal NAT gateway is not support to change EIP bond type. 普通型NAT Gateway不支援修改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 Gateway不支援開啟安全防護。
400 OperationDenied.NatGatewayStatusInvalid The NAT gateway status is invalid. NAT Gateway的狀態無效。
400 OperationDenied.EipStatusInvalid The NAT gateway has EIP in invalid status. NAT Gateway綁定的EIP狀態無效。
400 OperationDenied.SnatEntryStatusInvalid The NAT gateway has SNAT entry in invalid status. NAT Gateway配置的SNAT條目狀態無效。
400 OperationDenied.DnatEntryStatusInvalid The NAT gateway has DNAT entry in invalid status. NAT Gateway配置的DNAT狀態無效。
400 UnsupportedFeature.MutilBindedTypeNatEnableFw The NAT with Mutil-Binded Eip bind type is not support enable firewall. 以Mutil-Binded方式綁定EIP的NAT不允許開啟防火牆。
400 Forbidden.FinancialLocked The instance is locked due to outstanding payments. 該執行個體已欠費鎖定,無法操作
400 OperationFailed.PrivateLinkMode The NAT gateway is not support to change PrivateLinkMode. 當前NAT Gateway不支援修改PrivateLinkMode。
400 IllegalParam.SessionLogDeliveryDestination The specified Delivery Destination is illegal. 會話日誌投遞目標參數(SessionLogDeliveryDestination)配置格式無效
400 OperationFailed.LogDeliveryIsUnAuthorized Operation failed because the user is not authorized to deliver NAT session log. 操作失敗因為您未授權NAT會話日誌投遞許可權
400 IllegalParam.SessionLogDeliveryType The specified Delivery Type is illegal. 會話日誌投遞目標型別參數SessionLogDeliveryType輸入不符合要求
400 UnsupportedFeature.EnableSessionLog The feature of EnableSessionLog is not supported. 當前執行個體不支援開啟NAT Gateway會話日誌。
500 OperationFailed.ConfigSessionLog Failed to configure session log due to a temporary failure of the server. 由於內部服務錯誤引起配置會話日誌失敗.
403 Forbidden.ModifyEipBondType Authentication is failed for modify EIP bond type. 不允許修改EIP綁定類型。
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records.
404 InvalidNatGatewayId.NotFound The specified NatGatewayId does not exist in our records.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情