2 from sfa.util.faults import *
3 from sfa.util.method import Method
4 from sfa.util.parameter import Parameter, Mixed
6 class RedeemTicket(Method):
9 @param cred credential string specifying the rights of the caller
11 @return 1 is successful, faults otherwise
14 interfaces = ['component']
17 Parameter(str, "Ticket string representation of SFA ticket"),
18 Mixed(Parameter(str, "Credential string"),
19 Parameter(type([str]), "List of credentials")),
22 returns = [Parameter(int, "1 if successful")]
24 def call(self, ticket, creds):
25 valid_creds = self.api.auth.checkCredentials(cred, 'redeemticket')
26 self.api.auth.check_ticket(ticket)
29 # send the call to the right manager
30 manager = self.api.get_interface_manager()
31 manager.redeem_ticket(self.api, ticket)