Setting tag plcapi-7.0-0
[plcapi.git] / doc / PLCAPI.xml.in
index 02ed262..da18878 100644 (file)
 <programlisting> 
 >>> tagnames=['arch','fcdistro','hrn','hmac','exempt_node_until']
 >>> for tt in GetTagTypes(tagnames,['tagname','category']): 
->>> ... print "tagname=%-18s category=%s"%(tt['tagname'], tt['category'])
+>>> ... print("tagname=%-18s category=%s"%(tt['tagname'], tt['category']))
 tagname=hrn                category=node/sfa
 tagname=hmac               category=slice/auth  
 tagname=exempt_node_until  category=node/myops
@@ -419,24 +419,24 @@ LINE 1: ...M view_nodes WHERE deleted IS False AND (True AND hrn ILIKE ...
 >>> AddNodeGroup('betanodes','deployment','beta')
 22
 ### checking contents (no node has 'deployment' set to either 'alpha' or 'beta' yet)
->>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print ng
+>>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print(ng)
 {'groupname': u'alphanodes', 'node_ids': []}
 {'groupname': u'betanodes', 'node_ids': []}
 
 ### displaying node ids 
->>> for n in GetNodes({'hostname':'*.inria.fr'},['hostname','node_id']): print n
+>>> for n in GetNodes({'hostname':'*.inria.fr'},['hostname','node_id']): print(n)
 {'hostname': u'vnode01.inria.fr', 'node_id': 1}
 {'hostname': u'vnode02.inria.fr', 'node_id': 2}
 
 ### setting 'deployment' for these two nodes
 >>> SetNodeDeployment('vnode01.inria.fr','alpha')
->>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print ng
+>>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print(ng)
 {'groupname': u'alphanodes', 'node_ids': [1]}
 {'groupname': u'betanodes', 'node_ids': []}
 >>> SetNodeDeployment('vnode02.inria.fr','beta')
 
 ### checking contents again
->>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print ng
+>>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print(ng)
 {'groupname': u'alphanodes', 'node_ids': [1]}
 {'groupname': u'betanodes', 'node_ids': [2]}
 </programlisting>
@@ -503,7 +503,7 @@ Type "system.listMethods()" or "help(method)" for more information.
       the <function>PLC.Shell</function> module:</para>
 
       <programlisting>
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import sys
 
@@ -535,9 +535,9 @@ nodes = plc.GetNodes([121], ['node_id', 'hostname'])
     the name of all the hosts attached to a given slice.</para>
 
 <programlisting>
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
-import xmlrpclib
+import xmlrpc.client
 
 plc_host='www.planet-lab.eu'
 
@@ -550,7 +550,7 @@ auth = { 'AuthMethod' : 'password',
 
 api_url="https://%s:443/PLCAPI/"%plc_host
 
-plc_api = xmlrpclib.ServerProxy(api_url,allow_none=True)
+plc_api = xmlrpc.client.ServerProxy(api_url,allow_none=True)
 
 # the slice's node ids
 node_ids = plc_api.GetSlices(auth,slice_name,['node_ids'])[0]['node_ids']