1 from sfa.util.faults import RecordNotFound
2 from sfa.util.method import Method
3 from sfa.util.parameter import Parameter, Mixed
4 from sfa.trust.credential import Credential
8 Get a list of record information (hrn, gid and type) for
11 @param cred credential string
12 @param cert certificate string
16 interfaces = ['registry']
19 Mixed(Parameter(str, "Human readable name (hrn or xrn)"),
20 Parameter(type([str]), "List of Human readable names (hrn or xrn)")),
21 Mixed(Parameter(str, "Credential string"),
22 Parameter(type([str]), "List of credentials")),
25 returns = [Parameter(dict, "Dictionary of gids keyed on hrn")]
27 def call(self, xrns, creds):
28 # validate the credential
29 valid_creds = self.api.auth.checkCredentials(creds, 'getgids')
30 # xxxpylintxxx origin_hrn is unused..
31 origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
34 records = self.api.manager.resolve(self.api, xrns, full = False)
36 raise RecordNotFound(xrns)
38 allowed_fields = ['hrn', 'type', 'gid']
39 for record in records:
40 for key in record.keys():
41 if key not in allowed_fields: