[Openstack] Using Python SDK to retrieve cloud topology

Jean-Pierre Ribeauville jpribeauville at axway.com
Tue Jun 7 14:55:09 UTC 2016


Hi,

#openstack  hypervisor list
+----+-------------------------------------+
| ID | Hypervisor Hostname                 |
+----+-------------------------------------+
|  1 | xxxxxxx.ptx.axway.int |
+----+-------------------------------------+
#



#python test2.py
Hypervisors:
[<Hypervisor: 1>]
.....

Now,  I've to add the Hypervisor hostname display .

Thx for help.

Regards,

J.P.

From: Tobias Urdin [mailto:tobias.urdin at crystone.com]
Sent: mardi 7 juin 2016 16:44
To: Jean-Pierre Ribeauville
Cc: openstack at lists.openstack.org
Subject: Re: [Openstack] Using Python SDK to retrieve cloud topology

Hello Jean-Pierre,

Yes you can.
You can gather or control all parts of OpenStack using the REST API:s

Best regards

#!/usr/bin/env python

from novaclient import client

nova = client.Client(2, "adminuser", "passwordhere", "adminproject", "http://controller:35357/v2.0"<http://controller:35357/v2.0>)

print "Hypervisors:"
print nova.hypervisors.list()

print "Aggregates:"
print nova.aggregates.list()

print "Availability zones:"
print nova.availability_zones.list()
On 06/07/2016 04:16 PM, Jean-Pierre Ribeauville wrote:
Hi,

By using OpenStack Python SDK, is it possible to retrieve such things as hypervisors , aggregate  and availability zones list?
Thx for help.

Regards,

Jean-Pierre RIBEAUVILLE

+33 1 4717 2049



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20160607/d75a2676/attachment.html>


More information about the Openstack mailing list