调用CreateRouteEntry在VPC路由器或边界路由器(VBR)上创建自定义路由条目。
接口说明
- CreateRouteEntry接口属于异步接口,即系统会返回一个实例ID,但该路由的添加尚未完成,系统后台的启动任务仍在进行。您可以调用DescribeRouteEntryList查询路由的添加状态:
- 当路由处于Creating状态时,表示路由添加中。
- 当路由处于Created状态时,表示路由添加完成。
- CreateRouteEntry接口不支持在同一个VPC或者同一个VBR中并发添加自定义路由条目。
使用该接口为VPC路由器的路由表添加自定义路由条目时,请注意以下事项:
-
同一个路由表中自定义路由条目不能超过200条。
-
自定义路由条目的目标网段(DestinationCidrBlock)不能和VPC内的交换机的网段相同,可以包含交换机的网段但是不能被交换机的网段包含。
-
自定义路由条目的目标网段(DestinationCidrBlock)不能指向100.64.0.0/10,也不能被100.64.0.0/10包含。
-
同一路由表下的路由条目的目标网段(DestinationCidrBlock)不允许相同。
-
如果指定的目标网段(DestinationCidrBlock)是一个IP地址,会按照32位掩码来处理。
-
多条自定义路由条目可以指向同一个下一跳(NextHopId)。
-
自定义路由条目的下一跳(NextHopId)必须和路由表在同一个VPC。
-
支持通过NextHopList参数配置ECMP路由:
-
添加普通(非ECMP)自定义路由时,需指定DestinationCidrBlock、NextHopType和NextHopId参数,且不能指定NextHopList参数。
-
添加ECMP路由时,需指定DestinationCidrBlock和NextHopList参数,且不能指定NextHopType和NextHopId参数。
-
使用该接口为边界路由器的路由表添加自定义路由条目时,请注意以下事项:
-
同一个路由表中自定义路由条目不能超过200条。
-
不支持NextHopList参数。
-
自定义路由条目的目标网段(DestinationCidrBlock)不能指向100.64.0.0/10,也不能被100.64.0.0/10包含。
-
同一路由表下的路由条目的目标网段(DestinationCidrBlock)不允许相同。
-
如果指定的目标网段(DestinationCidrBlock)是一个IP地址,会按照32位掩码来处理。
-
多条自定义路由条目可以指向同一个下一跳(NextHopId)。
-
自定义路由条目的下一跳(NextHopId)必须是该VBR关联的路由器接口。
-
只允许在VBR状态是Active,而且对应的物理专线状态是Enabled且没有被欠费锁定的情况下在VBR上新建路由条目。
-
仅支持添加普通路由(非ECMP),需指定DestinationCidrBlock、NextHopType和NextHopId参数,且不能指定NextHopList参数。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
vpc:CreateRouteEntry | Write |
|
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
RegionId | string | 否 | 路由表所属地域的ID。 您可以通过调用DescribeRegions接口获取地域ID。 | cn-hangzhou |
RouteTableId | string | 是 | 要添加自定义路由条目的路由表ID。 | vtb-bp145q7glnuzd**** |
DestinationCidrBlock | string | 是 | 自定义路由条目的目标网段,支持IPv4和IPv6的目标网段。需满足以下要求:
| 192.168.0.0/24 |
NextHopId | string | 否 | 自定义路由条目的下一跳实例的ID。 | i-j6c2fp57q8rr4jlu**** |
ClientToken | string | 否 | 客户端Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,请确保不同请求间该参数值唯一。ClientToken只支持ASCII字符。 说明
若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId不一样。
| 02fb3da4-130e-11e9-8e44-001**** |
RouteEntryName | string | 否 | 要添加的自定义路由条目的名称。 名称长度为1~128个字符,不能以 | test |
Description | string | 否 | 自定义路由条目的描述信息。 描述长度为1~256个字符,不能以 | test |
NextHopType | string | 否 | 自定义路由条目的下一跳的类型,取值:
| RouterInterface |
NextHopList | object [] | 否 | 下一跳的信息。 | |
NextHopId | string | 否 | ECMP路由的下一跳实例的ID。 | ri-2zeo3xzyf3cd8r4**** |
Weight | integer | 否 | ECMP路由的下一跳的路由权重。 | 10 |
NextHopType | string | 否 | ECMP路由的下一跳的类型,目前仅取值:RouterInterface(路由器接口)。 | RouterInterface |
返回参数
示例
正常返回示例
JSON
格式
{
"RouteEntryId": "rte-sn6vjkioxte1gz83z****",
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | IllegalParam.CidrBlock | The specified CidrBlock is illegal. | CidrBlock参数非法。 |
400 | QuotaExceeded | Route entry quota exceeded in this route table. | 超过路由条目配额。 |
400 | MissingParameter | Miss mandatory parameter. | 缺少必要参数,请您检查必填参数是否都已填后再进行操作。 |
400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | 该CIDR格式不正确。 |
400 | InvalidCIDRBlock.Duplicate | Specified CIDR block is already exists. | 该网段已经在该路由表中存在。 |
400 | IncorrectVpcStatus | Current VPC status does not support this operation. | 当前VPC的状态无法支持这个操作。 |
400 | IncorrectInstanceStatus | Current instance status does not support this operation. | 当前实例的状态不支持该操作。 |
400 | IncorrectRouteEntryStatus | Some route entry status blocked this operation. | 无法执行该操作,当前路由表中有路由条目的状态为pending或modifying。 |
400 | IncorrectVSwitchStatus | The current virtual switch status does not support this operation. | 该vSwitch处于pending状态,无法删除。 |
400 | InvalidCidrBlock | Specified CIDR block is not valid. | 可能的报错原因:1.您不在10.0.0.0/8的路由网段的白名单中,不能使用该网段。2.添加的自定义路由目标网段不能从属于同一个VPC下面所有交换机的网段。3.网段不能是100.64.0.0/10。 |
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. | 必须指定2~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 | InvalidRouterType | Cannot specify nexthop list in vbr's route table. | - |
400 | IncorrectHaVipStatus | This operation is denied because satus of the specified HaVip is neither Available nor InUse. | 无法执行该操作,因为HaVip的状态是Available或InUse。 |
400 | CountLimitExceed.HaVipRouteEntry | The count of route entry to HaVip in one route table is exceeded. | 同路由表中指向HaVip的路由数超过限制。 |
400 | InvalidRouteEntry.Duplicate | The route entry already exist. | 指定的路由条目已存在。 |
400 | IncorrectRouteEntryStatus | Specified routeEntry status error. | 无法执行该操作,当前路由表中有路由条目的状态为pending或modifying。 |
400 | IncorrectRouteEntryStatus | VBR has NotStable route entry. | 无法执行该操作,边界路由表中有路由条目的状态为pending或modifying。 |
400 | InvalidParam | The Ecmp routerEntry with router interfaces local vgw vip not match. | 路由条目与路由器接口本地视频网关VIP不匹配。 |
400 | INVALID_WEIGHT_PARAM | Specified value of weight invalid | 该权重不合法。 |
400 | FORBIDDEN_USE_VPC_AS_INTERNET_GATEWAY | The Specified CIDR must be in vpc CIDR. | 该网段必须是VPC网段的子集。 |
400 | InvalidNexthop | The Specified nexthop illegal. | - |
400 | INVALID_VPC_ID | The Specified VpcId not match. | 该VPC不存在,请您检查输入的VPC是否正确。 |
400 | InvalidRouteEntrySize | The Specified routerEntry size not legal. | 等价路由需要选择2~4个路由器接口作为路由下一跳。 |
400 | TaskConflict | The operation is too frequent, please wait a moment and try again. | 操作过于频繁,请稍等一会再重试 |
400 | InvalidRouteEntry | Specified routeEntry not exist. | 该路由条目不存在。 |
400 | InvalidDestinationCidrBlock | The specified destinationCidrBlock must not included in black list cidr. | - |
400 | Forbidden.VRouterNotFound | Specified virtual switch is not found during access authentication. | 在访问鉴权时未找到指定的虚拟交换机 |
400 | DefaultValidate.Error | validte fail. | - |
400 | Region.NotSupport | The specified region does not currently support nextHopType for networkInterface | - |
400 | OperationFailed.NotifyCenCreate | Failed to notify cen when create route entry. | - |
400 | Forbidden.PrivateIpNotFound | Private ip address not exist. | - |
400 | RouteConflict.AlreadyExist | Route conflict exists in routing table. | 路由表中存在路由冲突。 |
400 | OperationUnsupported.InactiveMode | Vpc multi scope route only support active standby. | - |
400 | InvalidRouteEntryName.Malformed | Specified RouteEntry name is not valid. | 无法修改,因为指定的路由条目名称无效 |
400 | IncorrectStatus.MultiScopeRiRouteEntry | MultiScope ri status must not in idle. | - |
400 | OperationUnsupported.MoreThanOneVpnOrHavip | MultiScope can not support more than one vpn/havip. | - |
400 | OperationUnsupported.EcmpRiTypeOrNumber | Emcp entry not supported if vpc-vbr or vbr-vlan ri does not exist. | - |
400 | Duplicated.VpcNextHop | Route entry nexthop duplicate. | 下一个重复的路由条目。 |
400 | OperationUnsupported.SubRouteTableECMP | Vpc subRouteTable don't support ecmp or multiScope. | - |
400 | InvalidNexthop.NotFound | VRouterEntry nexthop does not exist. | - |
400 | IllegalParam.NextHopId | Instance not exists or not vpc vm. | - |
400 | InvalidVpnInstanceId.NotFound | %s | - |
400 | OperationFailed.ScopeActiveRouteEntryType | %s | - |
400 | OperationFailed.ScopeStandbyRouteEntryQuota | %s | - |
400 | OperationFailed.ScopeActiveRouteEntryQuota | %s | - |
400 | OperationUnsupported.ScopeInvalidRouteType | %s | - |
400 | OperationFailed.EcmpInvalidRouterInterfaceOppositeType | %s | - |
400 | OperationUnsupported.Ipv6EcmpRouteEntry | %s | - |
400 | OperationUnsupported.Ipv6CidrBlock | %s | - |
400 | OperationUnsupported.Ipv6ForVBR | %s | - |
400 | QuotaExceeded.HaVipRouteEntry | Vpc havip route entry quota exceed. | - |
400 | InvalidNexthop.DirectEni | The direct Eni cannot be nexthop. | 直通Eni不能作为下一跳 |
400 | OperationFailed.InvalidNexthop | vpc multi scope route must has a enable nexthop. | - |
400 | OperationFailed.NotifyCenDelete | Failed to notify cen when delete route entry. | - |
400 | InvalidNatGateway.NotFound | Natgateway not exist. | - |
400 | OperationFailed.CxpRouteExist | Cxp route alreay existed. | - |
400 | IncorrectStatus.RouteTableStatus | %s | - |
400 | OperationFailed.GetEniInfo | Failed to get networkInterface info. | - |
400 | QuotaExceeded.EcmpRouteEntryNextHopCount | %s | - |
400 | OperationFailed.InvalidNextHopType | %s | - |
400 | OperationUnsupported.InvalidRouterInterfaceType | Only vpc vbr interface support ecmp route. | - |
400 | InvalidHaVip.NotFound | The specified HaVip does not exist in the specified region. | - |
400 | OperationFailed.MultiScopeType | The specified nexthop type is not support in multiScope. | - |
400 | OperationFailed.DistibuteLock | Distibute lock fail. | - |
400 | QuotaExceeded.VpnRouteEntry | Vpn route entry quota exceeded. | 创建路由条目失败,因为vpn路由条目超出限制 |
400 | InvalidAttachment.NotFound | The attachment is not found. | Attachment不存在。 |
400 | OperationFailed.ActiveNetworkInterfaceNotFound | No active network interface is found on the attachment. | Attachment上不存在可用的弹性网卡。 |
400 | InvalidNetworkInterface.NotFound | The network interface is not found on the attachment. | Attachment上的弹性网卡不存在。 |
400 | OperationFailed.QueryAttachmentInfo | Failed to query attachment information. | 查询Attachment信息失败。 |
400 | IllegalParam.AttachmentId | The attachment is invalid. | Attachment非法。 |
400 | OperationFailed.NotSupportIPV6 | The specified next hop does not support IPv6. | 指定的下一跳不支持IPv6功能。 |
400 | IncorrectStatus.Ipv6Address | The IPv6 address of the specified next hop is being assigned or deleted. | 指定的下一跳的IPv6地址此时正在被创建或删除中。 |
400 | OperationUnsupported.Ipv6EntryOnPrimaryNetworkInterface | You cannot create IPv6 route entries on a primary network interface. | 不允许创建下一跳为主网卡的IPv6路由。 |
400 | OperationUnsupported.SpecifyIpOnIpv6Entry | You cannot specify the private IP address when you create IPv6 route entries. | 创建IPv6路由不允许指定private IP参数。 |
400 | OperationUnsupported.MutipleIpv6Address | You cannot specify a next hop that has bound multiple IPv6 addresses. | 不允许指定绑定了多个IPV6地址的下一跳。 |
400 | OperationDenied.Ipv6EntryOnCustomTable | You cannot create any IPv6 route entry on a custom route table. | 不允许在自定义路由表上创建IPv6路由。 |
400 | OperationDenied.CloudBoxVbrEntryAllowedInCustomRouteTable | The operation is not allowed because only the custom routing table can add a routing entry with the next hop pointing to the cloud box type VBR. | 指定操作被禁止,因为只有自定义路由表能够添加下一跳指向云盒类型VBR的路由条目。 |
400 | OperationDenied.RouteTableAssociateNotCloudBoxVSwitch | The operation is not allowed because of the routing table is bound to a non-cloud box type vswitch, and routing entries pointing to the cloud box VBR cannot be added. | 指定操作被禁止,因为路由表绑定到了非云盒类型的vSwitch上,不能添加指向云盒VBR的路由条目。 |
400 | OperationDenied.VbrMisMatchCloudBox | The operation is not allowed because the routing table is bound to a cloud box vswitch, and routing entries pointing to other cloud box VBRs cannot be added. | 指定操作被禁止,因为路由表绑定到了一个云盒vSwitch上,不能添加指向其他云盒VBR的路由条目。 |
400 | OperationDenied.VbrIdle | The operation is not allowed because the next hop of the added routing entry is a VBR type RI at the opposite end, which cannot be in an idle state. | 指定操作被禁止,因为添加的路由条目下一跳是对端为VBR类型的RI,不能处于空闲状态。 |
400 | OperationDenied.RouterInterfaceToDifferentVpc | The operation is not allowed because the router interface is connected to different VPCs. | 指定操作被禁止,因为路由器接口指向不同的VPC。 |
400 | OperationDenied.RouterInterfaceFromDifferentZones | The operation is not allowed because the router interface resides in different zones. | 指定操作被禁止,因为路由器接口来自不同的可用区。 |
400 | OperationFailed.PconnTrafficNotEnable | The operation is failed because of PconnTrafficNotEnable. | 操作失败,因为出方向流量未开通。 |
400 | ResourceNotFound.VpcPeer | The specified resource of %s is not found. | 无法找到指定的VpcPeer |
400 | IncorrectStatus.VpcPeer | The status of %s [%s] is incorrect. | %s[%s]的状态不正确。 |
400 | OperationDenied.RouteTableTypeNotPermitted | The operation is not allowed because the type of route table is not permitted. | 指定路由表类型不允许创建路由条目 |
400 | OperationDenied.GatewayRouteTableNotPermitted | The operation is not allowed to create a route pointing to this nextHop type on gateway route table. | 网关路由表中不支持创建指向此实例类型的路由条目。 |
400 | UnsupportedFeature.VpcPeerIpv6 | IPv6 route entries for VPC peering connections cannot be created in this region. | 此路由器接口对端是VPC,此地域不支持创建此类型下一跳的IPV6路由。 |
400 | OperationDenied.VpcIpv6NotEnabled | IPv6 has not been enabled for the VPC. | 由于该VPC未使能IPV6能力,操作被拒绝。 |
400 | IncorrectStatus.Ipv4Gateway | The status of Ipv4Gateway is incorrect. | Ipv4Gateway状态处于非稳态 |
400 | ResourceNotFound.PrefixList | The specified resource of prefixList is not found. | 输入的prefixList不存在 |
400 | UnsupportedFeature.CreatePrefixListEcmpRouteEntry | The feature of creating ecmp route entry with prefixList is not supported. | 目前不支持使用前缀列表创建Ecmp路由。 |
400 | OperationDenied.RouterInterfaceIpv6NotEnabled | Routerinterface does not support IPv6. | routerinterface不支持ipv6 |
400 | OperationDenied.NextHopTypeNotPermitted | The operation is not allowed because the nextHop type is invalid. | 不允许创建下一跳为此类型的路由。 |
400 | ResourceAlreadyAssociated.PrefixList | The operation failed because the specified prefixList route entry already exists. | 操作失败,此前缀列表路由存在。 |
400 | OperationFailed.CidrConflictWithPrefixList | The specified CIDR block already exists in a prefixList route entry. | 路由Cidr与已存在的前缀列表路由冲突。 |
400 | ResourceNotFound.Ipv4Gateway | Specified Ipv4Gateway does not exist. | 传入的IPv4网关实例不存在。 |
400 | Mismatch.HaVipIdAndRouteTableId | The HaVip and RouteTable are mismatched. | 传入的高可用虚拟IP与路由表不属于同一个VPC。 |
400 | OperationFailed.OperationLocked | The operation failed because the nextHop instance is in the O&M lock state. | 路由下一跳实例处于运维锁定状态,无法操作。 |
400 | Mismatch.Ipv4GatewayIdAndRouteTableId | The specified IPv4Gateway and RouteTable are not matched. | 操作失败,传入的IPv4网关和路由表不属于同一VPC。 |
400 | OperationUnsupported.DestinationCidrBlockOverlapWithVSwitch | The destination IPv6 network segment specified in the route entry overlaps with the vSwitch network segment. | 路由条目中指定的目标IPv6网段与vSwitch网段重叠。 |
400 | ResourceNotAssociated.Cen | The Vpc and Cen are not associated. | 操作失败,本VPC未关联到此CEN中。 |
400 | IncorrectStatus.CenRelation | The status of Vpc in Cen is incorrect. | 操作失败,VPC在CEN中状态未达稳态。 |
400 | OperationDenied.CenTypeInvalid | The operation is not allowed because of Cen type is invalid.. | 不支持在路由表中创建路由指向此类型的Cen。 |
400 | ResourceNotFound.Cen | The specified resource of Cen is not found. | 操作失败,传入Cen资源不存在。 |
400 | ResourceNotFound.NetworkInterface | The specified resource of network interface is not found. | 指定的网卡不存在。 |
403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | 当前资源的状态不支持该操作。 |
404 | InvalidParameter | Instance not exists or not vpc vm | - |
404 | InvalidNatGatewayId.NotFound | Specified value of NatGatewayId is not found in our record. | - |
404 | InvalidInstanId.NotFound | Specified instance does not exist. | 指定的实例不存在,请您检查该实例是否正确。 |
404 | InvalidNextHopId.NotFound | Specified next hop does not exist. | 该下一跳不存在。 |
404 | InvalidRouteTableId.NotFound | Specified route table does not exist. | 该路由表不存在。 |
404 | InvalidHaVipId.NotFound | The specified HaVip does not exist in the specified VPC. | 该HaVip在VPC中不存在。 |
404 | InvalidNetworkInterface.NotFound | The specified networkInterface does not exist. | - |
404 | InvalidVpc.NotFound | Specified vpc is not found in our record. | - |
404 | OperationFailed.InstanceDismatchCurrentVpc | The specified instance does not exist in current vpc. | 当前vpc中不存在指定的实例。 |
404 | InvalidIpv6Gateway.NotFound | Specified Ipv6Gateway does not exist. | - |
500 | VPC.ERROR | error code 500,Internal server error. | - |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 内部错误 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-09-25 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-09-01 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-07-25 | OpenAPI 描述信息更新,OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-06-25 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-06-21 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-06-16 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-06-09 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-06-07 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-06-06 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-05-05 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-05-04 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-04-04 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
| ||||||||||||||
2023-03-07 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||
|