简体   繁体   中英

'openstack ip availability list/show' in Python API

I would like to use this openstack command using the Python API. Going through the Neutron documentation, I found this page .

I tried executing 'network_ip_availability.ListIpAvailability(neutron.list_networks())' but it I get a 'TypeError: __init__() takes at least 3 arguments (2 given)'.

I cannot figure out what else does it need aside from a list of networks to display its IPs.

Any help in understanding on how to use these commands in Python API will be appreciated. Thank you.

I wouldn't use that internal API, but use the public one here . You'll need:

  1. Install the openstacksdk using pip pip install openstacksdk
  2. Get a Openstack connection object with your credentials. See more at connect guide
  3. Use the connection object above to access Openstack resource. For instance, here the guide to access network resource API .
  4. And finally, use the network API to get available floating IPs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM