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