34ca7be3aee0065d7071e1780599d8de533f64e5
[plcapi.git] / PLC / Methods / SliceRenew.py
1 # $Id$
2 import time
3
4 from PLC.Faults import *
5 from PLC.Method import Method
6 from PLC.Parameter import Parameter, Mixed
7 from PLC.Slices import Slice, Slices
8 from PLC.Auth import Auth
9 from PLC.Methods.UpdateSlice import UpdateSlice 
10
11 class SliceRenew(UpdateSlice):
12     """
13     Deprecated. See UpdateSlice.    
14
15     """
16
17     status = "deprecated"
18
19     roles = ['admin', 'pi', 'user']
20
21     accepts = [
22         Auth(),
23         Slice.fields['name'],
24         Slice.fields['expires']
25         ]
26
27     returns = Parameter(int, '1 if successful')
28
29     def call(self, auth, slice_name, slice_expires):
30
31         slice_fields = {}
32         slice_fields['expires'] = slice_expires
33         
34         return UpdateSlice.call(self, auth, slice_name, slice_fields)
35