get_rspec unchanged on the ticket side..
return clusterList
-def get_rspec(api, creds, options, call_id):
+def ListResources(api, creds, options, call_id):
if Callids().already_handled(call_id): return ""
global cloud
# get slice's hrn from options
# theRSpec = xml.read()
#create_slice(None, 'planetcloud.pc.test', theRSpec, 'call-id-cloudtest')
- #rspec = get_rspec('euca', 'planetcloud.pc.test', 'planetcloud.pc.marcoy', 'test_euca')
+ #rspec = ListResources('euca', 'planetcloud.pc.test', 'planetcloud.pc.marcoy', 'test_euca')
#print rspec
print getKeysForSlice('gc.gc.test1')
return 1
-def get_rspec(api, creds, options, call_id):
+def ListResources(api, creds, options, call_id):
if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
t = get_interface_map()
r = RSpec()
rspec_xml = open(sys.argv[1]).read()
- #get_rspec(None,'foo')
+ #ListResources(None,'foo')
create_slice(None, "plc.princeton.sap0", rspec_xml, 'call-id-sap0')
if __name__ == "__main__":
return 0
# Thierry : this would need to handle call_id like the other AMs but is outdated...
-def get_rspec(cred, xrn=None):
+def ListResources(cred, xrn=None):
hrn = urn_to_hrn(xrn)[0]
- if DEBUG: print "Received get_rspec call"
+ if DEBUG: print "Received ListResources call"
slice_id = generate_slide_id(cred, hrn)
msg = struct.pack('> B%ds' % len(slice_id), SFA_GET_RESOURCES, slice_id)
# xxx Thierry : caching at the aggregate level sounds wrong...
caching=True
#caching=False
-def get_rspec(api, creds, options,call_id):
+def ListResources(api, creds, options,call_id):
if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
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)
+ api.logger.info("aggregate.ListResources: returning cached value for hrn %s"%hrn)
return rspec
network = Network(api)
def main():
api = SfaAPI()
"""
- 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')
+ rspec = ListResources(api, "plc.princeton.sapan", None, 'pl_test_sapan')
+ #rspec = ListResources(api, "plc.princeton.coblitz", None, 'pl_test_coblitz')
+ #rspec = ListResources(api, "plc.pl.sirius", None, 'pl_test_sirius')
print rspec
"""
f = open(sys.argv[1])
return True
-def get_rspec(api, creds, options,call_id):
+def ListResources(api, creds, options,call_id):
if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
def main():
api = SfaAPI()
"""
- #rspec = get_rspec(api, None, None,)
- rspec = get_rspec(api, "plc.princeton.iias", None, 'vini_test')
+ #rspec = ListResources(api, None, None,)
+ rspec = ListResources(api, "plc.princeton.iias", None, 'vini_test')
print rspec
"""
f = open(sys.argv[1])
# Thierry : caching at the slicemgr level makes sense to some extent
caching=True
#caching=False
-def get_rspec(api, creds, options, call_id):
+def ListResources(api, creds, options, call_id):
if Callids().already_handled(call_id):
- api.logger.info("%d received get_rspec with known call_id %s"%(api.interface,call_id))
+ api.logger.info("%d received ListResources with known call_id %s"%(api.interface,call_id))
return ""
# get slice's hrn from options
origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
# get manager for this interface
manager = self.api.get_interface_manager()
- rspec = manager.get_rspec(self.api, creds, options, call_id)
+ rspec = manager.ListResources(self.api, creds, options, call_id)
# filter rspec through sfatables
if self.api.interface in ['aggregate']:
return 1
-def get_rspec(api, hrn):
+def ListResources(api, hrn):
# Eg. config line:
# plc.princeton.sapan vlan23,vlan45
t = get_interface_map()
r = RSpec()
rspec_xml = open(sys.argv[1]).read()
- #get_rspec(None,'foo')
+ #ListResources(None,'foo')
create_slice(None, "plc.princeton.sap0", rspec_xml)
if __name__ == "__main__":
print "IO error"
return 0
-def get_rspec(cred, hrn=None):
- if DEBUG: print "Received get_rspec call"
+def ListResources(cred, hrn=None):
+ if DEBUG: print "Received ListResources call"
slice_id = generate_slide_id(cred, hrn)
msg = struct.pack('> B%ds' % len(slice_id), SFA_GET_RESOURCES, slice_id)