Ask Your Question
0

how to add interface to router using api

asked 2014-11-01 15:24:57 -0500

amitabh sinha gravatar image

I want to interface to a router using api.please let me know that what body I have to pass as an argument of curl command

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2014-11-10 03:05:55 -0500

amitabh sinha gravatar image

request:

curl -i -X PUT http://10.10.10.51: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": "352626dc-9dea-4eb2-a1a4-e0e68544637b"}'

response: HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 Content-Length: 199 Date: Mon, 10 Nov 2014 07:53:15 GMT

{"subnet_id": "352626dc-9dea-4eb2-a1a4-e0e68544637b", "tenant_id": "357c313a841745ceb82d7009eca0e141", "port_id": "bbb6696d-9297-432d-9213-9576b3b542cb", "id": "05ac07e4-3c75-4eb2-8904-bc22f14db636"}

edit flag offensive delete link more
2

answered 2014-11-03 00:56:29 -0500

This is the equivalent curl request for "neutron router-interface-add" command:

curl -i -X PUT http://NEUTON-SERVER-Details:9696/v2.... -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}AUTH-TOKEN" -d '{"subnet_id": "SUBNET-ID"}'

edit flag offensive delete link more

Comments

thanks for your concern ..i have tried this format ..but it is throwing following error

HTTP/1.1 404 Not Found Content-Length: 49 Content-Type: text/plain; charset=UTF-8 Date: Mon, 10 Nov 2014 07:38:19 GMT

404 Not Found

Unknown API version specified

amitabh sinha gravatar imageamitabh sinha ( 2014-11-10 01:39:45 -0500 )edit

Can you paste the command that, you tried?

TechPatron gravatar imageTechPatron ( 2014-11-10 01:52:09 -0500 )edit

@ techpatron I tried with v2.0 in place of v2 and it worked out. THANKS BRO!

amitabh sinha gravatar imageamitabh sinha ( 2014-11-10 03:04:04 -0500 )edit

Ha ha Okay. It's Okay. Always welcome. :)

TechPatron gravatar imageTechPatron ( 2014-11-10 05:05:54 -0500 )edit
1

answered 2014-11-03 02:10:06 -0500

RHK gravatar image

Hi Amitabh,

Go through below openstack networking API's guide.

http://docs.openstack.org/api/opensta...

Regards,
RHK

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: 2014-11-01 15:24:57 -0500

Seen: 983 times

Last updated: Nov 10 '14