85540ff3880a8f8e67183d86209aa23667fc7bf3
[plcapi.git] / PLC / Methods / GetBootStates.py
1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.BootStates import BootState, BootStates
5 from PLC.Auth import Auth
6
7 class GetBootStates(Method):
8     """
9     Returns an array of all valid node boot states.
10     """
11
12     roles = ['admin', 'pi', 'user', 'tech']
13
14     accepts = [
15         Auth()
16         ]
17
18     returns = [BootState.fields['boot_state']]
19     
20
21     def call(self, auth):
22         return [boot_state['boot_state'] for boot_state in BootStates(self.api)]