All Products
Search
Document Center

Virtual Private Cloud:ModifyRouteEntry

Last Updated:Jun 18, 2026

Memanggil operasi ModifyRouteEntry untuk mengubah nama, deskripsi, dan lompatan berikutnya dari entri rute kustom.

Deskripsi operasi

  • Operasi ModifyRouteEntry tidak mendukung modifikasi secara bersamaan pada nama dan deskripsi entri rute kustom yang sama.

  • Operasi ModifyRouteEntry dapat mengembalikan kode kesalahan TaskConflict dalam skenario konkuren. Lakukan percobaan ulang sesuai kebutuhan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

vpc:ModifyRouteEntry

update

*RouteTable

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

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID wilayah entri rute.

Anda dapat memanggil operasi DescribeRegions untuk mengkueri ID wilayah.

cn-hangzhou

RouteEntryName

string

No

Nama entri rute.

Panjang nama harus 1 hingga 128 karakter dan tidak boleh diawali dengan http:// atau https://.

EntryName

RouteEntryId

string

No

ID entri rute kustom.

rte-acfvgfsghfdd****

Description

string

No

Deskripsi entri rute.

Panjang deskripsi harus 1 hingga 256 karakter dan tidak boleh diawali dengan http:// atau https://.

EntryDescription

NewNextHopType

string

No

Tipe lompatan berikutnya baru dari entri rute. Nilai valid:

  • Instance: Instance ECS.

  • HaVip: Alamat IP virtual ketersediaan tinggi.

  • RouterInterface: Antarmuka vRouter.

  • NetworkInterface: Antarmuka jaringan elastis (ENI).

  • VpnGateway: Gateway VPN.

  • IPv6Gateway: Gateway IPv6.

  • NatGateway: Gateway NAT.

  • Attachment: Router transit.

  • VpcPeer: Koneksi peering VPC.

  • Ipv4Gateway: Gateway IPv4.

  • GatewayEndpoint: Titik akhir gerbang.

  • Ecr: Express Connect Router (ECR).

  • GatewayLoadBalancerEndpoint: Titik akhir Gateway Load Balancer (GWLBe).

Valid values:

  • 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

No

ID Instans lompatan berikutnya baru dari entri rute.

eni-bp17y37ytsenqyim****

RouteTableId

string

No

ID tabel entri rute.

vtb-bp1nk7zk65du3pni8z9td

DestinationCidrBlock

string

No

Blok CIDR IPv4 entri rute. Blok CIDR IPv4 dan IPv6 didukung.

Catatan

Jika parameter RouteEntryId tidak ditentukan, parameter DestinationCidrBlock dan RouteTableId wajib diisi. Untuk mengubah blok CIDR IPv4 rute menjadi daftar awalan, tentukan parameter RouteEntryId. Parameter DestinationCidrBlock tidak mendukung blok CIDR daftar awalan atau ID instans daftar awalan.

192.168.0.0/24

DryRun

boolean

No

Apakah akan menjalankan dry run. Nilai valid:

true: Mengirim permintaan tanpa mengubah entri rute. Sistem memeriksa apakah Pasangan Kunci Akses valid, otorisasi Pengguna RAM, dan apakah parameter yang diperlukan telah ditentukan. Jika pemeriksaan gagal, kesalahan yang sesuai akan dikembalikan. Jika pemeriksaan berhasil, kode kesalahan DryRunOperation akan dikembalikan.

false (default): Mengirim permintaan normal. Setelah permintaan lulus pemeriksaan, kode status HTTP 2xx akan dikembalikan dan entri rute akan diubah.

Elemen respons

Element

Type

Description

Example

object

Parameter tanggapan.

RequestId

string

ID permintaan.

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

Contoh

Respons sukses

JSONformat

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

Kode kesalahan

HTTP status code

Error code

Error message

Description

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.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.