Re: libvirt python api for storage-volumes and storage-pools

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/07/2012 01:28 PM, John Wayne wrote:
hi,

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
I think I have answered your question in previous mail:

You may use 'dir' to list all of class/method of libvirt/sub-class:
>>> import libvirt
>>> con = libvirt.open(None)
>>> dir(con)
>>>dir(libvirt)
>>>dir(libvirt. virConnect)

s/virConnect/virStoragePool/ to list all of methods of a pool,
and s/virConnect/virStorageVol/ to list all of methods of a volume.

If you don't know how to pass a arguments to above methods, please use python's help() to see it such as help(con.listStoragePools) and help(libvirt.virStoragePool.listVolumes), 'dir' and 'help' are a python built-in method, which hasn't any relationship with libvirt.
so it doesn't matter if you don't familiar with libvirt.

thanks

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users


[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux