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