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

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

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=""/> </network> <network id="private"> <ip version="4" addr=""/> </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": ""}, {"version": 4, "addr": ""}]}}

while a was expecting an output not much different than before (according to ( ). 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

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

You can always find the latest api docs here: . And here's the specific page you need: ( . 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

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

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": ""}, {"version": 4, "addr": ""}]}

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

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

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

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

gcivitella gravatar image

Thanks Brian Waldon, that solved my question.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2012-01-18 16:27:52 -0600

Seen: 75 times

Last updated: Jan 20 '12