there is a disconnect between the methods that help(libvirt) shows for class virStorageVol
and the method listed in
/usr/lib64/python2.6/site-packages/libvirt.py for the same class. method createXML used
for virStorageVolCreateXML is missing when i use help(libvirt) and scroll down to the
class virStorageVol, however the method is listed in libvirt.py as:
def createXML(self, xmldesc, flags):
"""Create a storage volume within a pool based
on an XML description. Not all pools support
creation of volumes """
ret = libvirtmod.virStorageVolCreateXML(self._o, xmldesc, flags)
if ret is None:raise libvirtError('virStorageVolCreateXML() failed',
pool=self)
__tmp = virStorageVol(self, _obj=ret)
return __tmp
________________________________
From: Osier Yang <jyang(a)redhat.com>
To: Syed A. Ali <syed_a_ali(a)yahoo.com>
Cc: "libvirt-users(a)redhat.com" <libvirt-users(a)redhat.com>
Sent: Monday, May 7, 2012 6:23 AM
Subject: Re: [libvirt-users] list storage pools and volumes using python api calls
On 2012年05月07日 13:26, Syed A. Ali wrote:
how do i list storage pools and volumes using the python bindings?
basically the python api calls for virsh pool-list and virsh vol-list
thanks
# python
>> import libvirt
>> help(libvirt)
You will find "listStoragePools" in class "virConnect",
and "listVolumes" in class "virStoragePool".
Regards,
Osier
_______________________________________________
libvirt-users mailing list
libvirt-users(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users