Ask Your Question
1

How to add external network to a router via restful api?

asked 2015-03-30 06:15:22 -0600

frz59 gravatar image

updated 2015-03-30 06:16:11 -0600

Hi there, I want to update my router and add an external gateway via RestFul api. but I can't find any reference for that. Could you help me?

edit retag flag offensive close merge delete

Comments

1
  1. neutron client is exposing api add_gateway_router() which can be used
Ranjit gravatar imageRanjit ( 2015-03-30 07:40:24 -0600 )edit
2

or if you want to create http request ,then first debug the output of command

neutron --debug router-gateway-set router-id network-id .

you will get to know the actual restful api and required paramters

Ranjit gravatar imageRanjit ( 2015-03-30 07:44:44 -0600 )edit
1

^ I agree that's your best bet just reading the debug output and pulling the required curl commands.

omar-munoz gravatar imageomar-munoz ( 2015-03-30 13:16:30 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2015-03-31 02:49:20 -0600

frz59 gravatar image

I found the answer. Thank You @Ranjit

 curl -i -X PUT http://<server_address>:9696/v2.0/routers/<router_id> -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: TOKEN_REDACTED" -d '{"router": {"external_gateway_info": {"network_id":"<network_id>"}}}'
edit flag offensive delete link more

Comments

i m creating a router with external ntwrk as a response i dont get any port information from response .But if i see new port get's added dynamically for that network with "router_external_gateway" . Is there any way to collect my port info frm my external network id or routerid without port rest api

micheal-jordan gravatar imagemicheal-jordan ( 2018-08-11 05:48:11 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2015-03-30 06:15:22 -0600

Seen: 606 times

Last updated: Mar 31 '15