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.util.record import SfaRecord
7 from sfa.trust.credential import Credential
11 List the records in an authority.
13 @param cred credential string specifying the rights of the caller
14 @param hrn human readable name of authority to list (hrn or urn)
15 @return list of record dictionaries
17 interfaces = ['registry']
20 Parameter(str, "Human readable name (hrn or urn)"),
21 Mixed(Parameter(str, "Credential string"),
22 Parameter(type([str]), "List of credentials")),
27 def call(self, xrn, creds):
28 hrn, type = urn_to_hrn(xrn)
29 valid_creds = self.api.auth.checkCredentials(creds, 'list')
32 origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
33 self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, hrn, self.name))
35 manager = self.api.get_interface_manager()
36 return manager.list(self.api, xrn)