get rid of svn keywords once and for good
[plcapi.git] / PLC / Methods / SliceUserDel.py
1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Auth import Auth
5 from PLC.Persons import Person, Persons
6 from PLC.Slices import Slice, Slices
7 from PLC.Methods.DeletePersonFromSlice import DeletePersonFromSlice
8
9 class SliceUserDel(Method):
10     """
11     Deprecated. Can be implemented with DeletePersonFromSlice.
12
13     Removes the specified users from the specified slice. If the person is
14     already a member of the slice, no errors are returned.
15
16     Returns 1 if successful, faults otherwise.
17     """
18
19     status = "deprecated"
20
21     roles = ['admin', 'pi']
22
23     accepts = [
24         Auth(),
25         Slice.fields['name'],
26         [Person.fields['email']],
27         ]
28
29     returns = Parameter(int, '1 if successful')
30
31     def call(self, auth, slice_name, user_list):
32         for user in user_list:
33             DeletePersonFromSlice.call(self, auth, user, slice_name)
34
35         return 1