1 from sfa.util.method import Method
2 from sfa.util.parameter import Parameter, Mixed
4 class RedeemTicket(Method):
7 @param cred credential string specifying the rights of the caller
9 @return 1 is successful, faults otherwise
12 interfaces = ['component']
15 Parameter(str, "Ticket string representation of SFA ticket"),
16 Mixed(Parameter(str, "Credential string"),
17 Parameter(type([str]), "List of credentials")),
20 returns = [Parameter(int, "1 if successful")]
22 def call(self, ticket, creds):
23 valid_creds = self.api.auth.checkCredentials(cred, 'redeemticket')
24 self.api.auth.check_ticket(ticket)
26 # send the call to the right manager
27 self.api.manager.redeem_ticket(self.api, ticket)