Ask Your Question
0

public and private network id not shown while using api v1.1

asked 2012-01-18 16:27:52 -0500

gcivitella gravatar image

Hi all,

while using Diablo and a mix of api 1.0 and 1.1 it was possible separate private from public ips because a query to the api server generated a response like this: <addresses> <network id="public"> <ip version="4" addr="67.23.10.132"/> </network> <network id="private"> <ip version="4" addr="10.176.42.16"/> </network> </addresses>

I'm now using api v1.1 on Essex-2 and when I do a similar query to the api server I get:

{"addresses": {"myproj-net": [{"version": 4, "addr": "10.176.42.16"}, {"version": 4, "addr": "67.23.10.132"}]}}

while a was expecting an output not much different than before (according to http://wiki.openstack.org/OpenStackAPI_1-1 (http://wiki.openstack.org/OpenStackAP...) ). Is this a bug or am I missing something?

Thanks a lot Giuseppe

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2012-01-18 17:42:29 -0500

You can always find the latest api docs here: http://docs.openstack.org . And here's the specific page you need: http://docs.openstack.org/api/openstack-compute/1.1/content/List_Addresses-d1e3014.html (http://docs.openstack.org/api/opensta...) . So the format you see currently is correct. We used to map fixed and floating ips to private and public networks, respectively. That behavior was incorrect, so we now expose the networks with their actual ids.

edit flag offensive delete link more
0

answered 2012-01-19 08:38:50 -0500

gcivitella gravatar image

Hi Brian,

thanks for the quick answer. I'm looking for a way to distinguish private (or fixed) ips from public (or floating) parsing in software an array like the one shown before: {"addresses": {"myproj-net": [{"version": 4, "addr": "10.176.42.16"}, {"version": 4, "addr": "67.23.10.132"}]}

Can I assume that the first ip is (and will always be) the private ip assigned to the server and the second ip, if present, is (and will always be) the public one?

Are there plans to change in a future release the way ips are exposed?

Hope I made my point more clear.

Best regards Giuseppe

edit flag offensive delete link more
0

answered 2012-01-19 17:17:47 -0500

I understand the frustration, but right now there isn't a dependable way to get fixed vs floating out of that data structure. However, you could try to use the os-floating-ips resource (it's an extension). A call to GET /v2/<tenant_id>/os-floating-ips/ will return a list of floating ip objects allocated to the given project. From that info you can see each floating ip, what fixed ip it is associated with, and what instance it resolves to. Hopefully that gets you enough information for now.

edit flag offensive delete link more
0

answered 2012-01-20 08:26:11 -0500

gcivitella gravatar image

Thanks Brian Waldon, that solved my question.

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: 2012-01-18 16:27:52 -0500

Seen: 41 times

Last updated: Jan 20 '12