Added a 'get_geni_aggregates' call and /etc/sfa/geni_aggregates.xml so that users...
authorJosh Karlin <jkarlin@bbn.com>
Fri, 26 Mar 2010 21:00:10 +0000 (21:00 +0000)
committerJosh Karlin <jkarlin@bbn.com>
Fri, 26 Mar 2010 21:00:10 +0000 (21:00 +0000)
setup.py
sfa/client/sfi.py
sfa/methods/__init__.py
sfa/methods/get_aggregates.py

index eb94e80..040c76e 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -43,6 +43,7 @@ package_dirs = [
 
 
 data_files = [('/etc/sfa/', [ 'config/aggregates.xml',
+                              'config/geni_aggregates.xml',
                               'config/registries.xml',
                               'config/default_config.xml',
                               'config/sfi_config']),
index ed8b250..0f46a4a 100755 (executable)
@@ -153,7 +153,8 @@ class Sfi:
                   "delegate": "name",
                   "GetVersion": "name",
                   "ListResources": "name",
-                  "CreateSliver": "name" 
+                  "CreateSliver": "name",
+                  "get_geni_aggregates": "name"
                  }
 
         if additional_cmdargs:
@@ -717,12 +718,27 @@ class Sfi:
         """
         user_cred = self.get_user_cred().save_to_string(save_parents=True)
         hrn = None
-        if args: 
+        if args:
             hrn = args[0]
+
         result = self.registry.get_aggregates(user_cred, hrn)
         display_list(result)
         return 
 
+    def get_geni_aggregates(self, opts, args):
+        """
+        return a list of details about known aggregates
+        """
+        user_cred = self.get_user_cred().save_to_string(save_parents=True)
+        hrn = None
+        if args:
+            hrn = args[0]
+
+        result = self.registry.get_geni_aggregates(user_cred, hrn)
+        display_list(result)
+        return 
+
+
     def registries(self, opts, args):
         """
         return a list of details about known registries
index ab9fa1f..b9d83b2 100644 (file)
@@ -29,4 +29,5 @@ remove_peer_object
 GetVersion
 ListResources
 CreateSliver
+get_geni_aggregates
 """.split()
index da9859a..421dcf8 100644 (file)
@@ -20,10 +20,11 @@ class get_aggregates(Method):
     interfaces = ['registry', 'aggregate', 'slicemgr']
     
     accepts = [
-        Parameter(str, "Credential string"),
+        Parameter(str, "Credential string"),        
         Mixed(Parameter(str, "Human readable name (hrn or urn)"),
               Parameter(None, "hrn not specified"))
         ]
+    
 
     returns = [Parameter(dict, "Aggregate interface information")]
     
@@ -42,5 +43,6 @@ class get_aggregates(Method):
             interfaces = aggregates.interfaces
         else:
             interfaces = [interface for interface in aggregates.interfaces if interface['hrn'] in hrn_list]
-      
+
+
         return interfaces