renamed get_rspec into ListResources on the managers side
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 8 Apr 2011 11:47:39 +0000 (13:47 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 8 Apr 2011 11:47:39 +0000 (13:47 +0200)
get_rspec unchanged on the ticket side..

sfa/managers/aggregate_manager_eucalyptus.py
sfa/managers/aggregate_manager_max.py
sfa/managers/aggregate_manager_openflow.py
sfa/managers/aggregate_manager_pl.py
sfa/managers/aggregate_manager_vini.py
sfa/managers/slice_manager_pl.py
sfa/methods/ListResources.py
sfa/rspecs/aggregates/rspec_manager_max.py
sfa/rspecs/aggregates/rspec_manager_openflow.py

index f6bb946..8dc604b 100644 (file)
@@ -394,7 +394,7 @@ class ZoneResultParser(object):
 
         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
@@ -573,7 +573,7 @@ def main():
     #    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')
 
index 6f4382b..ed18d85 100644 (file)
@@ -254,7 +254,7 @@ def create_slice_max_aggregate(api, hrn, nodes):
     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', '')
@@ -337,7 +337,7 @@ def main():
     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__":
index 41ced8e..8511f23 100755 (executable)
@@ -136,9 +136,9 @@ def create_slice(cred, xrn, rspec, call_id):
     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)
index 9dd2680..91d9a4d 100644 (file)
@@ -295,7 +295,7 @@ def get_slices(api, creds):
 # 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', '')
@@ -305,7 +305,7 @@ def get_rspec(api, creds, options,call_id):
     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)
@@ -385,9 +385,9 @@ def get_ticket(api, xrn, creds, rspec, users):
 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])
index f5d598f..08162c1 100644 (file)
@@ -91,7 +91,7 @@ def create_slice(api, xrn, creds, xml, users, call_id):
 
     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', '')
@@ -119,8 +119,8 @@ def get_rspec(api, creds, options,call_id):
 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])
index a851d5d..cfc2fbb 100644 (file)
@@ -329,10 +329,10 @@ def get_slices(api, creds):
 # 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
index 905a060..fb83117 100644 (file)
@@ -40,7 +40,7 @@ class ListResources(Method):
             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']:
index c055d2d..1c80edd 100644 (file)
@@ -248,7 +248,7 @@ def create_slice_max_aggregate(api, hrn, nodes):
     return 1
 
 
-def get_rspec(api, hrn):
+def ListResources(api, hrn):
     # Eg. config line:
     # plc.princeton.sapan vlan23,vlan45
 
@@ -324,7 +324,7 @@ def main():
     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__":
index 4871509..aea1861 100755 (executable)
@@ -126,8 +126,8 @@ def create_slice(cred, hrn, rspec):
         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)