Skip to content

Instantly share code, notes, and snippets.

@gibizer
Created June 15, 2021 13:15
Show Gist options
  • Save gibizer/701ae458f5e673242e9428a9029da8fe to your computer and use it in GitHub Desktop.
Save gibizer/701ae458f5e673242e9428a9029da8fe to your computer and use it in GitHub Desktop.
import openstack
def main():
cloud = openstack.connect()
projects = cloud.list_projects()
for project in projects:
print('project_id:', project['id'])
floating_ips = cloud.list_floating_ips(
filters={"project_id": project["id"]},
)
for floating_ip in floating_ips:
print(
' floating ip:',
floating_ip['floating_ip_address'],
)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment