全部产品
Search
文档中心

专有网络 VPC:PublishVpcRouteEntries - 发布VPC路由

更新时间:Jul 10, 2026

发布VPC路由到外部组件。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

vpc:PublishVpcRouteEntries

update

*RouteTable

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

请求参数

名称

类型

必填

描述

示例值

RegionId

string

实例所在的地域 ID。您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-hangzhou

RouteEntries

array<object>

需要发布的路由条目信息列表,最多支持传入 50 条路由。

object

需要发布的路由条目信息列表。

RouteTableId

string

路由条目的路由表 ID。

vtb-2ze3jgygk9bmsj23s****

DestinationCidrBlock

string

路由条目的目标网段。

121.41.165.123/32

TargetType

string

路由发布目标的类型

ECR

TargetInstanceId

string

路由发布目标实例 ID

ecr-dhw2xsds5****

DryRun

boolean

是否只预检此次请求。取值:

  • true:发送检查请求,不会发布路由。检查项包括 AccessKey 是否有效、RAM 用户的授权情况和是否填写了必需参数。如果检查不通过,则返回对应错误。如果检查通过,会返回错误码DryRunOperation

  • false(默认值):发送正常请求,通过检查后返回 2xx HTTP 状态码并直接查询资源状况。

false

返回参数

名称

类型

描述

示例值

object

Schema of Response

RequestId

string

请求 ID。

980960B0-2969-40BF-8542-EBB34FD358AB

示例

正常返回示例

JSON格式

{
  "RequestId": "980960B0-2969-40BF-8542-EBB34FD358AB"
}

错误码

HTTP status code

错误码

错误信息

描述

400 IncorrectStatus.Vpc The status of %s [%s] is incorrect. 当前实例状态非稳态
400 ResourceNotFound.RouteEntry The specified resource routeEntry is not found. 指定的路由条目不存在
400 IncorrectStatus.RouteEntry The status of %s [%s] is incorrect. 路由条目处于非稳态
400 Forbidden.OperateCustomRouteTable The operation is forbidden because publish route entry in custom route table. 操作被禁止,因为不允许发布自定义路由表中的路由条目。
400 IncorrectStatus.RouteEntryPublishStatus Route entry publish status is incorrect. 路由条目的路由发布状态不正确。
400 ResourceNotAssociated.TargetInstance The target instance is not associated with vpc.
400 OperationDenied.UnsupportedTargetType The operation is not allowed because the target type is not supported. 操作被拒绝,因为路由发布目标的类型当前不支持。
400 IncorrectStatus.RouteTable The route table is in an invalid state. 指定的路由表状态不对
400 OperationUnsupported.PublishSystemRouteEntry Publishing system route entry is unsupported. 发布系统路由操作不支持。
400 OperationUnsupported.UnsupportedNextHop Unsupported nexthop type for route entry publish operation. 路由条目的下一跳类型不支持发布。
400 OperationUnsupported.PublishPrefixListRouteEntry Publishing prefix list route entry is unsupported. 发布路由前缀列表路由操作不支持。
400 InvalidRouteTableId.NotFound Specified route table does not exist.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情