4 from PLC.Method import Method
5 from PLC.Parameter import Parameter, Mixed
6 from PLC.Filter import Filter
7 from PLC.Auth import Auth
8 from PLC.Slices import Slice, Slices
10 class ResolveSlices(Method):
12 This method is similar to GetSlices, except that (1) the returned
13 columns are restricted to 'name' and 'slice_id', and (2) it
14 returns expired slices too. This method is designed to help
15 third-party software solve slice names from their slice_id
16 (e.g. PlanetFlow Central). For this reason it is accessible with
17 anonymous authentication (among others).
20 roles = ['admin', 'pi', 'user', 'tech', 'anonymous' ]
23 'slice_id' : Slice.fields['slice_id'],
24 'name' : Slice.fields['name'],
29 Mixed([Mixed(Slice.fields['slice_id'],
30 Slice.fields['name'])],
31 Parameter(str,"name"),
32 Parameter(int,"slice_id"),
33 Filter(applicable_fields))
36 returns = [applicable_fields]
38 def call(self, auth, slice_filter = None):
40 # Must query at least slice_id (see below)
41 return_fields = self.applicable_fields.keys()
43 slices = Slices(self.api, slice_filter, return_fields, 0)