[Engine-devel] ovirt engine sdk

Michael Pasternak mpastern at redhat.com
Wed Jan 23 14:12:58 UTC 2013


On 01/23/2013 03:53 PM, navin p wrote:
> Hi Michael,
>  
> Thanks for your help.
> 
> On Wed, Jan 23, 2013 at 6:15 PM, Michael Pasternak <mpastern at redhat.com <mailto:mpastern at redhat.com>> wrote:
> 
> 
> 
>     in python, you can see object's attributes by accessing __dict__/__getattr__/dir(object)/etc.,
>     vm.__dict__ will do the job for you, however i'd suggest you using some IDE (i'm using Eclipse + PyDev plugin),
>     this way you'll be able accessing object attributes simply by Ctrl+SPACE auto-completion.
> 
>   Do i have import something for Ctrl+SPACE to work ? It doesn't work for me atleast for list attributes.
> 
> for vm in vmlist:
>     print vm.name <http://vm.name>,vm.memory,vm.id <http://vm.id>,vm.os.kernel,vm.cluster.id <http://vm.cluster.id>,vm.start_time
>     #print help(vm.statistics.list())
>     vmslist = vm.statistics.list()
>     for i in vmslist:
>        print i.get_name()
> 
> prints
> 
> memory.installed
> memory.used
> cpu.current.guest
> cpu.current.hypervisor
> cpu.current.total
> 
> but i need the values of memory.installed and memory.used .

statistic holders are complex types, you can fetch data by:

i.unit // the unit of the holder data
i.values.value[0].datum // actual data


> 
> Also where do i get the Java SDK and jars ? I looked at maven but it was 1.0 version of SDK.

central repo has 1.0.0.2-1, see [1], deployment details can be found at [2], wiki at [3].

[1] http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.ovirt.engine.sdk%22
[2] http://www.ovirt.org/Java-sdk#Maven_deployment
[3] http://www.ovirt.org/Java-sdk

> 
> 
> Regards,
> Navin 


-- 

Michael Pasternak
RedHat, ENG-Virtualization R&D



More information about the Engine-devel mailing list