[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r21887 - gnunet-planetlab/planetlab-api
From: |
gnunet |
Subject: |
[GNUnet-SVN] r21887 - gnunet-planetlab/planetlab-api |
Date: |
Mon, 11 Jun 2012 15:09:54 +0200 |
Author: wachs
Date: 2012-06-11 15:09:54 +0200 (Mon, 11 Jun 2012)
New Revision: 21887
Added:
gnunet-planetlab/planetlab-api/getmynodes.py
Log:
- script
Added: gnunet-planetlab/planetlab-api/getmynodes.py
===================================================================
--- gnunet-planetlab/planetlab-api/getmynodes.py
(rev 0)
+++ gnunet-planetlab/planetlab-api/getmynodes.py 2012-06-11 13:09:54 UTC
(rev 21887)
@@ -0,0 +1,40 @@
+#!/usr/bin/python
+import sys, os, urllib, xmlrpclib, socket
+
+user = ''
+password = ''
+slice = 'tumple_gnunet'
+
+arg = sys.argv
+size = len(arg)
+if (len(arg) < 4):
+ print 'usage: -u <username> -p <password>'
+ exit()
+
+if (arg[1] == '-u'):
+ user = arg[2]
+if (arg[3] == '-p'):
+ password = arg [4]
+
+# the PL Central API
+# apiurl = 'https://www.planet-lab.org/PLCAPI/'
+
+# Planetlab EU API
+apiurl = 'https://www.planet-lab.eu/PLCAPI/'
+server = xmlrpclib.ServerProxy(apiurl)
+slice_data = {}
+slice_data['name'] = 'tumple_gnunet'
+
+# the auth struct
+auth = {}
+auth['Username'] = user
+auth['AuthString'] = password
+auth['AuthMethod'] = "password"
+
+
+node_ids = server.GetSlices(auth, [slice_data['name']],
['node_ids'])[0]['node_ids']
+node_hostnames = [node['hostname'] for node in server.GetNodes(auth, node_ids,
['hostname'])]
+
+for node in node_hostnames:
+ print node
+
Property changes on: gnunet-planetlab/planetlab-api/getmynodes.py
___________________________________________________________________
Added: svn:executable
+ *
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r21887 - gnunet-planetlab/planetlab-api,
gnunet <=