1 from geni.util.faults import *
2 from geni.util.excep import *
3 from geni.util.method import Method
4 from geni.util.parameter import Parameter, Mixed
5 from geni.util.auth import Auth
6 from geni.util.record import GeniRecord
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
14 @return list of record dictionaries
17 interfaces = ['registry']
20 Parameter(str, "Credential string"),
21 Parameter(str, "Human readable name (hrn)")
24 returns = [GeniRecord]
26 def call(self, cred, hrn):
28 self.api.auth.check(cred, 'list')
29 # is this a foreign authority
30 if not hrn.startswith(self.api.hrn):
31 for registry in self.api.registries:
32 if hrn.startswith(registry):
33 records = self.api.registries[registry].list(self.api.credential, hrn)
36 if not self.api.auth.hierarchy.auth_exists(hrn):
37 raise MissingAuthority(hrn)
38 table = self.api.auth.get_auth_table(hrn)
39 records = table.list()