from sfa.plc.slices import *
from sfa.util.version import version_core
from sfa.util.sfatime import utcparse
+from sfa.util.callids import Callids
def GetVersion(api):
+ xrn=Xrn(api.hrn)
return version_core({'interface':'aggregate',
- 'testbed':'myplc'})
+ 'testbed':'myplc',
+ 'hrn':xrn.get_hrn(),
+ })
def __get_registry_objects(slice_xrn, creds, users):
"""
res['geni_status'] = 'ready'
else:
res['geni_status'] = 'failed'
- top_level_staus = failed
+ top_level_staus = 'failed'
res['geni_error'] = ''
return slice_urns
-def get_rspec(api, creds, options):
+# xxx Thierry : caching at the aggregate level sounds wrong...
+caching=True
+def get_rspec(api, creds, options,call_id):
+ if not Callids().should_handle_call_id(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
- hrn, type = urn_to_hrn(xrn)
+ (hrn, type) = urn_to_hrn(xrn)
# look in cache first
- if api.cache and not xrn:
+ if caching and api.cache and not xrn:
rspec = api.cache.get('nodes')
if rspec:
+ api.logger.info("aggregate.get_rspec: returning cached value for hrn %s"%hrn)
return rspec
network = Network(api)
rspec = network.toxml()
# cache the result
- if api.cache and not xrn:
+ if caching and api.cache and not xrn:
api.cache.add('nodes', rspec)
return rspec
def main():
api = SfaAPI()
"""
- rspec = get_rspec(api, "plc.princeton.sapan", None)
- #rspec = get_rspec(api, "plc.princeton.coblitz", None)
- #rspec = get_rspec(api, "plc.pl.sirius", None)
+ rspec = get_rspec(api, "plc.princeton.sapan", None, 'pl_test_sapan')
+ #rspec = get_rspec(api, "plc.princeton.coblitz", None, 'pl_test_coblitz')
+ #rspec = get_rspec(api, "plc.pl.sirius", None, 'pl_test_sirius')
print rspec
"""
f = open(sys.argv[1])