Here's a sample:
[vagrant@localhost ~]$ python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import xmlrpclib
>>> import urllib2
>>>
s=xmlrpclib.Server(
"http://169.254.0.20/")
>>>
sess=s.session.login_with_password("root","xenroot")['Value']
>>> resp =
urllib2.urlopen(
"http://169.254.0.23/rrd_updates?session_id=%s&start=1417006800"
% sess)
>>> resp.read()
'<?xml version="1.0"
encoding="UTF-8"?>\n<xport><meta><start>1417006860</start><step>60</step><end>1417008180</end><rows>24</rows><columns>2</columns><legend><entry>AVERAGE:vm:7d3f9b63-82b1-4328-b475-f85417c6fe82:cpu0</entry><entry>AVERAGE:vm:7d3f9b63-82b1-4328-b475-f85417c6fe82:memory</entry></legend></meta><data><row><t>1417008180</t><v>0.0307</v><v>788529152.0000</v></row><row><t>1417008120</t><v>0.0348</v><v>788529152.0000</v></row><row><t>1417008060</t><v>0.0301</v><v>788529152.0000</v></row><row><t>1417008000</t><v>0.2650</v><v>788529152.0000</v></row><row><t>1417007940</t><v>0.0647</v><v>788529152.0000</v></row><row><t>1417007880&
lt;/t><v>0.0452</v><v>788529152.0000</v></row><row><t>1417007820</t><v>0.1465</v><v>525686112.0000</v></row><row><t>1417007760</t><v>NaN</v><v>NaN</v></row><row><t>1417007700</t><v>NaN</v><v>NaN</v></row><row><t>1417007640</t><v>NaN</v><v>NaN</v></row><row><t>1417007580</t><v>NaN</v><v>NaN</v></row><row><t>1417007520</t><v>NaN</v><v>NaN</v></row><row><t>1417007460</t><v>NaN</v><v>NaN</v></row><row><t>1417007400</t><v>NaN</v><v>NaN</v></row><row><t>1417007340</t><v>NaN</v><v>NaN</v></row><row><t>1417007280</t>&l
t;v>NaN</v><v>NaN</v></row><row><t>1417007220</t><v>NaN</v><v>NaN</v></row><row><t>1417007160</t><v>NaN</v><v>NaN</v></row><row><t>1417007100</t><v>NaN</v><v>NaN</v></row><row><t>1417007040</t><v>NaN</v><v>NaN</v></row><row><t>1417006980</t><v>NaN</v><v>NaN</v></row><row><t>1417006920</t><v>NaN</v><v>NaN</v></row><row><t>1417006860</t><v>NaN</v><v>NaN</v></row><row><t>1417006800</t><v>NaN</v><v>NaN</v></row></data></xport>'
>>>
Jon
On 25/11/14 13:19, Will Sun wrote:
Hi Jon,
Thanks very much. As you said, I create one session on the
master,(the code I give in last email is also firstly creates
one session on the master ), then I use that session for
querying the RRD data on one slave.But it shows failure
['HOST_OFFLINE'], that means I attempted an operation
which involves a host which cannot be contacted.
I want to confirm one thing: where is the RRD of
slave stored? master host or slave host itself? I think it's
slave.
How do I
use the session on the master to query the RRD data on each
slave? Can you give me a sample?
Thanks and
Regards,
Will
_______________________________________________
Xen-api mailing list
Xen-api@xxxxxxxxxxxxx
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api