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