2 from sfa.util.xrn import urn_to_hrn
3 from sfa.util.method import Method
4 from sfa.util.parameter import Parameter, Mixed
5 from sfa.util.record import SfaRecord
6 from sfa.trust.credential import Credential
10 List the records in an authority.
12 @param cred credential string specifying the rights of the caller
13 @param hrn human readable name of authority to list (hrn or urn)
14 @return list of record dictionaries
16 interfaces = ['registry']
19 Parameter(str, "Human readable name (hrn or urn)"),
20 Mixed(Parameter(str, "Credential string"),
21 Parameter(type([str]), "List of credentials")),
26 def call(self, xrn, creds):
27 hrn, type = urn_to_hrn(xrn)
28 valid_creds = self.api.auth.checkCredentials(creds, 'list')
31 origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
32 self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, hrn, self.name))
34 return self.api.manager.list(self.api, xrn)