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

Re: [Xen-API] trying to get some data out of XenAPI



> The python bindings 'magically' put in the session variable for you.   

Is the Python API documented somewhere? I can't find all the stuff from the RPC 
docs in the Python sources.
And it's quite hard to figure the python stuff out from the xml rpc 
descriptions.


> Give it a try without passing the session variable to VM.get_record.
> 
> Also, print out the vm_list variable and check its a list of uuids.


Now I have:

#!/usr/bin/python

import sys
sys.path.append('/usr/lib/python')
from xen.xm.XenAPI import Session
session = Session('http://localhost:9363/')
session.login_with_password(' ', ' ')
print session
host_ref = session.get_this_host
vm_list = session.xenapi.VM.get_all()
print vm_list
for vm_ref in vm_list:
        vm_record = session.xenapi.VM.get_record(vm_ref)
        print vm_record
        print "VM name:" + vm_record["name_label"]


I'll see how far I can come with this. I guess it will take me some fiddling to 
find the measures I want to have. It's quite hard to get through this 
currently...

Henning

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.