a07bc1cfb7fe6c869d4272b0daa5924f0290d2a2
[plcapi.git] / PLC / Methods / SliceUpdate.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 SliceUpdate(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['url'],
25         Slice.fields['description'],
26         ]
27
28     returns = Parameter(int, '1 if successful')
29
30     def call(self, auth, slice_name, url, description):
31
32         slice_fields = {}
33         slice_fields['url'] = url
34         slice_fields['description'] = description
35         
36         return UpdateSlice.call(self, auth, slice_name, slice_fields)
37
38         return 1