From 82206e658ba864a04b794c85362a22e83c4b628c Mon Sep 17 00:00:00 2001 From: Josh Karlin Date: Fri, 26 Mar 2010 21:00:10 +0000 Subject: [PATCH] Added a 'get_geni_aggregates' call and /etc/sfa/geni_aggregates.xml so that users can list them from an SM and contact them directly --- setup.py | 1 + sfa/client/sfi.py | 20 ++++++++++++++++++-- sfa/methods/__init__.py | 1 + sfa/methods/get_aggregates.py | 6 ++++-- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index eb94e805..040c76ec 100755 --- 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']), diff --git a/sfa/client/sfi.py b/sfa/client/sfi.py index ed8b2500..0f46a4a4 100755 --- a/sfa/client/sfi.py +++ b/sfa/client/sfi.py @@ -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 diff --git a/sfa/methods/__init__.py b/sfa/methods/__init__.py index ab9fa1f7..b9d83b2c 100644 --- a/sfa/methods/__init__.py +++ b/sfa/methods/__init__.py @@ -29,4 +29,5 @@ remove_peer_object GetVersion ListResources CreateSliver +get_geni_aggregates """.split() diff --git a/sfa/methods/get_aggregates.py b/sfa/methods/get_aggregates.py index da9859a9..421dcf83 100644 --- a/sfa/methods/get_aggregates.py +++ b/sfa/methods/get_aggregates.py @@ -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 -- 2.47.0