Openstack Neutron:通过rest api为路由器添加静态路由器

问题描述 投票:1回答:1

我无法让PUT请求为路由器添加静态路由。

我收到以下错误:

{
"NeutronError": {
 "message": "Invalid input for external_gateway_info. Reason: Unexpected keys supplied: routes.",
"type": "HTTPBadRequest",
"detail": ""
}
} 

我的请求有效载荷是:

{ 

"router": { 

"distributed": false, 
"external_gateway_info": { 
"network_id": "04901d68-eb70-410c-a2ae-e4b77d4e4641",
"enable_snat": true, 
"routes": [ 
{ 
"destination": "112.112.112.0/24", 
"nexthop": "117.97.10.2" 
} 

] 

} 

} 

} 

而且,我的网址是:/ routers / {:routerId}

使用相同的路由,我可以在开放堆栈中子中添加静态路由,但不能通过API请求。

这种方法有什么改进吗?

openstack openstack-neutron
1个回答
1
投票

请使用下面的有效负载。

{“router”:{“distributed”:false,“routes”:[{“destination”:“172.1.1.0/24”,“nexthop”:“177.77.44.11”}]}}

© www.soinside.com 2019 - 2024. All rights reserved.