[Planetlab-users] To get list of nodes of a slide

Barış Metin Talip-Baris.Metin at sophia.inria.fr
Wed Nov 25 18:06:28 EST 2009


Hello,

On Wed, Nov 25, 2009 at 11:27 PM, minh nguyen <skminh at gmail.com> wrote:
> Hello everyone,
> How can we get a list of existing nodes in a certain slide
> and save to text file?
> Somehow like this file which is returned in planetlab's helloworld tutorial
> http://comon.cs.princeton.edu/status/tabulator.cgi?table=
> table_nodeviewshort&format=nameonly&persite=1&
> select='resptime>0
> But I want to get the list of existing nodes of a slide (e.g "test_slide")

Python commands below will print a list of nodes (hostnames only) for
a given SLICE_NAME.

>>> import xmlrpclib
>>> api = xmlrpclib.ServerProxy('https://www.planet-lab.org/PLCAPI/')
>>> auth = {'Username':YOUR_EMAIL,'AuthString':YOUR_PASS,'AuthMethod':'password'}
>>> node_ids = api.GetSlices(auth, SLICE_NAME)[0]['node_ids']
>>> [x['hostname'] for x in api.GetNodes(auth, node_ids,['hostname'])]

Regards,
-- 
Baris



More information about the Users mailing list