1 ### $Id: list.py 16588 2010-01-13 17:53:44Z anil $
2 ### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/methods/list.py $
4 from sfa.util.faults import *
5 from sfa.util.namespace import *
6 from sfa.util.method import Method
7 from sfa.util.parameter import Parameter, Mixed
8 from sfa.util.record import SfaRecord
9 from sfa.trust.credential import Credential
13 List the records in an authority.
15 @param cred credential string specifying the rights of the caller
16 @param hrn human readable name of authority to list (hrn or urn)
17 @return list of record dictionaries
19 interfaces = ['registry']
22 Parameter(str, "Human readable name (hrn or urn)"),
23 Mixed(Parameter(str, "Credential string"),
24 Parameter(type([str]), "List of credentials")),
29 def call(self, xrn, creds):
30 hrn, type = urn_to_hrn(xrn)
31 valid_creds = self.api.auth.checkCredentials(creds, 'list')
34 origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
35 self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, hrn, self.name))
37 manager = self.api.get_interface_manager()
38 return manager.list(self.api, xrn)