1 from sfa.util.faults import *
2 from sfa.util.namespace import *
3 from sfa.util.method import Method
4 from sfa.util.parameter import Parameter
5 from sfa.trust.credential import Credential
9 Lookup a URN and return information about the corresponding object.
10 @param slice_urn (string) URN of slice to renew
11 @param credentials ([string]) of credentials
14 interfaces = ['registry']
16 Parameter(str, "URN"),
17 Parameter(type([str]), "List of credentials"),
19 returns = Parameter(bool, "Success or Failure")
21 def call(self, xrn, creds):
24 self.api.auth.check(cred, 'resolve')
25 # Make sure it's an authority and not a user
26 if cred.get_gid_caller().get_type() != 'authority':
34 raise InsufficientRights('Resolve: Credentials either did not verify, were no longer valid, or did not have appropriate privileges')
37 manager_base = 'sfa.managers'
39 if self.api.interface in ['registry']:
40 mgr_type = self.api.config.SFA_REGISTRY_TYPE
41 manager_module = manager_base + ".registry_manager_%s" % mgr_type
42 manager = __import__(manager_module, fromlist=[manager_base])
43 return manager.Resolve(self.api, xrn, creds)