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.Nodes import Node, Nodes
7 from PLC.Methods.GetSlices import GetSlices
9 class SliceNodesList(Method):
11 Deprecated. Can be implemented with GetSlices.
17 roles = ['admin', 'pi', 'user']
21 Slice.fields['slice_name']
24 returns = [Node.fields['hostname']]
27 def call(self, auth, slice_name):
28 # If we are not admin, make sure to return only viewable
30 slices = GetSlices(self, auth, [slice_name])
32 nodes = Nodes(self.api, slice['node_ids'])
36 node_hostnames = [node['hostname'] for node in nodes]