# this is designed to use a totally empty new directory
# so we demonstrate how to bootstrap the whole thing
+from __future__ import print_function
+
# init logging on console
import logging
console = logging.StreamHandler()
import sys
args=sys.argv[1:]
if len(args)!=1:
- print "Usage: %s directory"%sys.argv[0]
+ print("Usage: %s directory"%sys.argv[0])
sys.exit(1)
dir=args[0]
logger.debug('sfaclientsample: Using directory %s'%dir)
else:
return content[:length+1]+ ' '+suffix
-def has_call_id (server_version):
- return server_version.has_key('call_id_support')
-
### issue a GetVersion call
### this assumes we've already somehow initialized the certificate
bootstrap.self_signed_cert()
server_proxy = bootstrap.server_proxy_simple(url)
server_version = server_proxy.GetVersion()
- print "miniclient: GetVersion at %s returned:"%(url)
- for (k,v) in server_version.iteritems(): print "miniclient: \tversion[%s]=%s"%(k,truncate(v))
- print "has-call-id=",has_call_id(server_version)
+ print("miniclient: GetVersion at %s returned:"%(url))
+ for (k,v) in server_version.iteritems(): print("miniclient: \tversion[%s]=%s"%(k,truncate(v)))
# version_dict = {'type': 'SFA', 'version': '1', }
credentials = [ credential ]
options = {}
options [ 'geni_rspec_version' ] = version_dict
-# options [ 'call_id' ] = unique_call_id()
+ options [ 'call_id' ] = unique_call_id()
list_resources = bootstrap.server_proxy (aggregate_url).ListResources(credentials,options)
- print "miniclient: ListResources at %s returned : %s"%(aggregate_url,truncate(list_resources))
+ print("miniclient: ListResources at %s returned : %s"%(aggregate_url,truncate(list_resources)))
def list_slice_resources ():
bootstrap.bootstrap_my_gid()
options = { }
options [ 'geni_rspec_version' ] = version_dict
options [ 'geni_slice_urn' ] = slice_urn
-# options [ 'call_id' ] = unique_call_id()
+ options [ 'call_id' ] = unique_call_id()
list_resources = bootstrap.server_proxy (aggregate_url).ListResources(credentials,options)
- print "miniclient: ListResources at %s for slice %s returned : %s"%(aggregate_url,slice_urn,truncate(list_resources))
-
+ print("miniclient: ListResources at %s for slice %s returned : %s"%(aggregate_url,slice_urn,truncate(list_resources)))
def main ():
get_version(registry_url)
get_version(aggregate_url)
-# list_resources()
-# list_slice_resources()
+ list_resources()
+ list_slice_resources()
main()