全部產品
Search
文件中心

VPN Gateway:PublishVpnRouteEntry

更新時間:Jun 19, 2026

呼叫 PublishVpnRouteEntry 介面將目的路由或策略路由發佈到 VPC 的系統路由表中或將已發佈的目的路由或策略路由從 VPC 系統路由表中撤銷。

調試

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

調試

授權資訊

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

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

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

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

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

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

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

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

操作

存取層級

資源類型

條件關鍵字

關聯操作

vpc:PublishVpnRouteEntry

update

*VpnGateway

acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId}

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

VPN 閘道執行個體所在的地域 ID。

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

cn-hangzhou

ClientToken

string

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

由用戶端生成該參數值,要保證在不同請求間唯一,最大值不超過 64 個 ASCII 字元。

說明

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

d7d24a21-f4ba-4454-9173-b382****

VpnGatewayId

string

VPN 閘道執行個體 ID。

vpn-bp1a3kqjiiq9legfx****

RouteDest

string

VPN 閘道路由條目的目標網段。

10.0.0.0/24

NextHop

string

VPN 閘道路由條目的下一跳。

vco-bp15oes1py4i66rmd****

RouteType

string

VPN 閘道路由條目類型。取值:

  • pbr:策略路由。

  • dbr:目的路由。

pbr

PublishVpc

boolean

發佈或撤銷路由。取值:

  • true:發佈。

    該參數取值為 true,表示將目的路由或策略路由發佈到 VPC 的系統路由表中。

  • false:撤銷。

    該參數取值為 false,表示將已發佈的目的路由或策略路由從 VPC 系統路由表中撤銷。

說明

如果策略路由表和目的路由表中存在目標網段相同的路由條目,並且這兩條路由條目被發佈到同一個 VPC 中,當您在策略路由表下撤銷發佈該路由條目時,目的路由表下的該路由條目也會被同時撤銷發佈。當您在目的路由表下撤銷發佈該路由條目時,策略路由表下的該路由條目也會被同時撤銷發佈。

true

返回參數

名稱

類型

描述

樣本值

object

返回結果。

RequestId

string

請求 ID。

5BE01CD7-5A50-472D-AC14-CA181C5C03BE

樣本

正常返回樣本

JSON格式

{
  "RequestId": "5BE01CD7-5A50-472D-AC14-CA181C5C03BE\t"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 Resource.QuotaFull The quota of resource is full
400 VpnGateway.Configuring The specified service is configuring.
400 VpnGateway.FinancialLocked The specified service is financial locked.
400 VpnRouteEntry.AlreadyExists The specified route entry is already exist.
400 VpnRouteEntry.Conflict The specified route entry has conflict.
400 InvalidVpnRouteEntry.NotFound The specified route entry does not exist.
400 OperationFailed.InvalidStatus Route entry is not allowed to operate in current status.
400 OperationFailed.RouteConflict Operation failed because there is already a route in VPC route table to another VPN on the same network block.
400 OperationFailed.InvalidCidrBlock Operation failed because the specified network block is invalid.
400 QuotaExceeded.VpnRouteEntry The number of route entries to the VPN gateway in the VPC routing table has reached the quota limit.
400 TaskConflict The operation is too frequent, please wait a moment and try again.
400 IllegalParam.CidrBlock The specified CidrBlock is illegal.
400 QuotaExceeded Route entry quota exceeded in this route table.
400 MissingParameter Miss mandatory parameter.
400 InvalidCidrBlock.Malformed Specified CIDR block is not valid.
400 InvalidCIDRBlock.Duplicate Specified CIDR block is already exists.
400 IncorrectVpcStatus Current VPC status does not support this operation.
400 IncorrectInstanceStatus Current instance status does not support this operation.
400 IncorrectRouteEntryStatus Some route entry status blocked this operation.
400 IncorrectVSwitchStatus The current virtual switch status does not support this operation.
400 InvalidCidrBlock Specified CIDR block is not valid.
400 InvalidNextHopType Specified parameter "NextHopType" is not valid
400 InvalidNextHop.NotFound Specified next hop does not exist.
400 InvalidVRouter.NotFound vRouter not exists.
400 InvalidVPC.NotFound vpc not exists.
400 InvalidNexthopTypeAndList.BothNull both nexthopType and nextHopList are null.
400 InvalidNexthopTypeAndList.BothNotNull both nexthopType and nextHopList are not null.
400 InvalidRouterInterface invalid router interface.
400 InvalidOppositeRouterType nexthop list cannot only contain router interface whose opposite router interface is on vbr.
400 InvalidNexthopListSize nexthop size is illegal. Must be between 2 and 4.
400 InvalidEntryRuleQuota.NotFound Route entry quota rule not exists.
400 Forbidden.CheckEntryRuleQuota Route entry quota rule check error.
400 InvalidVBRStatus invalid virtual border router status.
400 InvalidPhysicalConnectionBusinessStatus invalid physical connection business status.
400 IncorrectHaVipStatus This operation is denied because satus of the specified HaVip is neither Available nor InUse.
400 CountLimitExceed.HaVipRouteEntry There can be 5 route entry to HaVip at most in one route table.
400 InvalidRouteEntry.Duplicate The route entry already exist.
400 INVALID_WEIGHT_PARAM Specified value of weight invalid
400 FORBIDDEN_USE_VPC_AS_INTERNET_GATEWAY The Specified CIDR must be in vpc CIDR.
400 INVALID_VPC_ID The Specified VpcId not match.
400 InvalidRouteEntrySize The Specified routerEntry size not legal.
400 RouteConflict.AlreadyExist Route conflict exists in routing table.
400 InvalidRouteEntryName.Malformed Specified RouteEntry name is not valid.
400 Duplicated.VpcNextHop Route entry nexthop duplicate.
400 InvalidNexthop.DirectEni The direct Eni cannot be nexthop.
400 InvalidAttachment.NotFound The attachment is not found.
400 OperationFailed.ActiveNetworkInterfaceNotFound No active network interface is found on the attachment.
400 InvalidNetworkInterface.NotFound The network interface is not found on the attachment.
400 OperationFailed.QueryAttachmentInfo Failed to query attachment information.
400 IllegalParam.AttachmentId The attachment is invalid.
400 OperationFailed.NotSupportIPV6 The specified next hop does not support IPv6.
400 IncorrectStatus.Ipv6Address The IPv6 address of the specified next hop is being assigned or deleted.
400 OperationUnsupported.Ipv6EntryOnPrimaryNetworkInterface You cannot create IPv6 route entries on a primary network interface.
400 OperationUnsupported.SpecifyIpOnIpv6Entry You cannot specify the private IP address when you create IPv6 route entries.
400 OperationUnsupported.MutipleIpv6Address You cannot specify a next hop that has bound multiple IPv6 addresses.
400 OperationDenied.Ipv6EntryOnCustomTable You cannot create any IPv6 route entry on a custom route table.
403 Forbbiden.SubUser User not authorized to operate on the specified resource as your account is created by another user.
403 Forbidden User not authorized to operate on the specified resource.
404 InvalidVpnGatewayInstanceId.NotFound The specified vpn gateway instance id does not exist.

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

變更歷史

更多資訊,參考變更詳情