X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2Fget_aggregates.py;h=da9859a9109dc4fe56e2802b8128d226f0251a86;hb=5c675646bb7a0a80d8802f07985567a194d50c57;hp=7cf8d79a3e038033d993b1ea95d26ec408c54dc4;hpb=3f6347c4fc79310fd192090cb2036a80b84df51c;p=sfa.git diff --git a/sfa/methods/get_aggregates.py b/sfa/methods/get_aggregates.py index 7cf8d79a..da9859a9 100644 --- a/sfa/methods/get_aggregates.py +++ b/sfa/methods/get_aggregates.py @@ -2,7 +2,7 @@ ### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/methods/get_aggregates.py $ from types import StringTypes from sfa.util.faults import * -from sfa.util.misc import * +from sfa.util.namespace import * from sfa.util.method import Method from sfa.util.parameter import Parameter, Mixed from sfa.trust.auth import Auth @@ -13,7 +13,7 @@ class get_aggregates(Method): Get a list of connection information for all known aggregates. @param cred credential string specifying the rights of the caller - @param a Human readable name (hrn), or list of hrns or None + @param a Human readable name (hrn or urn), or list of hrns or None @return list of dictionaries with aggregate information. """ @@ -21,15 +21,14 @@ class get_aggregates(Method): accepts = [ Parameter(str, "Credential string"), - - Mixed(Parameter(str, "Human readable name (hrn)"), - Parameter(None, "hrn not specified")) + Mixed(Parameter(str, "Human readable name (hrn or urn)"), + Parameter(None, "hrn not specified")) ] returns = [Parameter(dict, "Aggregate interface information")] - def call(self, cred, hrn = None): - + def call(self, cred, xrn = None): + hrn, type = urn_to_hrn(xrn) self.api.auth.check(cred, 'list') aggregates = Aggregates(self.api) hrn_list = []