1 from sfa.util.faults import *
2 from sfa.util.method import Method
3 from sfa.util.parameter import Parameter, Mixed
4 from sfa.trust.auth import Auth
5 from sfa.trust.gid import GID
6 from sfa.trust.certificate import Certificate
7 from sfa.trust.credential import Credential
11 Get a list of record information (hrn, gid and type) for
14 @param cred credential string
15 @param cert certificate string
19 interfaces = ['registry']
22 Mixed(Parameter(str, "Human readable name (hrn or xrn)"),
23 Parameter(type([str]), "List of Human readable names (hrn or xrn)")),
24 Mixed(Parameter(str, "Credential string"),
25 Parameter(type([str]), "List of credentials")),
28 returns = [Parameter(dict, "Dictionary of gids keyed on hrn")]
30 def call(self, xrns, creds):
31 # validate the credential
32 valid_creds = self.api.auth.checkCredentials(creds, 'getgids')
33 origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
36 manager = self.api.get_interface_manager()
37 records = manager.resolve(self.api, xrns, full = False)
39 raise RecordNotFound(hrns)
42 allowed_fields = ['hrn', 'type', 'gid']
43 for record in records:
44 for key in record.keys():
45 if key not in allowed_fields: