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):
11 @param cred credential string specifying the rights of the caller
13 @return 1 is successful, faults otherwise
16 interfaces = ['component']
19 Parameter(str, "Ticket string representation of SFA ticket"),
20 Mixed(Parameter(str, "Credential string"),
21 Parameter(type([str]), "List of credentials")),
24 returns = [Parameter(int, "1 if successful")]
26 def call(self, ticket, creds):
27 valid_creds = self.api.auth.checkCredentials(cred, 'redeemticket')
28 self.api.auth.check_ticket(ticket)
31 # send the call to the right manager
32 manager = self.api.get_interface_manager()
33 manager.redeem_ticket(self.api, ticket)