全部產品
Search
文件中心

Virtual Private Cloud:ModifyRouteEntry

更新時間:Sep 07, 2026

呼叫ModifyRouteEntry修改自訂路由條目的名稱、描述和路由下一跳。

介面說明

  • ModifyRouteEntry 介面不支援並行修改同一個自訂路由條目的名稱和描述。

  • ModifyRouteEntry 介面在並行情況下可能回傳 TaskConflict 錯誤碼,請視情況重試。

調試

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

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

vpc:ModifyRouteEntry

update

*RouteTable

acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId}

無 無

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

是

路由條目所在的地域 ID。

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

cn-hangzhou

RouteEntryName

string

否

路由條目的名稱。

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

EntryName

RouteEntryId

string

否

自訂路由條目 ID。

rte-acfvgfsghfdd****

Description

string

否

路由條目的描述。

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

EntryDescription

NewNextHopType

string

否

新路由條目下一跳類型。取值如下:

  • Instance:ECS 執行個體。

  • HaVip:高可用虛擬 IP。

  • RouterInterface:路由器介面。

  • NetworkInterface:彈性網卡。

  • VpnGateway:VPN 閘道器。

  • IPv6Gateway:IPv6 閘道器。

  • NatGateway:NAT 閘道器。

  • Attachment:轉送路由器。

  • VpcPeer:VPC 對等連線。

  • Ipv4Gateway:IPv4 閘道器。

  • GatewayEndpoint:閘道器終端節點。

  • Ecr:專線閘道器。

  • GatewayLoadBalancerEndpoint:閘道器型負載平衡終端節點。

  • RouteTargetGroup:路由目標群組。

枚舉值:

  • HaVip :

    HaVip

  • VpnGateway :

    VpnGateway

  • RouteTargetGroup :

    RouteTargetGroup

  • GatewayLoadBalancerEndpoint :

    GatewayLoadBalancerEndpoint

  • VpcPeer :

    VpcPeer

  • Instance :

    Instance

  • NetworkInterface :

    NetworkInterface

  • NatGateway :

    NatGateway

  • Attachment :

    Attachment

  • Ipv4Gateway :

    Ipv4Gateway

  • GatewayEndpoint :

    GatewayEndpoint

  • Ecr :

    Ecr

  • RouterInterface :

    RouterInterface

  • IPv6Gateway :

    IPv6Gateway

NetworkInterface

NewNextHopId

string

否

新路由條目下一跳執行個體 ID。

eni-bp17y37ytsenqyim****

RouteTableId

string

否

路由表 ID。

vtb-bp1nk7zk65du3pni8z9td

DestinationCidrBlock

string

否

路由條目的目標網段,支援 IPv4 網段、IPv6 網段。

說明

當 RouteEntryId 參數未輸入時,DestinationCidrBlock 和 RouteTableId 參數必填。 當需要修改路由的目標網段為 首碼清單 時,必須傳入 RouteEntryId 參數,且 DestinationCidrBlock 參數不支援傳入首碼清單網段或首碼清單執行個體 ID。

192.168.0.0/24

DryRun

boolean

否

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

true:發送請求,不會修改路由條目。檢查項目包括 AccessKey 是否有效、RAM 使用者的授權情況和是否填寫了必需參數。如果檢查不通過,則回傳對應錯誤。如果檢查通過,會回傳錯誤碼DryRunOperation。

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

返回參數

名稱

類型

描述

樣本值

object

回傳資訊。

RequestId

string

請求 ID。

861E6630-AEC0-4B2D-B214-6CB5E44B7F04

樣本

正常返回樣本

JSON格式

