X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=trunk%2FPLC%2FMethods%2FSliceUserDel.py;fp=trunk%2FPLC%2FMethods%2FSliceUserDel.py;h=0b41b158ebf5e3374ce5b141e31a11498bdad399;hb=5a4c1b1278ffa01e630fde47f7c54888ed20a576;hp=0000000000000000000000000000000000000000;hpb=cee5ab52df1c9f38b6eaff2dd354cb22f59028c7;p=plcapi.git diff --git a/trunk/PLC/Methods/SliceUserDel.py b/trunk/PLC/Methods/SliceUserDel.py new file mode 100644 index 0000000..0b41b15 --- /dev/null +++ b/trunk/PLC/Methods/SliceUserDel.py @@ -0,0 +1,35 @@ +from PLC.Faults import * +from PLC.Method import Method +from PLC.Parameter import Parameter, Mixed +from PLC.Auth import Auth +from PLC.Persons import Person, Persons +from PLC.Slices import Slice, Slices +from PLC.Methods.DeletePersonFromSlice import DeletePersonFromSlice + +class SliceUserDel(Method): + """ + Deprecated. Can be implemented with DeletePersonFromSlice. + + Removes the specified users from the specified slice. If the person is + already a member of the slice, no errors are returned. + + Returns 1 if successful, faults otherwise. + """ + + status = "deprecated" + + roles = ['admin', 'pi'] + + accepts = [ + Auth(), + Slice.fields['name'], + [Person.fields['email']], + ] + + returns = Parameter(int, '1 if successful') + + def call(self, auth, slice_name, user_list): + for user in user_list: + DeletePersonFromSlice.call(self, auth, user, slice_name) + + return 1