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