资源中心/网络资源/路由资源相关接口/路由器路由表相关接口
POSTvRouter Route Table Operations起始版本 2.1同步需要认证
添加路由条目
添加路由条目
调试可用性
在线调试
使用当前认证信息和示例参数提交 Mock 请求。
路径参数
请求参数
路径参数
routeTableUuidString必填路由表UUID
请求体字段
paramsObject必填请求体参数结构
descriptionString资源的详细描述
typeString类型 允许用户添加"静态路由"、"黑洞路由"两种类型,系统会根据是否填下一条自动判断类型
destinationString必填目标网络地址,使用网络地址CIDR格式,如果用户填写的不是标准CIDR格式,系统会自动转换
targetString下一跳地址 为一个路由器设备目前可以直接到达的IP地址,如果不可以直接到达,将会进行递归路由
distanceInteger路由优先级,在最小匹配下如果有多条路由规则匹配,优先级数字小的规则将会被匹配
resourceUuidString资源UUID。若指定,资源会使用该字段值作为UUID。
systemTagsList系统标签。
userTagsList用户标签。
响应状态
请求地址
POST/zstack/v1/vrouter-route-tables/{routeTableUuid}/route-entries
/zstack/v1/vrouter-route-tables/{routeTableUuid}/route-entries
请求示例
curl -X POST 'http://{host}/zstack/v1/vrouter-route-tables/{routeTableUuid}/route-entries' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"description":"<description>","type":"<type>","destination":"<destination>","target":"<target>","distance":1,"resourceUuid":"<resourceUuid>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
响应示例
200{ "inventory": { "description": "Test route", "type": "UserStatic", "routeTableUuid": "5dad5ac78c3642088dc3ed6bc4d8c853", "destination": "192.168.2.0/24", "target": "172.20.1.1", "distance": 128.0 } }变更历史
此 API 暂无变更历史记录。
