创建路由规则
更新时间:2022-12-06
接口描述
本接口用于创建指定路由表的路由规则。
请求结构
Plain Text
1POST /v2/route/rule?clientToken={clientToken} HTTP/1.1
2Host: bec.baidubce.com
3Authorization: authorization string
4
5{
6 "description": "",
7 "destinationAddress": "",
8 "ipVersion": "4、6",
9 "nexthopId": "",
10 "nexthopType": "custom、system、havip",
11 "routeTableId": "",
12 "sourceAddress": ""
13}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
request | 创建路由规则请求 | body | 是 | CreateBecRouteRequest |
description | 描述 | 否 | string | |
destinationAddress | 目的网段 | 是 | string | |
ipVersion | IP version | 否 | integer | |
nexthopId | 下一跳ID | 否 | string | |
nexthopType | 路由类型。custom:实例路由;system:系统;havip:高可用虚拟IP | 否 | string | |
routeTableId | 路由表ID | 是 | string | |
sourceAddress | 源网段 | 是 | string | |
clientToken | 幂等性Token,是一个长度不超过64位的ASCII字符串 | query | 否 | string |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 参数说明 | 类型 |
---|---|---|
routeRuleId | 路由规则ID | string |
错误码
请参照错误返回章节的内容。
请求示例
Plain Text
1POST /v2/route/rule?clientToken=123456789 HTTP/1.1
2Host: bec.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "description": "test",
7 "destinationAddress": "172.16.0.0/20",
8 "ipVersion": "4",
9 "nexthopId": "vm-ibxjagaf-7-b-singapore-da2yu",
10 "nexthopType": "custom",
11 "routeTableId": "rtb-p5vt1kcg",
12 "sourceAddress": "172.16.48.0/24"
13}
响应示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2015 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6
7{
8 "routeRuleId": "rtr-zwq2dk7w"
9}