1 from sfa.util.method import Method
3 from sfa.storage.parameter import Parameter, Mixed
5 class RedeemTicket(Method):
8 @param cred credential string specifying the rights of the caller
10 @return 1 is successful, faults otherwise
13 interfaces = ['component']
16 Parameter(str, "Ticket string representation of SFA ticket"),
17 Mixed(Parameter(str, "Credential string"),
18 Parameter(type([str]), "List of credentials")),
21 returns = [Parameter(int, "1 if successful")]
23 def call(self, ticket, creds):
24 valid_creds = self.api.auth.checkCredentials(cred, 'redeemticket')
25 self.api.auth.check_ticket(ticket)
27 # send the call to the right manager
28 self.api.manager.redeem_ticket(self.api, ticket)