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

Asked by Giuseppe Civitella

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).
Is this a bug or am I missing something?

Thanks a lot
Giuseppe

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Brian Waldon
Solved:
Last query:
Last reply:
Revision history for this message
Brian Waldon (bcwaldon) said :
#1

You can always find the latest api docs here: 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. 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.

Revision history for this message
Giuseppe Civitella (gcivitella) said :
#2

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

Revision history for this message
Best Brian Waldon (bcwaldon) said :
#3

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.

Revision history for this message
Giuseppe Civitella (gcivitella) said :
#4

Thanks Brian Waldon, that solved my question.