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
7 class ResolveSlices(Method):
9 This method is similar to GetSlices, except that (1) the returned
10 columns are restricted to 'name' and 'slice_id', and (2) it
11 returns expired slices too. This method is designed to help
12 third-party software solve slice names from their slice_id
13 (e.g. PlanetFlow Central). For this reason it is accessible with
14 anonymous authentication (among others).
17 roles = ['admin', 'pi', 'user', 'tech', 'anonymous' ]
20 'slice_id' : Slice.fields['slice_id'],
21 'name' : Slice.fields['name'],
26 Mixed([Mixed(Slice.fields['slice_id'],
27 Slice.fields['name'])],
28 Parameter(str,"name"),
29 Parameter(int,"slice_id"),
30 Filter(applicable_fields))
33 returns = [applicable_fields]
35 def call(self, auth, slice_filter = None):
37 # Must query at least slice_id (see below)
38 return_fields = self.applicable_fields.keys()
40 slices = Slices(self.api, slice_filter, return_fields, 0)