全部產品
Search
文件中心

Virtual Private Cloud:UpdateGatewayRouteTableEntryAttribute

更新時間:Oct 26, 2026

修改閘道器路由表的下一跳類型和下一跳。

調試

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

調試

授權資訊

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

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

是

要修改的閘道器路由表所在地域 ID。

您可以透過呼叫 DescribeRegions 介面取得地域 ID。

ap-southeast-6

IPv4GatewayRouteTableId

string

否

要修改的閘道器路由表 ID。

vtb-5ts0ohchwkp3dydt2****

GatewayRouteTableId

string

否

要修改的閘道器路由表 ID。

vtb-5ts0ohchwkp3dydt2****

ClientToken

string

否

用戶端 Token,用於保證請求的冪等性。

從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。

說明

若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 識別碼。每次 API 請求的 RequestId 不一樣。

123e4567-e89b-12d3-a456-426655440000

DryRun

boolean

否

是否只預檢此次請求。取值:

  • true:傳送檢查請求,不會修改閘道器路由表。檢查項目包括是否填寫了必要參數、請求格式、業務限制。如果檢查不通過,則傳回對應錯誤。如果檢查通過,則傳回錯誤碼 DryRunOperation。

  • false(預設值):傳送正常請求,通過檢查後傳回 HTTP 2xx 狀態碼並直接修改閘道器路由表。

false

DestinationCidrBlock

string

是

閘道器路由表的路由條目的目標網段。

47.100.XX.XX/16

NextHopType

string

是

要修改的路由條目下一跳類型。取值:

  • Instance:ECS 執行個體。

  • NetworkInterface:彈性網卡執行個體。

  • Local:本地。

Instance

NextHopId

string

否

要修改的下一跳的執行個體 ID。

  • 當 NextHopType 取值為 Instance 時,NextHopId 為 ECS 執行個體 ID。

  • 當 NextHopType 取值為 NetworkInterface 時,NextHopId 為彈性網卡執行個體 ID。

  • 當 NextHopType 取值為 Local 時,NextHopId 為空,表示本地。

說明

當路由條目的下一跳類型為 Instance 或 NetworkInterface 時需要修改下一跳,您需要先將 NextHopType 修改為 Local,然後再將 NextHopType 修改為 Instance 或 NetworkInterface 之後修改具體的 NextHopId。當下一跳類型為彈性網卡或 ECS 執行個體時,不支援直接修改下一跳為其他的彈性網卡或 ECS 執行個體。

i-bp18xq9yguxoxe7m****

Name

string

否

閘道器路由表的名稱。

長度為 2~128 個字元,必須以字母或中文開頭,可包含數字、半形句號(.)、底線(_)和短橫線(-)。

test

Description

string

否

閘道器路由表的描述資訊。

長度為 2~256 個字元,必須以字母或中文開頭,但不能以 http:// 或 https:// 開頭。

new

RegionId

string

是

要修改的閘道路由表所在地域 ID。

您可以透過呼叫 DescribeRegions 介面取得地域 ID。

ap-southeast-6

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

54B48E3D-DF70-471B-AA93-08E683A1B45

樣本

正常返回樣本

JSON格式

{
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 OperationDenied.UpdateGatewayRouteEntry The operation is not allowed because of need switch to local first. 修改閘道路由條目失敗,下一跳必須首先修改為local路由,才能自訂下一跳。
400 IllegalParam.DestCidrBlock The destCidrBlock is invalid. 傳入的目標位址不合法。
400 ResourceNotFound.NetworkInterface The specified resource nextHop is not found. 指定的網卡不存在。
400 ResourceNotFound.RouteEntry The specified resource routeEntry is not found. 指定的路由項目不存在。
400 IncorrectStatus.RouteEntry The status of %s [%s] is incorrect. 路由項目處於非穩態。
400 IncorrectStatus.Vswitch The status of %s [%s] is incorrect.
400 ResourceNotFound.Instance The specified resource nextHop is not found. 下一跳執行個體不存在。
400 IncorrectStatus.NextHop The status of %s [%s] is incorrect. 指定的下一跳資源處於非穩態。
400 OperationDenied.NextHopTypeNonsupport The operation is not allowed because of nextHopType is nonsupport. 不支援指定該資源類型為下一跳。
400 OperationDenied.LocalEntryCanOnlyModifyNextHop Only the nextHop parameter can be modified for a local route entry. Local路由只能修改下一跳屬性。
400 ExclusiveParam.NextHopTypeAndNextHopId The param of nextHopType and nextHopId are mutually exclusive. 下一跳類型和下一跳執行個體不匹配。
400 ResourceNotFound.RouteTable The specified resource gatewayRouteTable is not found. 閘道器路由表不存在。
400 InvalidRouterInterfaceId.NotFound The specified RouterInterfaceId does not exist in our record.
400 OperationUnsupported.OnlySupportNormalNetworkInterface Next hop only supports binding normal network Interface. 下一跳只支援綁定普通彈性網卡。
400 UnsupportedRegion The feature is not supported in current region. 本地區不支援操作 PrefixList 路由。
400 UnsupportedFeature.Ipv6GatewayRouteTable The feature of %s is not supported. 您指定的閘道器路由表暫不支援綁定該閘道器執行個體。
400 OperationDenied.TrAttachmentIpv6Disabled The operation is not allowed because tr attachment Ipv6 is disabled. Tr Attachment未開啟Ipv6能力。
400 InvalidAttachment.NotFound The attachment is not found. Attachment 不存在。
400 BothEmptyParam.GatewayRouteTableIdAndIpv4GatewayRouteTableId The parameter GatewayRouteTableId and Ipv4GatewayRouteTableId cannot be empty at the same time. We recommend that you use GatewayRouteTableId. 參數GatewayRouteTableId和Ipv4GatewayRouteTableId不能同時為空,建議您使用GatewayRouteTableId。
400 OperationUnsupported.Ipv6EntryOnPrimaryNetworkInterface You cannot create IPv6 route entries on a primary network interface. 不允許建立下一個躍點為主網卡的IPv6路由。
404 ResourceNotFound.GatewayLoadBalancerEndpoint GatewayLoadBalancerEndpoint instance not found. 未找到GatewayLoadBalancerEndpoint執行個體。

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

變更歷史

更多資訊,參考變更詳情。