1 from PLC.Method import Method
2 from PLC.Parameter import Parameter, Mixed
3 from PLC.Filter import Filter
4 from PLC.Auth import Auth
5 from PLC.Slices import Slice, Slices
6 from PLC.Persons import Person, Persons
8 class SliceListUserSlices(Method):
10 Deprecated. Can be implemented with GetPersons.
12 Return the slices the specified user (by email address) is a member of.
14 Users may only query slices of which they are members. PIs may
15 query any of the slices at their sites. Admins may query any
16 slice. If a slice that cannot be queried is specified in
17 slice_filter, details about that slice will not be returned.
20 roles = ['admin', 'pi', 'user']
24 Parameter(str, "Slice prefix", nullok = True)
27 returns = [Slice.fields]
30 def call(self, auth, email):
32 persons = Persons(self.api, [email])
36 slice_ids = person['slice_ids']
39 slices = Slices(self.api, slice_ids)
40 slice_names = [slice['name'] for slice in slices]