1 from sfa.util.xrn import urn_to_hrn
2 from sfa.util.method import Method
3 from sfa.util.parameter import Parameter, Mixed
4 from sfa.server.registry import Registries
6 class get_registries(Method):
8 Get a list of connection information for all known registries.
10 @param cred credential string specifying the rights of the caller
11 @param a Human readable name (hrn or urn), or list of names or None
12 @return list of dictionaries with aggregate information.
15 interfaces = ['registry', 'aggregate', 'slicemgr']
18 Parameter(str, "Credential string"),
19 Mixed(Parameter(str, "Human readable name (hrn or urn)"),
20 Parameter(None, "hrn not specified"))
23 returns = [Parameter(dict, "Registry interface information")]
25 def call(self, cred, xrn = None):
26 hrn, type = urn_to_hrn(xrn)
27 self.api.auth.check(cred, 'list')
28 registries = Registries(self.api).values()
30 registries = [reg for reg in registries if reg['hrn'] == hrn]