{
  "RequestId": "861E6630-AEC0-4B2D-B214-6CB5E44B7F04"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidRouteEntryId.NotFound Specified RouteEntryId does not exist. 指定的路由條目不存在。
400 InvalidRouteEntryName.Malformed Specified RouteEntry name is not valid. 無法修改,因為指定的路由項目名稱無效。
400 OperationDenied.ModifyManagedRouteEntry The operation is not allowed because of route entry is managed. 無法修改被託管的路由。
400 OperationDenied.RouteTableTypeNotPermitted The operation is not allowed because the type of route table is not permitted. 指定的路由表類型不允許建立路由項目。
400 MissingParam.NewNextHopId The parameter NewNextHopId is mandatory. 修改路由項目下一跳缺少待修改路由項目下一跳執行個體 ID 資訊。
400 IllegealParam.NextHopType The parameter NewNextHopType is illegal. 路由項目下一跳類型非法。
400 UnsupportedFeature.NormalTypeNatGateway Normal nat gateways do not support modifying the next hop of the route. 指向普通類型 NAT 閘道器的路由項目不支援修改下一跳。
400 UnsupportedFeature.NextHopType The route type does not support modifying the next hop of the route. 目前路由項目不支援修改下一跳資訊。
400 InvalidRouteTable.NotFound The specified routetable does not exist. 路由表執行個體不存在。
400 InvalidNetworkInterface.NotFound The specified network interface does not exist. Attachment 上的彈性網卡不存在。
400 OperationDenied.NextHopExist The operation is not allowed because the nexthop already exists. 需要修改的目標路由項目下一跳已存在。
400 MissingParam.NewNextHopType The parameter NewNextHopType is mandatory. 修改路由項目下一跳缺少待修改路由項目下一跳執行個體類型資訊。
400 UnsupportedFeature.ModifyRouteEntryNextHop The current region does not support the function of modifying the route next hop. 目前地域不支援修改路由下一跳功能。
400 IncorrectRouteEntryStatus Some route entry status blocked this operation.
400 ResourceNotFound.VSwitch The vSwitch where the specified networkinterface is located does not exist. 指定的 VSwitch 執行個體不存在。
400 MissingParam.RouteEntryId The param of %s is missing. 缺少必要參數。
400 IllegalParam.RouteEntryName The param of %s is illegal. 指定的路由名稱無效。
400 OperationDenied.LocalRouteEntryModified The next hop of a local route is modified. 存在 local 類型的路由下一跳被修改了。
400 OperationDenied.IllegalNewNextHopType When modifying the next hop of a route of the local type, a new next hop type that is not supported is passed in. 修改 local 類型的路由下一跳時,傳入了不支援的新下一跳類型。
400 UnsupportedFeature.VpcAdvancedFeature The VPC does not support some advanced features. 您指定的 VSwitch 所在的 VPC 未支援進階功能,請更換其他 VSwitch 重試。
400 UnsupportedRegion The feature is not supported in current region. 本地域不支援操作 prefixList 路由。
400 OperationFailed.NotSupportIPV6 The specified next hop does not support IPv6. 指定的下一跳不支援 IPv6 功能。
400 UnsupportedFeature.ModifyIpv6RouteEntryNextHop The current region does not support the feature of modifying the IPv6 route next hop. 操作失敗,因為目前地域不支援修改 IPv6 路由下一跳。
400 OperationDenied.NewNextHopNotSupportPublish New nexthop is not supported for published route entry. 該路由條目已發佈到其他元件,指定的下一跳類型不支援路由發佈。
400 IllegalParam.DestCidrBlock The destCidrBlock is invalid. 傳入的目標位址不合法。
400 IllegalParamFormat.DstCidrBlock The format of the specified destination CIDR block is invalid. 目的地 CIDR 格式不正確。
400 MissingParam.RouteEntryIdOrRouteTableDstCidr The request is missing required parameters. You must provide either the RouteEntryId or the combination of RouteTableId and DestinationCidrBlock to proceed. Please ensure that one of these parameter sets is included in your request. 請求缺少必要參數。您必須提供 RouteEntryId,或者同時提供 RouteTableId 和 DestinationCidrBlock。
400 MissingParam.ParameterMustNotNull %s, %s. 缺少必須傳入的參數。
400 ResourceNotFound.RouteTable The specified resource gatewayRouteTable is not found. 閘道器路由表不存在。
400 OperationDenied.UpdateGatewayRouteEntry The operation is not allowed because of need switch to local first. 修改閘道路由項目失敗,下一跳必須首先修改為 local 路由,才能自訂下一跳。
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 InvalidRouterInterfaceId.NotFound The specified RouterInterfaceId does not exist in our record.
400 OperationUnsupported.OnlySupportNormalNetworkInterface Next hop only supports binding normal network Interface. 下一跳僅支援綁定普通彈性網卡。
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 OperationDenied.LocalRouteEntryInSystemRouteTable The Local Route Entry In System Route Table Can Not Be Modify. 禁止修改系統路由表中的 Local 路由。
400 OperationDenied.LocalRouteEntryBoundToVSwitch The VSwitch to which the local route you modified belongs is bound to the current routing table. You are not allowed to modify its next hop. 您所修改的 Local 路由所屬的交換器正與目前路由表綁定,禁止修改其下一跳。
400 OperationFailed.ModifyEcmpRoute Operation is failed because ecmp route can not modify. 操作失敗,因為 ECMP 路由不支援修改下一跳等屬性。
400 InvalidRouteEntry.NotFound vpc route entry not exist. 該路由項目不存在,請您檢查路由項目是否正確。
400 OperationDenied.IllegalRouteTargetGroupMemberType This operation does not support route target groups with NAT gateway members. 目前操作不支援成員為 NAT 閘道器類型的路由目標群組。
400 OperationUnsupported.Ipv6EntryOnPrimaryNetworkInterface You cannot create IPv6 route entries on a primary network interface. 不允許建立下一跳為主網卡的 IPv6 路由。
400 IncorrectStatus.Vpc Vpc incorrect status. 目前執行個體狀態非穩態。
403 Forbbiden User not authorized to operate on the specified resource. EIP 不屬於當前呼叫者,請您檢查該 EIP 是否可被您呼叫。
404 ResourceNotFound.NatGateway The specific NAT gateway is not found. 此 NAT 閘道器不存在。
404 ResourceNotFound.GatewayLoadBalancerEndpoint GatewayLoadBalancerEndpoint instance not found. 未找到 GatewayLoadBalancerEndpoint 執行個體。

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

變更歷史

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