1 ### $Id: reset_slice.py 15428 2009-10-23 15:28:03Z tmack $
2 ### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfacomponent/methods/reset_slice.py $
4 from sfa.util.faults import *
5 from sfa.util.method import Method
6 from sfa.util.parameter import Parameter, Mixed
8 class RedeemTicket(Method):
10 Deprecated. Use RedeemTicket instead.
12 @param cred credential string specifying the rights of the caller
14 @return 1 is successful, faults otherwise
17 interfaces = ['component']
20 Parameter(str, "Ticket string representation of SFA ticket"),
21 Mixed(Parameter(str, "Credential string"),
22 Parameter(type([str]), "List of credentials")),
25 returns = [Parameter(int, "1 if successful")]
27 def call(self, ticket, creds):
28 valid_creds = self.api.auth.checkCredentials(cred, 'redeemticket')
29 self.api.auth.check_ticket(ticket)
32 # send the call to the right manager
33 manager = self.api.get_interface_manager()
34 manager.redeem_ticket(self.api, ticket)