1 from types import StringTypes
2 from sfa.util.faults import *
3 from sfa.util.xrn import urn_to_hrn
4 from sfa.util.method import Method
5 from sfa.util.parameter import Parameter, Mixed
6 from sfa.trust.auth import Auth
7 from sfa.server.registry import Registries
9 class get_registries(Method):
11 Get a list of connection information for all known registries.
13 @param cred credential string specifying the rights of the caller
14 @param a Human readable name (hrn or urn), or list of names or None
15 @return list of dictionaries with aggregate information.
18 interfaces = ['registry', 'aggregate', 'slicemgr']
21 Parameter(str, "Credential string"),
22 Mixed(Parameter(str, "Human readable name (hrn or urn)"),
23 Parameter(None, "hrn not specified"))
26 returns = [Parameter(dict, "Registry interface information")]
28 def call(self, cred, xrn = None):
29 hrn, type = urn_to_hrn(xrn)
30 self.api.auth.check(cred, 'list')
31 registries = Registries(self.api).interfaces.values()
33 registries = [reg for reg in registries if reg['hrn'] == hrn]