fixed up the names of new site names/slices to be more PLC compatible
[sfa.git] / sfa / methods / get_credential.py
1 ### $Id$
2 ### $URL$
3
4 from sfa.trust.credential import *
5 from sfa.trust.rights import *
6 from sfa.util.faults import *
7 from sfa.util.namespace import *
8 from sfa.util.method import Method
9 from sfa.util.parameter import Parameter, Mixed
10 from sfa.methods.GetCredential import GetCredential
11
12 class get_credential(GetCredential):
13     """
14     Deprecated. Use GetCredential instead.
15
16     Retrive a credential for an object
17     If cred == Nonee then the behavior reverts to get_self_credential
18
19     @param cred credential object specifying rights of the caller
20     @param type type of object (user | slice | sa | ma | node)
21     @param hrn human readable name of object (hrn or urn)
22
23     @return the string representation of a credential object  
24     """
25
26     interfaces = ['registry']
27     
28     accepts = [
29         Mixed(Parameter(str, "credential"),
30               Parameter(None, "No credential")),  
31         Parameter(str, "Human readable name (hrn or urn)")
32         ]
33
34     returns = Parameter(str, "String representation of a credential object")
35
36     def call(self, cred, type, xrn, origin_hrn=None):
37         return GetCredential.call(self, cred, xrn, type)