[Openstack] Python API: Getting a list of floating ips?

Lars Kellogg-Stedman lars at seas.harvard.edu
Thu Nov 22 02:01:38 UTC 2012


Using the Python API, what's the best of getting a list of floating
ips assigned to an instance?  The Server.addresses dictionary contains
*both* fixed and floating ips, and doesn't appear to differentiate
between them.  E.g:

    srvr = client.servers.find(name='myinstance')
    print srvr.addresses
    {u'fixed_0': [{u'addr': u'172.16.10.31', u'version': 4},
                  {u'addr': u'10.243.28.46', u'version': 4}]}

Do I just assume that the first address in the list is the fixed
address?

-- 
Lars Kellogg-Stedman <lars at seas.harvard.edu>  |
Senior Technologist                           | http://ac.seas.harvard.edu/
Academic Computing                            | http://code.seas.harvard.edu/
Harvard School of Engineering                 |
  and Applied Sciences                        |





More information about the Openstack mailing list