Ask Your Question
0

Error in adding interface in router using curl command

asked 2017-02-15 06:52:25 -0500

Nek gravatar image

HI,

I 'm trying to add an interface to a router, using this command I found in another thread in this forum:

curl -i -X PUT http://192.168.2.40:9696/v2.0/routers/68d958cd-779b-4449-8846-fb7c01c0b51d (http://192.168.2.40:9696/v2.0/routers...) -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" -d '{"subnet_id": "97ac7815-a1f0-470a-ac1b-a5c126f401af"}'

where {68d958cd-779b-4449-8846-fb7c01c0b51d} is the router_id I get from this command: curl -s -k -H "X-Auth-Token: $TOKEN" http://192.168.2.40:9696/v2.0/routers | python -m json.tool

and "subnet_id" is the id of the interface I want to add to the router,

but I 'm getting error: NeutronError": {"message": "Unable to find 'router' in request body", "type": "HTTPBadRequest", "detail": ""}.

Can you understand what goes wrong? Thanx

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-02-15 16:13:55 -0500

Your API is updating a router, not adding an interface. Append add_router_interface to the API request, i.e. http://192.168.2.40:9696/v2.0/routers/68d958cd-779b-4449-8846-fb7c01c0b51/add_router_interface. See https://developer.openstack.org/api-r....

edit flag offensive delete link more
0

answered 2017-02-16 01:17:37 -0500

Nek gravatar image

Hi, you are right! Now it worked!

Thank you!

edit flag offensive delete link more

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

1 follower

Stats

Asked: 2017-02-15 06:52:25 -0500

Seen: 31 times

Last updated: Feb 15 '17