跳转到主要内容
资源中心/网络资源/路由资源相关接口/路由器路由表相关接口
GETvRouter Route Table Operations起始版本 2.1同步需要认证

获取路由器实时路由表

获取路由器实时路由表

调试可用性

在线调试

使用当前认证信息和示例参数提交 Mock 请求。

路径参数

查询参数

请求参数

路径参数

  • virtualRouterVmUuidString必填

    路由器设备UUID

查询参数

  • systemTagsList

    系统标签。

  • userTagsList

    用户标签。

响应状态

200 OK

该 API 成功时返回以下响应结构。

  • errorErrorCode必填

    错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error

    • codeString必填

      错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001

    • descriptionString必填

      错误的概要描述

    • detailsString必填

      错误的详细信息

    • elaborationString必填

      保留字段,默认为null

    • opaqueLinkedHashMap必填

      保留字段,默认为null

    • causeErrorCode必填

      根错误,引发当前错误的源错误,若无原错误,该字段为null

  • inventoriesList必填

    详情参考inventories

    • uuidString必填

      资源的UUID,唯一标示该资源

    • descriptionString必填

      资源的详细描述

    • typeString必填

      除用户添加的静态路由、黑洞路由外,ZStack类型表示由系统添加的路由,DirectConnect表示直连路由

    • destinationString必填

      目标网络地址

    • targetString必填

      下一跳地址或网卡

    • distanceInteger必填

      路由优先级,在最小匹配下如果有多条路由规则匹配,优先级数字小的规则将会被匹配

    • statusString必填

      路由状态 active:活跃的路由 inactive:表示非活跃路由 selected:表示多路径路由中活跃的路由

请求地址

GET/zstack/v1/vrouter-route-tables/vrouter/{virtualRouterVmUuid}

/zstack/v1/vrouter-route-tables/vrouter/{virtualRouterVmUuid}

操作 ID

GetVRouterRouteTable

永久链接

请求示例

curl -X GET 'http://{host}/zstack/v1/vrouter-route-tables/vrouter/{virtualRouterVmUuid}?systemTags=<systemTags>&userTags=<userTags>' -H 'Authorization: OAuth {sessionUuid}'

响应示例

200
{ "inventories": [ { "type": "ZStack" "destination": "0.0.0.0/0" "target": "100.64.201.1" "status": "selected" }, { "uuid": "7b86eaba601c4ceda5987036c9ea7981" "type": "UserStatic" "destination": "100.64.0.0/24" "target": "100.64.201.10" "distance": "128" "status": "selected" }, { "uuid": "d15ebfe03aec49e6a0453e74eede350d" "type": "UserStatic" "destination": "100.64.0.0/24" "target": "100.64.201.11" "distance": "128" "status": "active" }, { "type": "ZStack" "destination": "10.0.57.94/32" "target": "eth0" }, { "uuid": "50e6070313fa4a05b17907a32be0a63f" "type": "UserStatic" "destination": "10.0.57.94/32" "target": "100.64.201.12" "distance": "1" "status": "inactive" }, { "type": "DirectConnect" "destination": "192.168.197.0/24" "target": "eth1" "status": "selected" }, { "uuid": "6b446d5cf776471c913582ab30bd6340" "type": "DirectConnect" "destination": "192.168.197.0/24" "target": "100.64.201.13" "distance": "1" "status": "inactive" }, { "uuid": "0aad7115c1f94aa1bf5db1a4d6d3fd17" "type": "UserBlackHole" "destination": "192.168.198.0/24" "distance": "1" "status": "selected" }, ] }

变更历史

此 API 暂无变更历史记录。

查看全部变更历史