すべてのプロダクト
Search
ドキュメントセンター

Virtual Private Cloud:ModifyRouteEntry

最終更新日:Jun 18, 2026

ModifyRouteEntry 操作を呼び出して、カスタムルートエントリの名前、説明、およびネクストホップを変更します。

操作説明

  • ModifyRouteEntry 操作は、同じカスタムルートエントリの名前と説明の同時変更をサポートしていません。

  • ModifyRouteEntry 操作は、同時実行シナリオで TaskConflict エラーコードを返す場合があります。必要に応じてリトライしてください。

今すぐお試しください

この API を OpenAPI Explorer でお試しください。手作業による署名は必要ありません。呼び出しに成功すると、入力したパラメーターに基づき、資格情報が組み込まれた SDK コードが自動的に生成されます。このコードをダウンロードしてローカルで使用できます。

テスト

RAM 認証

下表に、この API を呼び出すために必要な認証情報を示します。認証情報は、RAM (Resource Access Management) ポリシーを使用して定義できます。以下で各列名について説明します。

  • アクション:特定のリソースに対して実行可能な操作。ポリシー構文ではAction要素として指定します。

  • API:アクションを具体的に実行するための API。

  • アクセスレベル:各 API に対して事前定義されているアクセスの種類。有効な値:create、list、get、update、delete。

  • リソースタイプ:アクションが作用するリソースの種類。リソースレベルでの権限をサポートするかどうかを示すことができます。ポリシーの有効性を確保するため、アクションの対象として適切なリソースを指定してください。

    • リソースレベルの権限を持つ API の場合、必要なリソースタイプはアスタリスク (*) でマークされます。ポリシーのResource要素で対応する ARN を指定してください。

    • リソースレベルの権限を持たない API の場合、「すべてのリソース」と表示され、ポリシーのResource要素でアスタリスク (*) でマークされます。

  • 条件キー:サービスによって定義された条件のキー。このキーにより、きめ細やかなアクセス制御が可能になります。この制御は、アクション単体に適用することも、特定のリソースに対するアクションに適用することもできます。Alibaba Cloud は、サービス固有の条件キーに加えて、すべての RAM 統合サービスに適用可能な一連の共通条件キーを提供しています。

  • 依存アクション:ある特定のアクションを実行するために、前提として実行が必要となる他のアクション。依存アクションの権限も RAM ユーザーまたは RAM ロールに付与する必要があります。

アクション

アクセスレベル

リソースタイプ

条件キー

依存アクション

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: vRouter インターフェイス。

  • NetworkInterface: Elastic ネットワークインターフェース (ENI)。

  • VpnGateway: VPN ゲートウェイ。

  • IPv6Gateway: IPv6 ゲートウェイ。

  • NatGateway: NAT ゲートウェイ。

  • Attachment: トランジットルーター。

  • VpcPeer: VPC ピアリング接続。

  • Ipv4Gateway: IPv4 ゲートウェイ。

  • GatewayEndpoint: ゲートウェイエンドポイント。

  • Ecr: Express Connect Router (ECR)。

  • GatewayLoadBalancerEndpoint: Gateway Load Balancer エンドポイント (GWLBe)。

列挙値:

  • HaVip :

    HaVip。

  • VpnGateway :

    VpnGateway。

  • 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 CIDR ブロック。IPv4 および IPv6 CIDR ブロックがサポートされています。

説明

RouteEntryId パラメーターが指定されていない場合、DestinationCidrBlock および RouteTableId パラメーターは必須です。 ルートの IPv4 CIDR ブロックをプレフィックスリストに変更するには、RouteEntryId パラメーターを指定してください。DestinationCidrBlock パラメーターは、プレフィックスリストの CIDR ブロックやプレフィックスリストのインスタンス ID をサポートしていません。

192.168.0.0/24

DryRun

boolean

任意

ドライランを実行するかどうかを指定します。有効な値:

true: ルートを変更せずにリクエストを送信します。システムは、AccessKey ペアが有効かどうか、Resource Access Management (RAM) ユーザーの権限付与、および必須パラメーターが指定されているかどうかを確認します。確認が失敗した場合、対応するエラーが返されます。確認が成功した場合、DryRunOperation エラーコードが返されます。

false (デフォルト): 法線リクエストを送信します。リクエストが確認に合格した後、2xx HTTP 状態コードが返され、ルートが変更されます。

レスポンスフィールド

フィールド

説明

object

応答パラメーター。

RequestId

string

リクエスト ID。

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

成功レスポンス

JSONJSON

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

エラーコード

HTTP ステータスコード

エラーコード

エラーメッセージ

説明

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.
400 IllegealParam.NextHopType The parameter NewNextHopType is illegal.
400 UnsupportedFeature.NormalTypeNatGateway Normal nat gateways do not support modifying the next hop of the route.
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.
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.
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.
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.
400 UnsupportedFeature.VpcAdvancedFeature The VPC does not support some advanced features.
400 UnsupportedRegion The feature is not supported in current region.
400 OperationFailed.NotSupportIPV6 The specified next hop does not support IPv6.
400 UnsupportedFeature.ModifyIpv6RouteEntryNextHop The current region does not support the feature of modifying the IPv6 route next hop.
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.
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.
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.
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.
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.
400 InvalidAttachment.NotFound The attachment is not found.
400 OperationDenied.LocalRouteEntryInSystemRouteTable The Local Route Entry In System Route Table Can Not Be Modify.
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.
400 OperationFailed.ModifyEcmpRoute Operation is failed because ecmp route can not modify.
400 InvalidRouteEntry.NotFound vpc route entry not exist.
400 OperationDenied.IllegalRouteTargetGroupMemberType This operation does not support route target groups with NAT gateway members.
400 OperationUnsupported.Ipv6EntryOnPrimaryNetworkInterface You cannot create IPv6 route entries on a primary network interface. 不允许创建下一跳为主网卡的IPv6路由。
403 Forbbiden User not authorized to operate on the specified resource.
404 ResourceNotFound.NatGateway The specific NAT gateway is not found.
404 ResourceNotFound.GatewayLoadBalancerEndpoint GatewayLoadBalancerEndpoint instance not found.

完全なリストについては、「エラーコード」をご参照ください。

変更履歴

完全なリストについては、「変更履歴」をご参照ください。