调用CreateEnsRouteEntry创建自定义路由条目。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
ens:CreateEnsRouteEntry | create | *全部资源 * |
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
RouteTableId | string | 是 | 要创建自定义路由条目的路由表 ID。 | vtb-bp1cifr72dioje82lse2j |
DestinationCidrBlock | string | 是 | 自定义路由条目的目标网段。需满足以下要求:
| 120.XXX.XXX.0/24 |
NextHopType | string | 否 | 自定义路由条目的下一跳的类型,取值:
| Instance |
NextHopId | string | 是 | 自定义路由条目的下一跳实例的 ID。 | i-5vb7leks9z4mxy1ay258 |
RouteEntryName | string | 否 | 要创建的自定义路由条目的名称。长度为 1~128 个字符,但不能以 http://或 https://开头。 | test |
Description | string | 否 | 自定义路由条目的描述信息。 | example |
SourceCidrBlock | string | 否 | 源地址网段在配置网关路由表的路由条目时可用,但在配置交换机路由表的路由条目时不受支持。 | 172.XXX.XXX.0/24 |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"RouteEntryId": "rte-5vb5q8sk0lyoscx8539ds"
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | Invalid%s | The specified parameter %s is invalid. | 参数不正确 |
400 | Missing%s | You must specify the parameter %s. | 参数为必填 |
400 | ens.interface.error | Failed to call API. | 接口调用发生异常。 |
400 | InvalidRouteTableId.NotFound | Specified route table does not exist. | 该路由表不存在。 |
400 | IncorrectStatus.Network | The status of the network is incorrect. | 网络的状态不正确。 |
400 | InvalidNetworkType.NotSupported | The specified network type does not supported. | 网络的类型不支持。 |
400 | QuotaExceeded | Route entry quota exceeded in this route table. | 路由表中路由条目数量超出限额。 |
400 | InvalidRouteEntry.Duplicate | The route entry already exists. | 指定的路由条目已存在。 |
400 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定实例不存在 |
400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | 目标网段格式错误。 |
400 | InvalidSourceCidrBlock.Malformed | Specified Source CIDR Block is not valid. | 源网段格式错误。 |
400 | InvalidSourceCidrBlock.NotSupported | The route table does not support the source CIDR block parameter. | 路由表不支持源网段参数。 |
400 | InvalidNextHopType.NotSupported | This next hop type is not supported. | 不支持这种下一跳类型。 |
400 | HaVipNotFound | The input parameter haVipId that is not found. | 指定的HaVip不存在。 |
400 | IncorrectHaVipStatus | The status of the haVip is invalid. | HaVip的状态不正确 |
400 | InstanceNotFound.NetworkPeerConnection | Network peer connection not found, please check the InstanceId. | 找不到实例,请检查实例ID。 |
400 | IncorrectStatus.NetworkPeerConnection | The status of the network peer connection is incorrect. | 网络对等连接的状态不正确。 |
400 | IncorrectNetworkInterfaceStatus | The operation could not be completed because the status of the specified network interface is invalid for this action. | 指定的网卡状态不支持当前操作。 |
400 | NoPermission | Permission denied. | 没有足够的权限,请联系云账号管理员授予您相应权限。 |
400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. | - |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2025-03-13 | OpenAPI 错误码发生变更、OpenAPI 入参发生变更 | 查看变更详情 |
2025-01-10 | OpenAPI 错误码发生变更 | 查看变更详情 |
2024-11-05 | OpenAPI 错误码发生变更 | 查看变更详情 |